feat: modularize TUI dashboard components into individual view files #363
Merged
SuperCoolPencil merged 30 commits intomainfrom Apr 16, 2026
Merged
feat: modularize TUI dashboard components into individual view files #363SuperCoolPencil merged 30 commits intomainfrom
SuperCoolPencil merged 30 commits intomainfrom
Conversation
…and implement network activity graph and download list UI
…lue rendering and remove redundant whitespace
df9d199 to
1705203
Compare
…alculations and content wrapping for log and header views
…s across TUI components
…improved navigation
…show details below the download list
…ulation while removing unused layout optimization fields
…ndering logic with tea commands
… prevent redundant computations
… comments and documentation
…rce explicit body dimensions
…ng offset across TUI components
…d conditionally render chunk map layout
…ayout calculations
Member
Author
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.



Greptile Summary
This PR splits the monolithic TUI view into focused per-component files (
view_dashboard_*.go) and introduces a centralisedDashboardLayoutstruct that drives all dimension calculations. It also resolves several bugs flagged in prior review rounds: theGotoBottom-on-every-frame scroll lock, the inflatedGetGraphAreaDimensionsargument, theprocessProgressMsgdiscarding itstea.Cmd, theAvailableHeightvs rawtermHthreshold mismatch, and the missing cancel-path restore forfilepickerOriginalPath.Confidence Score: 5/5
Safe to merge — all previously flagged P0/P1 bugs are resolved; remaining findings are P2 style clean-ups.
All critical layout, scroll-lock, tea.Cmd propagation, and threshold bugs from prior review rounds appear addressed in this version. The three remaining comments (dead
foundvariable,SingleLineHeightused as a width offset, and per-iteration style allocation in the modal loop) are minor readability issues with no runtime impact.internal/tui/update_events.go (dead
foundvariable), internal/tui/view.go (SingleLineHeight as horizontal offset), internal/tui/components/add_download_modal.go (style allocation in loop)Important Files Changed
foundvariable left over from refactoring.widthdirectly to GetGraphAreaDimensions, fixing the previous contentWidth+4 inflation that could overflow boxes.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD WS[WindowSizeMsg] --> CDL[CalculateDashboardLayout] CDL --> LVP[logViewport.SetWidth/Height] CDL --> LSZ[list.SetSize] CDL --> FPH[filepicker.SetHeight] View[View] --> CDL2[CalculateDashboardLayout] CDL2 --> HB[renderHeaderBox\nview_dashboard_header.go] CDL2 --> LB[renderLogBox\nview_dashboard_log.go] CDL2 --> DL[renderDownloadsBox\nview_dashboard_list.go] CDL2 --> GB[renderGraphBox\nview_dashboard_graph.go] CDL2 --> DB[renderDetailsBox\nview_dashboard_details.go] CDL2 --> CB[renderChunkMapBox\nview_dashboard_chunkmap.go] HB & LB --> Header[headerBox] GB & DB & CB --> RightCol[rightColumn] Header & DL & RightCol --> Body[body] Body --> FV[fullView + footer]Comments Outside Diff (1)
internal/tui/view.go, line 326-342 (link)renderFocusedDetailsis called here to measuredetailHeightfor layout, usingdetailWidth = rightWidth - PaneStyle.GetHorizontalFrameSize(). BecauseDefaultPaddingX = 1,PaneStyle.GetHorizontalFrameSize() = 4, so the measurement width isrightWidth - 4.renderDetailsBoxthen callsrenderFocusedDetailsagain internally withcontentWidth = width - 2 = rightWidth - 2— 2 units wider. InsiderenderFocusedDetails, the actual inner content width isw - 4, so:contentWidth = rightWidth - 8contentWidth = rightWidth - 6If any text (filename, path, ID, stats) wraps at one width but not the other, the measured
detailHeightdiverges from the actual rendered height, mis-sizing the right column's layout. The original code computed this once with a consistent width.The simplest fix is to pass the already-computed
detailContentintorenderDetailsBoxinstead of recomputing:Prompt To Fix With AI
Prompt To Fix All With AI
Reviews (10): Last reviewed commit: "chore: update demo assets and record new..." | Re-trigger Greptile