Skip to content

Keep Show in Graph clear of the collapsed loop panel's expand control - #659

Merged
coneilen merged 3 commits into
mainfrom
coneilen-fix-loop-panel-toggle-overlap
Oct 8, 2026
Merged

coneilen merged 3 commits into
mainfrom
coneilen-fix-loop-panel-toggle-overlap

Conversation

@coneilen

@coneilen coneilen commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #658. With the loop detail panel collapsed, the "Loop panel" expand control was painted over the loop bar's Show in graph button, so pointer users could not reach Show in graph. This PR gives the expand control its own trailing slot in the loop bar and fixes two related routing bugs that also blocked collapsed-state clicks.

Changes

  • Overlap. Collapsed, the expand control (client.right-104..-14) sat on top of Show in graph (right-104..-12). LoopBarLayout.compute now takes a panel_toggle flag. When it is set, the expand control takes the bar's trailing slot and Show in graph and Stop move left of it, with the existing 8 px gap. GraphCanvas.loopDetailExpandBounds now reads that same rect.
  • Hit-testing. The bar's pointer hit layout always used client.right - loop_detail_width. With the panel collapsed, Stop and Show in graph were hit-tested 272 px left of where they were drawn. A new App.workspaceLoopBar helper now computes the bar layout, and painting, WM_LBUTTONDOWN hit-testing, and UIA (workspace-show-graph-*, workspace-stop-*, workspace-toggle-panel-*) all use it.
  • Routing. In a collapsed loop workspace, WM_LBUTTONDOWN used the graph surface's workspace_top (client_bottom). So no click under the header reached the workspace block (panel toggle, loop bar, tab chrome). Those clicks fell through to the hidden graph. Loop workspaces now route from the header down whatever the panel state.
  • Tests:
    • A native-linked App test runs at 1200 and 960 logical px and at 100% and 150% DPI. It sends WM_LBUTTONDOWN/UP at the UIA-published centers of Collapse, Stop (asserts one stopNode for the open loop, panel unchanged), Show in graph (asserts the graph is shown, panel state unchanged, no outbound frames) and Expand. It also asserts that the three controls are pairwise disjoint and inside the client area, both expanded and collapsed.
    • LoopBarLayout gains collapsed-slot geometry tests at 1280/1200/960 px, for both active and resolved loops.
    • A second native App test runs with the panel collapsed at 1200 and 960 px and at 96 and 144 DPI. It presses a workspace tab and the loop bar's Stop and checks, between DOWN and UP, that no graph pan, node drag or edge drag began. It also requires the tab selection to change and Stop to send one stopNode for the open loop.
    • Existing callers pass false; their geometry is unchanged.
  • investigation/ui-parity-matrix.md: the "Right loop panel" row moves from Validated to Partial. Its live gate only toggled through UIA invoke, and the new collapsed geometry has unit evidence only.

Test plan

All runs used the pinned Zig 0.15.2 from Tools\windows\bootstrap.ps1 -SkipSwift, run from graphcode-windows. zig test src\App.zig used the full native link line from Tools\windows\Tests\WindowsShell.Tests.ps1 ("App shell executable tests").

RED: zig test src\App.zig (App shell link flags) --test-filter "loop panel toggle never covers" -> 0 passed, 1 failed: TestUnexpectedResult at expectLoopBarButtonsDisjoint, !physicalRectsOverlap(show_graph, panel_toggle) with the panel collapsed (expanded case passed first); same command --test-filter "collapsed loop panel routes native tab" with only the cause-3 workspace_top line reverted -> 0 passed, 1 failed: TestUnexpectedResult at expectWorkspaceOwnsPress, !app.canvas.dragging on the tab press (the press panned the hidden graph)
GREEN: zig test src\App.zig (App shell link flags) --test-filter "loop panel toggle never covers" -> 1/1 passed (1200 and 960 px, 96 and 144 DPI); --test-filter "collapsed loop panel routes native tab" -> 1/1 passed
REGRESSION: zig test src\App.zig (App shell link flags), after merging main add3e7e -> All 888 tests passed; zig test src\LoopBarLayout.zig -> All 8 tests passed; zig test src\TerminalSurface.zig (terminal link flags) -> All 164 tests passed; zig build -Doptimize=ReleaseSafe -Dwinghostty-dir=pinned root at 2d33df3 -> exit 0

To confirm the behavioral failure as well as the geometry one, I made two throwaway edits before the fix. Each edit bypassed only the collapsed geometry assertion, and I reverted both. Neither is in this diff. The routing RED came from a third throwaway edit that put back only the pre-fix workspace_top condition; it was also reverted.

  • Clicking the published Stop center with the panel collapsed sent nothing: expected 2, found 1 on the outbound count.
  • Clicking the published Show in graph center left the workspace open: expected .project, found .workspace. Panel state stayed collapsed, because the click never reached the workspace handler.

Limits:

  • This is unit and CI evidence only. It does not replace a Dev Box rerun (Section 6B) on a new candidate.
  • Pixels, live UIA, and real-mouse behavior were not observed.
  • zig fmt --check is clean on the changed code. TerminalSurface.zig has formatting drift on main (lines 414-424 and 580) that this PR leaves alone.

Checklist

  • I have read the Contributing Guidelines
  • I have signed off my commits (git commit -s) per the DCO
  • Tests pass locally (make test). This change is Windows-only, and make test is the macOS suite, which was not run. The Windows Zig suites above passed.
  • Code follows the existing style (make check). macOS lint was not run. zig fmt --check is clean on the changed lines.
  • I added the test/contract before the implementation and observed the intended RED failure

coneilen and others added 3 commits October 7, 2026 23:51
With the loop detail panel collapsed, the "Loop panel" expand control was
painted over the loop bar's Show in graph button: both occupied the bar's
trailing ~92px. Pointer clicks there could not reach Show in graph, and in
fact no pointer click on the bar, the toggle, or the workspace tabs reached
the workspace at all, because collapsed loop workspaces routed input as if
the bottom workspace panel were hidden and fell through to the hidden graph.
The bar's hit layout also always assumed the panel was expanded, so Stop and
Show in graph were hit-tested 272px left of where they were drawn.

The collapsed expand control now owns the loop bar's trailing slot, with
Show in graph and Stop moved left of it. One App helper computes the bar
layout for painting, pointer hit-testing, and UIA, and loop workspaces route
pointer input from the header down regardless of panel state.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
…el-toggle-overlap

Signed-off-by: Colin Neilens <coneilen@microsoft.com>
…workspace

With the loop detail panel collapsed, WM_LBUTTONDOWN used to take the graph
surface's workspace_top (the client bottom), so presses on the workspace tab
strip and the loop bar fell through to the hidden graph and started a canvas
pan. This adds a native-message App test at 1200 and 960 px and 96 and 144
DPI that presses a workspace tab and the loop bar's Stop with the panel
collapsed, checks between DOWN and UP that no graph pan, node drag, or edge
drag began, and requires the tab selection to change and Stop to send one
stopNode for the open loop.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
@coneilen
coneilen merged commit 4ab2fcf into main Oct 8, 2026
25 checks passed
coneilen added a commit that referenced this pull request Oct 8, 2026
Record the immutable, unpublished 0.1.78-windows.beta17 candidate built from
4ab2fcf with #658 and #659 (Show in Graph and collapsed loop panel fixes).
Beta16 and its r2 handoff are failed/superseded and kept unchanged. Approval A
keeps fixture-only Worktrees reclaim. Correct the parity count to the ledger's
actual 98 surfaces: 58 Validated / 40 Partial.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
@coneilen coneilen mentioned this pull request Oct 8, 2026
2 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant