fix(pager): extend row backgrounds to host edge - #571
Conversation
Greptile SummaryThis PR fixes a visual bug in the static diff pager where colored row backgrounds (for added/removed lines) were truncated at the last character rather than extending to the host panel edge. The fix introduces a
Confidence Score: 5/5Safe to merge — the change is a minimal, well-scoped addition to the static stack renderer with no impact on the interactive TUI path or split mode. The fill is correctly gated on a valid hex color so rows without a background emit nothing. The RESET after EL prevents bleed to the next line. Security tests were updated to strip the newly intentional \x1b[K before checking for unsafe controls, and the renamed helper's regex is accurate. The new regression test directly asserts the expected byte sequence on both the added and removed lines. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[renderStaticStackRow] --> B{row.type?}
B -->|collapsed| C[renderHeaderLikeRow
theme.panelAlt bg]
B -->|hunk-header| D[renderHeaderLikeRow
theme.panelAlt bg]
B -->|stack-line| E[stackCellPalette
resolve colors]
E --> F[colorText marker]
F --> G[colorText gutter]
G --> H[serializeSpans
with contentBg]
H --> I[fillRemainingLine
contentBg]
I --> J{ansiColor valid?}
J -->|yes - non-empty hex| K[emit background + EL + RESET
Extends bg to host panel edge]
J -->|no - empty/transparent| L[emit empty string
no fill]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[renderStaticStackRow] --> B{row.type?}
B -->|collapsed| C[renderHeaderLikeRow
theme.panelAlt bg]
B -->|hunk-header| D[renderHeaderLikeRow
theme.panelAlt bg]
B -->|stack-line| E[stackCellPalette
resolve colors]
E --> F[colorText marker]
F --> G[colorText gutter]
G --> H[serializeSpans
with contentBg]
H --> I[fillRemainingLine
contentBg]
I --> J{ansiColor valid?}
J -->|yes - non-empty hex| K[emit background + EL + RESET
Extends bg to host panel edge]
J -->|no - empty/transparent| L[emit empty string
no fill]
Reviews (1): Last reviewed commit: "fix(pager): extend row backgrounds to ho..." | Re-trigger Greptile |
Summary
Closes #562.
Testing
bun run typecheckbun run lintbun test src/ui/staticDiffPager.test.ts(12 passed)bun test ./src ./packages ./scripts ./test/cli ./test/session(1,182 passed, 5 skipped)bun run test:tty-smoke(9 passed)origin/mainbun run test:integration(54 passed, 1 unrelated watch-mode failure reproduced onorigin/main)This PR description was generated by Pi using OpenAI GPT-5.3 Codex