summaryrefslogtreecommitdiff
path: root/internal/tui/dashboard/model_test.go
AgeCommit message (Collapse)Author
2026-05-26flamegraph: add LiveTrie height metric ingestion (task qo)Paul Buetow
2026-05-14wire TUIFastRefreshInterval into dashboard model and update testsPaul Buetow
Add fastRefreshMs parameter to NewModelWithConfig so callers can supply the high-frequency tick cadence for stream and flame tabs. Convert the streamTickCmd/flameTickCmd package-level functions to model methods that honour fastRefreshEvery (falling back to the 200 ms constants when zero for backward-compatibility). Add SetFastRefreshInterval setter so RunWithTraceStarterConfig can apply cfg.TUIFastRefreshInterval after construction. Update all 68 test call sites to pass fastRefreshMs=200 and add three new tests covering zero-fallback, stored value, and setter behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13keep View() pure by moving state transitions into Update() handlersPaul Buetow
The dashboard model's View() was mutating sub-model state on every render: it called streamModel.SetFooterVisible() and flameModel.SetViewport() on local copies instead of keeping those fields in sync through Update(). Moved the sync points to the Update() handlers that trigger each change: - handleWindowSize: syncs stream footer visibility alongside SetViewport - handleHelpToggleKey: already updated flame viewport; now also updates stream footer visibility when the help bar is toggled - handleKey: syncs flame viewport when switching to the flame tab, covering the case that window-resize and help-toggle do not Aligned the stream model's initial showFooter value with the dashboard's default showHelp=false in NewModelWithConfig so there is no mismatch on the first render. Also extracted numeric tab shortcuts into the tab registry via ShortcutKey fields so handleShortcutKey no longer needs updating when tabs are added. Updated two tests that bypassed Update() to set dimensions directly; they now use WindowSizeMsg so sub-model viewports are initialised correctly under the new pure-View contract. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13perf: replace string += concatenation with strings.Builder in TUI render hot ↵Paul Buetow
paths Swap out ad-hoc += string concatenation in the flamegraph toolbar/status lines, dashboard filter summary, bubble/treemap status lines, eventstream view, processes tab, and probes list for strings.Builder, eliminating redundant allocations on every render tick. Also update dashboard/model_test.go fake SnapshotSource implementations to match the updated interface signature. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12extract dashboard tab framework into Tab registry for OCP compliancePaul Buetow
Introduce tabDescriptor struct and tabDescriptors map in new tabregistry.go. Each tab registers its name, short name, ordered position, allowed viz modes, render function, scroll handler, and optional init tick command. Adding a new tab now requires only a single registry entry — no existing switch/if chains need editing. Key changes: - Tab.String() and tabLabel() use lookupTab() instead of a switch - renderActiveTabContent() dispatches via d.Render (replaces renderActiveTab switch) - handleScrollKey() dispatches via d.HandleScroll (replaces tab switch) - Init() and postKeyTransitionCmd() use d.InitCmd (replaces stream/flame tab checks) - allowedVizModes() delegates to tabAllowedVizModes() from registry - orderedTabs() replaces hardcoded allTabs slice, derived from Position field - bubbleChartFor() helper eliminates 5 repeated switch-on-tab for chart ops - toggleBubbleMetric, tickActiveBubbleChart, moveBubbleSelection, activeBubbleChartHasNodes all use bubbleChartFor() - refreshBubbleData split into two focused functions under 50 lines - Two pre-existing test functions over 50 lines refactored All tests pass; go build ./internal/tui/... clean. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09show auto-reset countdown and document the cyclePaul Buetow
Renders the next-tick countdown ("12s/30s") in the dashboard chrome so users can see when aggregates will clear, and adds a dedicated H-help line spelling out the cycle keys (off → 10s → 30s → 1m → 2m → 5m). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09refine auto-reset timer cycle and pause on blurPaul Buetow
Two follow-up refinements to the auto-reset timer added in 8da473a. - Hotkey cycle now goes off -> 10s -> 30s -> 60s -> 2m -> 5m -> off, giving the user finer control between 60s and 5m and a quicker starting cadence. - The timer now pauses while the TUI is blurred. SetFocused returns a tea.Cmd that re-arms a fresh tick on focus regain, and bumps the generation counter on every focus change so any tick scheduled before blur is dropped on arrival. autoResetTickCmd and handleAutoResetTick also gate on m.focused as defense in depth. - Dashboard chrome shows 'auto-reset: 30s (paused)' while the timer is enabled but blurred, distinguishing it from the disabled 'off' state. Tests cover the full preset cycle (including custom-value passthrough) and the pause-on-blur lifecycle: stale ticks ignored, current-gen ticks ignored while blurred, focus regain re-arms and fires the reset, no-op focus calls don't churn the generation counter, and the chrome label flips to '(paused)' as expected. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-03-10dashboard: centralize nil snapshot fallback (task 385)Paul Buetow
2026-03-10dashboard: unify viewport chrome calculation (task 388)Paul Buetow
2026-03-09tui: add reverse sorting for dashboard tables (task 364)Paul Buetow
2026-03-09tui: add sortable processes dashboard table (task 365)Paul Buetow
2026-03-09tui: add sortable files dashboard table modes (task 364)Paul Buetow
2026-03-09tui: add sortable syscalls dashboard table (task 363)Paul Buetow
2026-03-09tui: harden paused flame renderingPaul Buetow
2026-03-08tui: unify table navigation and renderingPaul Buetow
2026-03-08tui: add process-tab enter filter pushPaul Buetow
2026-03-08dashboard: clamp icicle selection by rendered tile countPaul Buetow
2026-03-08dashboard: wire files icicle mode and root path labelsPaul Buetow
2026-03-06fix(tui): restore bubble modes and stabilize flame zoom lineagePaul Buetow
2026-03-06feat(tui): add flamegraph click lineage undo and scope quit keyPaul Buetow
2026-03-06feat(tui): use treemap as second viz for files and processesPaul Buetow
2026-03-06feat(tui): add files icicle visualization mode (task 383)Paul Buetow
2026-03-06feat(tui): add syscalls treemap visualization mode (task 383)Paul Buetow
2026-03-06refactor(tui): add dashboard viz mode registry (task 382)Paul Buetow
2026-03-06feat(tui): add dashboard bubble viz and expand help shortcutsPaul Buetow
2026-03-06Fix real live flamegraph key handling and startup viewport syncPaul Buetow
2026-03-06Add live flamegraph test modes and dynamic synthetic live feedPaul Buetow
2026-03-06Fix flamegraph navigation, filtering, and system-share feedbackPaul Buetow
2026-03-05Make flame tab default and fix flame hotkey routingPaul Buetow
2026-03-05task 366: validate flamegraph tab integration checkpointPaul Buetow
2026-03-05task 354: wire dashboard flame tab to LiveTriePaul Buetow
2026-03-05task 350: add TabFlame tab infrastructurePaul Buetow
2026-03-05feat(tui): migrate Bubble Tea stack to charm.land v2Paul Buetow
2026-03-01Thread runtime config instead of global flags readsPaul Buetow
2026-02-27dashboard: align stream row test with footer visibilityPaul Buetow
2026-02-26tui: clarify export help and toggle help bar with uppercase HPaul Buetow
2026-02-26tui: add paused stream column selection and split pid/tidPaul Buetow
2026-02-26tui: revamp status keys and add pid/tid reselection flowPaul Buetow
2026-02-26tui: fix responsive layout and stream viewport chromePaul Buetow
2026-02-25Fix stream paused scrolling and apply pending TUI/probe updatesPaul Buetow
2026-02-25Wire grouped files mode into active tab renderingPaul Buetow
2026-02-25Clamp grouped-files cursor on stats refreshPaul Buetow
2026-02-25Route files scrolling to grouped-directory offsetPaul Buetow
2026-02-25Toggle files directory grouping with d keyPaul Buetow
2026-02-25Improve TUI layout and increase sparkline heightPaul Buetow
2026-02-25Integrate Stream tab into dashboard and TUIPaul Buetow
2026-02-24tui: improve dashboard tab navigation and live updatesPaul Buetow
2026-02-24tui: address review feedback for dashboard and exportPaul Buetow
2026-02-24tui: wire full dashboard tabs and improve overview summariesPaul Buetow
2026-02-24tui/dashboard: implement files tab with scrollingPaul Buetow