gui: reorder overview tiles card#10217
Conversation
a934bae to
0261ec7
Compare
0261ec7 to
edb6463
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a stable, explicit “display order” for topology tiles in the disco GUI so the overview tiles card (and associated tile-ordered JSON outputs) render in a preferred, human-friendly sequence rather than raw topo->tiles[] order.
Changes:
- Added persistent storage in
fd_gui_t.summaryfor a computed tile index ordering (tile[]+tile_cnt). - Added a one-time init-time builder (
fd_gui_build_tile_order) that orders known tile kinds first, then appends any remaining tiles. - Updated tile JSON emitters in
fd_gui_printf.cto iterate using the new display order and to index timer/metric snapshots by the underlying topo tile index (not the display-loop index).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/disco/gui/fd_gui.h |
Adds summary.tile[] and summary.tile_cnt to store topo tile indices in display order. |
src/disco/gui/fd_gui.c |
Builds the tile display order once during fd_gui_new() initialization. |
src/disco/gui/fd_gui_printf.c |
Switches tile-related JSON output loops to use the precomputed display order while keeping snapshot indexing consistent with topo indices. |
Greptile SummaryThis PR introduces a deterministic display order for tiles in the GUI overview card, instead of using the raw topology insertion order. A new function
Confidence Score: 5/5This PR is safe to merge — it is a clean, well-structured display-order refactor with no logic changes to data collection. The change is a straightforward permutation of tile display order. The build function correctly places all tiles (handling duplicates and unknowns). All printf loops are consistently updated to use the mapping, and raw-indexed timer/metric arrays are correctly dereferenced via the remapped index. No remaining inconsistent iteration patterns were found in fd_gui_printf.c. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Init as fd_gui_new
participant Build as fd_gui_build_tile_order
participant Snap as fd_gui_tile_timers_snap
participant Printf as fd_gui_printf_* (display)
Init->>Build: Called once at init
Build->>Build: Iterate hardcoded display order names
Build->>Build: Match topology tiles, build summary.tile[] permutation
Build->>Build: Append unmatched tiles at end
Build-->>Init: summary.tile[] and summary.tile_cnt set
Note over Snap: Periodic timer snapshots
Snap->>Snap: Store metrics at raw topology index cur[i]
Note over Printf: On GUI request
Printf->>Printf: for i in 0..summary.tile_cnt
Printf->>Printf: t = summary.tile[i] (display to raw mapping)
Printf->>Printf: Access cur[t] / prev[t] for timer data
Printf->>Printf: Output tile name, metrics in display order
Reviews (1): Last reviewed commit: "gui: reorder overview tiles card" | Re-trigger Greptile |
No description provided.