Repository navigation
Keep loop bar text clear of its buttons at narrow widths - #642
Merged
Merged
Conversation
At a 960px window with the sidebar rail and loop detail panel visible, the loop bar's metadata line (backend, elapsed, pass, usage) was drawn at a fixed offset into a fixed 220px rect and ran underneath Stop loop and Show in graph. Extract the bar geometry into LoopBarLayout.zig and use it as the single source for painting, mouse hit-testing, and UIA bounds. Every text run is now clamped to the space left of the leftmost button, ellipsized when squeezed, and dropped when narrower than 24px. Wide-window geometry is unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Colin Neilens <coneilen@microsoft.com>
coneilen
force-pushed
the
coneilen-fix-loop-bar-narrow-overlap
branch
from
October 6, 2026 23:59
6a7dc5d to
f2fce0e
Compare
This was referenced Oct 7, 2026
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 the beta10 Dev Box qualification (100% DPI, 960px shell, sidebar rail and loop detail panel visible) the workspace loop bar drew its metadata line (
copilotCLI · elapsed >1h · pass 0 · usage n/a) underneath theStop loopandShow in graphbuttons. This makes every loop-bar text run stay to the left of the leftmost button at any width, while leaving the wide-window layout unchanged.Changes
graphcode-windows/src/LoopBarLayout.zigcomputes the bar's geometry: stripe, title, state, activity, and metadata text rects, plus the Stop and Show in graph button rects. Text rects are clamped to 8px left of the leftmost button (Show in graph when the loop is resolved), and a run narrower than 24px is dropped. At widths where nothing is clamped, every rect is identical to the previous hard-coded geometry.TerminalSurface.paintLoopBarpaints from that layout. Clamped text runs are drawn withDT_END_ELLIPSIS; unclamped runs keep the previous 220px clip with no ellipsis.loopBarActionAt(mouse hit-testing) and theworkspace-loop-bar/workspace-stop/workspace-show-graphUIA bounds inApp.zignow read the same layout, so drawn buttons, clicks, and UIA share one source of truth. The numbers are unchanged: buttons still sit at the same offsets, clicks still accept the bar's full height in the button columns, and UIA bounds are still the 26px button rects.Tools/windows/Tests/WindowsShell.Tests.ps1("Loop bar layout executable tests";-PlanOnlyassigns it to shard 2 of 3, catalog now 55 sections).investigation/ui-parity-matrix.mdLoop bar row goes fromValidatedtoPartial. The overlap was a live defect, and the fix has only unit-test evidence. At 960px with the rail and panel visible, the metadata line is now dropped (4px of room), whereas macOS truncates within an HStack. The dated 2026-10-01 audit total (62/36) is a historical snapshot and is left as written.Elapsed/age computation is untouched (another session owns the
elapsedLabelepoch fix).Not changed, noted for follow-up: the mouse hit-test in
App.zigpassesclient.right - loop_detail_widtheven when the detail panel is hidden, while paint and UIA use the full width in that state. In that state the panel expand control is also painted over Show in graph. Fixing that needs a layout decision for the expand control, so it is out of scope here.Test plan
All commands ran from
graphcode-windowswith the pinned Zig 0.15.2 (C:\gc-tools\zig-0.15.2\zig.exe). RED was taken with the final tests againstLoopBarLayout.zigwhosecomputereproduced the pre-fix unclamped geometry. The failing assertion is!run.intersects(layout.show_graph)/!run.intersects(stop), a behavioral failure, not a compile error. The 960px case puts the metadata rect at x 480..700, across Stop 492..576 and Show in graph 584..676.RED: zig test src\LoopBarLayout.zig (unclamped pre-fix geometry) -> 2 passed; 0 skipped; 4 failed: 960px, 1056px, extremely narrow, and resolved cases fail expectClearOfButtons because text rects intersect the Show in graph and Stop rects; the 1280px unchanged-geometry and hit tests pass
GREEN: zig test src\LoopBarLayout.zig -> All 6 tests passed
REGRESSION: zig test src\TerminalSurface.zig -target x86_64-windows-msvc -lc -luser32 -lgdi32 -ladvapi32 -I C:\gc-providers\winghostty\include plus ghostty-vt-static.lib -> All 146 tests passed, including 6 LoopBarLayout and the existing loop bar action test
Additional checks and their limits:
zig test src\App.zig -DUNICODE -D_UNICODE -target x86_64-windows-msvc -lc -I...\winghostty\include -fno-emit-bin: exit 0, semantic analysis only. No Winghostty host lib was available locally, so App tests were not executed. A temporary type-error probe confirmed this analysis reaches the changedsyncAccessibilitycode.zig build-exe src\main.zig ... -fno-emit-binwith a stubbuild_optionsmodule: exit 0. A probe confirmed it analyzespaintLoopBar→drawUtf8Bounded, and it caught aDrawTextWformat-type error that was fixed before commit.ghostty-vt-static.libprebuilt in another local worktree, not one produced byprepare-terminal-vtin this branch.WindowsShell.Tests.ps1 -PlanOnly -Shard 0..2 -ShardCount 3: the new section is planned on shard 2.zig build,validate.ps1 -Task windows-shell, the App executable tests, and the UIA live gate. CI covers these.Checklist
git commit -s) per the DCOmake test) (macOS-only target; not run. This change is Windows-only. Focused Zig tests above)make check) (macOS Swift lint; not applicable to these Zig files; not run)