Skip to content

fix(desktop): keep the windows top bar draggable over scrolled chat - #32206

Merged
bolichen97 merged 1 commit into
mainfrom
fix/29362-win-header-drag
Nov 7, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/29362-win-header-drag

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: On the Windows desktop app the docked top bar moves the window from its empty spots, even where chat content is scrolled up behind it.

On the Windows desktop app the docked top bar does not move the window wherever chat content is scrolled behind it. A tall message kills the bar over its column, and a transcript row wrapper kills it from the Sessions panel's edge to the right edge of the window. Scrolled to the bottom, the same spot works.

Why it matters

The top bar is the window's title bar on Windows. When it stops moving the window, the user cannot drag or double-click to maximize from most of it while reading a long chat, which is the normal state of the app.

Not a goal

  • Frameless Linux, which may share the gap but was not tested.
  • The injected no-drag exemption list and its [tabindex] entry.
  • The transcript scroller's tabIndex and its position under the glass header.
  • The remote-pane drag strips.

What changed (motivation → approach → change)

Transcript content scrolled up under the glass header still reaches into the 42px band from layout. Its no-drag rectangles come after the header's own drag rule, so they cut holes in it. macOS already fixes the same holes with .host-drag-strip gap strips painted after everything (from #26422). This PR turns those strips on for Windows too.

Part Change
focusChrome.ts The local strips are measured on Windows as well. On Windows the band stops at the caption buttons, using the --mc-win-drag-reserve width the main process pushes for the current zoom (138 CSS px when unset).
App.tsx The strips render on Windows as well. The test id is header-drag-strip.
dragGaps.ts observeDocumentLayout watches from <html>, so a new caption reserve after a zoom change re-measures the strips.
Docs desktop-app.md and the shell-chrome.css comment say Windows gets the strips too.

A fixed 138 CSS px would reach over Minimize below 100% zoom, because the caption buttons have a fixed size in DIP. So the live reserve is used.

Backwards compatibility

Compatible: macOS, Linux, browsers and remote panes take the same path as before; Windows only gains strips over gaps the header already meant to be draggable.

Removes nothing: the only rename is a test id read by one test, updated in this diff.

Tests

  • website/src/test/App.winHeaderDrag.test.tsx (new): with the Windows flags, the docked header mounts one strip from 0 to innerWidth - 138, it unmounts while focus mode hides the header, and a pushed --mc-win-drag-reserve re-measures it to innerWidth - 173.
  • website/src/test/App.focusModeMacDrag.test.tsx: reads the renamed test id.

Red on the parent: both new tests fail without the Windows gate (no strip found). The reserve test fails (1262 vs 1227) when observeDocumentLayout watches only <body>.

Determinism: the three related files (new test, macOS drag test, dragGaps.test.ts) passed 3 runs in a shuffled order (--sequence.shuffle, seeds 1 to 3), 20 of 20 tests each run.

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

Run on a source build of this branch on Windows Server 2025 (build 26100.33438), 100% display scale, Electron 44.9.1, with a scratch data home and its own port. Each spot was read with WM_NCHITTEST against the real window, which reports CAPTION where a drag starts. No real mouse was used.

Before (main) and after, window not maximized, 1600 wide, a 150-line message scrolled halfway behind the bar:

Row Spot Before After
A empty bar right of the command field CLIENT (dead) CAPTION
B same spot, nothing behind the bar CAPTION CAPTION
C bar above the Sessions panel CAPTION CAPTION
C2 left of the command field, full-width row behind CLIENT (dead) CAPTION
D Settings page not run CAPTION
F focus mode, header peeked not run CAPTION

After the fix, at 100%, 80% and 125% zoom, both not maximized and maximized (6 setups, 99 spots): every header control stays CLIENT, every strip is CAPTION, and Minimize, Maximize and Close keep their own hit codes. The strips always end before the caption buttons. With focus mode on and the header hidden, no strip mounts and the top band over the chat stays CLIENT. Moving the pointer below the peeked header closes it and removes the strips. A double-click message on a strip spot maximizes and restores the window. Row E (remote crew) was not run.

Screenshots / video

Why no screenshot: the strips are invisible divs, so nothing on screen changes; the hit-test table above is the evidence.

Related Issues

Closes #29362
Refs #26422

Sibling sweep

