Repository navigation
fix(pbtop): focus the first chart panel on a fresh start - #1875
Merged
Merged
Conversation
A fresh start kept the focus on Models, which the Charts tab does not show, so fix_focus fell back to its first slot: the spend.daily table. Fall back to the first focusable slot that draws a chart instead, and to the first slot when the tab has none. Screenshots now start the tab the way the app does. Signed-off-by: igorjs <2278164+igorjs@users.noreply.github.com>
igorjs
marked this pull request as ready for review
November 19, 2026 09:00
igorjs
enabled auto-merge
November 19, 2026 09:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On a fresh install pbtop opened on the Charts tab with the focus on the spend.daily table, so the first screen highlighted a table instead of a chart.
Cause:
App::newsets the focus to Models. The default Charts tab has no Models panel, sofix_focusfell back to the first slot,spend.daily. The saved screen setup holds a tab but no focus, so a fresh start and a saved start both went through that fallback.Change: the fallback now picks the first focusable slot that draws a chart (Tokens on the default layout, since the burn-up takes no focus), and the first slot when the tab has none. A saved tab still wins, and a focus already on a shown panel is kept. The chart test is now one helper,
draws_chart, shared withchart_slot.The pbtop pictures start their tab through
go_tab, as the app does, so they show the real first screen. They are regenerated and hold no@or email.Notes for reviewers
cargo test -p playbook-telemetrywithUPDATE_SNAPSHOTS=1regenerated the docs SVGs;cargo clippy -p playbook-telemetry --all-targets -- -D warningsis clean.