Swept: git grep -nE 'host-drag-strip' -- website/src
Sibling: website/src/components/InstancesViewport.tsx -- not affected -- remote-pane strips already render on Windows; their fixed 138 CSS px clip below 100% zoom predates this PR and is out of its goal
Sibling: website/src/App.tsx -- changed here

Pattern harvest

Not generalizable: the fix extends one platform gate on an existing mechanism; no lint can tell which platforms a drag-region workaround needs.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested a review from a team as a code owner November 7, 2026 08:10
@bolichen97
bolichen97 enabled auto-merge (squash) November 7, 2026 08:13
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/29362-win-header-drag branch from f824c4b to 8476651 Compare November 7, 2026 08:32
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 499a812559dee875e9110a591344aaed12d5f2d3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing in this diff is visible on screen, so no screenshot was needed. It only adds invisible, aria-hidden window-drag strips on Windows.

[UX-REVIEWED] 499a812

Description read

[DESCRIPTION-READ] 1ad2f828b168e907071fb69d0e631da695c569fa65437d3e15a8975425317131

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 499a812559dee875e9110a591344aaed12d5f2d3 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: the change turns on an existing macOS mechanism (.host-drag-strip) for Windows to fix defect #29362, and checks it with a hit test on a real window plus tests that fail on the parent.

What this change ships

Inventory (5 items) — 5 justified

Intent: let Windows desktop users drag or maximize the window from the top bar's empty spots while chat is scrolled behind it. This is a FIX.

  1. On Windows, the empty spots of the docked or peeked header move the window again when chat content is scrolled under it — justified
  2. On Windows, the drag strips stop at the caption buttons, using the zoom-aware --mc-win-drag-reserve (138px when unset) — justified
  3. Re-measuring watches <html> instead of <body>, so a zoom change that pushes a new reserve moves the strips — justified
  4. Test id mac-header-drag-strip renamed to header-drag-strip; its only reader is updated in the diff — justified
  5. desktop-app.md and the shell-chrome.css comment now say Windows gets the strips too — justified

[FIRST-PRINCIPLES-REVIEWED] 499a812

Description read

[DESCRIPTION-READ] bcf52770cb2038e1e175a05f7dadd0939c5d18f9b7e541a950a062e0e4841ae2

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 499a812559dee875e9110a591344aaed12d5f2d3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. The PR turns on the existing macOS gap-strip mechanism for Windows and reuses the zoom-aware reserve the main process already pushes. Windows hit-tests at three zoom levels back it, and the strips are invisible.

Notes

  • observeDocumentLayout now watches the whole document from <html> with subtree, so it also sees <head> changes (style or theme tags being injected). Those changes now trigger re-measures too. They are batched one per frame, so this costs little, but it widens what counts as a "layout change" for every caller. Watching documentElement with subtree: false for its style alone, plus body as before, would keep the old scope.

[DESIGN-REVIEWED] 499a812

Description read

[DESCRIPTION-READ] 5f9552946618edd070f70836bcdc8396599ec321017f216a536a8894886e8a07

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 499a812559dee875e9110a591344aaed12d5f2d3 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 499a812

Verdict parsed from the review's SHA-scoped output markers for commit 499a812559dee875e9110a591344aaed12d5f2d3.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 499a812559dee875e9110a591344aaed12d5f2d3 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 499a812559dee875e9110a591344aaed12d5f2d3 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 499a812

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 499a812559dee875e9110a591344aaed12d5f2d3 false-positive: <reason, 20 to 500 characters>

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] Backend Tests (Windows) (2) fails on test/test_security_gate_liveness.py::test_the_package_stays_within_its_line_budget (package at 34855 lines vs a 34845 budget). This PR touches no file in that package, and the same test fails on a tree with only main's copy of it, so the red comes from main. #32183 raises the budget; this PR waits for it and rebases once it lands.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/29362-win-header-drag branch from 8476651 to 499a812 Compare November 7, 2026 12:04
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 7, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 auto-approve: fix (7 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: the Windows desktop top bar gets the same drag strips as macOS so scrolled chat no longer blocks window drag, stopping short of the caption buttons.

@bolichen97
bolichen97 merged commit 40f4968 into main Nov 7, 2026
152 of 172 checks passed
@bolichen97
bolichen97 deleted the fix/29362-win-header-drag branch November 7, 2026 15:09
buluoray pushed a commit that referenced this pull request Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:windows readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows desktop: top bar does not move the window above chat messages scrolled behind it

2 participants