Skip to content

fix(website): keep full-screen file and artifact exit controls clear of the window caption buttons - #24801

Merged
chenmingwei23 merged 1 commit into
mainfrom
fix/24784-fullscreen-exit
Oct 27, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
fix/24784-fullscreen-exit

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: On the Windows desktop app, the X / Exit full screen button of a full-screen file view can be clicked again, so Esc is no longer the only way out.

A .md file opened from the sidebar and switched to full screen shows its Exit full screen button at the top-right corner. On the Windows desktop app, the native minimize / maximize / close buttons sit on top of that same corner, so a click on Exit full screen lands on the window controls instead. Only Esc closes the view (#24784).

Why it matters

Every Windows desktop user who opens a file in full screen is stuck there unless they know to press Esc. The visible exit control does nothing, which reads as a broken app.

Not a goal

  • No new exit control and no change to how Esc works.
  • No change to the image or diagram viewers; they already use the same clearance.
  • No change to the macOS or browser layout.

What changed (motivation → approach → change)

The full-screen view is portaled to <body>, outside the shell <div> that carries .win-electron, so the header's caption-button inset never reaches it. Its header sat in the 42px caption band, under the Windows overlay buttons (and frameless Linux's own).

The image and diagram viewers had the same bug (#11732) and fixed it with overlayCaptionClearancePx() in website/src/lib/electron.ts: on a frameless Windows or Linux window, or inside an embedded pane under a Windows host, the control row gets a 42px top margin. This PR applies that same helper to the full-screen header of the file panel (MarkdownPanel.tsx) and of the artifact panel (ArtifactPanel.tsx), which share the identical header. In a browser tab and on macOS the helper returns 0, so nothing moves there.

Backwards compatibility

Compatible: the header only gains a top margin on frameless Windows/Linux windows; no prop, key or API changes.

Removes nothing: the diff only adds a margin and a test id.

Tests

  • MarkdownPanel.captionClearance.test.tsx (new, so MarkdownPanelCoverage.test.tsx stays under the 2,000-line cap) and ArtifactPanelCoverage.test.tsx: the full-screen header carries a 42px top margin under a Windows host (.embedded-win-inset), and no margin in a plain browser tab.
  • With the production hunks reverted, all four new cases fail; with them, the changed test files pass.

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

Manual verification

Not run on a Windows desktop app: this host is Linux. tsc -p tsconfig.app.json and eslint on the changed files pass. A maintainer on Windows can open a .md file, switch to full screen and click Exit full screen.

Screenshots / video

Why no screenshot: the margin applies only inside the frameless Windows/Linux desktop app, which this Linux host cannot capture, and a browser tab renders the view pixel-for-pixel as before.

Related Issues

Closes #24784

Sibling sweep

Swept: git grep -n "pl-20 pr-6 h-12" -- website/src
Sibling: website/src/components/ArtifactPanel.tsx -- changed here
Sibling: website/src/components/DiagramLightbox.tsx -- not affected -- already uses overlayCaptionClearancePx
Sibling: website/src/components/markdown/Lightbox.tsx -- not affected -- already uses overlayCaptionClearancePx

Pattern harvest

Rule candidate: review-prompt
Pattern: a full-window overlay portaled to <body> puts controls in the top 42px without overlayCaptionClearancePx().

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • 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

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 27, 2026 08:06
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 4c5593fe95002c68e1c957a16d2c5adb7f7e3efb — 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: both items apply the existing overlayCaptionClearancePx() helper to two full-screen headers that share the same defect, and the description names that defect (#24784).

What this change ships

Inventory (3 items) — 3 justified

Intent: let Windows and Linux desktop users click Exit full screen on a full-screen file view, so Esc is not the only way out. This is a FIX.

  1. The full-screen file view's header now sits below the frameless desktop caption band, so the Exit control can be clicked again — justified
  2. The full-screen artifact view's header gets the same 42px top margin, the one sibling the sweep found — justified
  3. Two new data-testid hooks on the full-screen headers, used only by the new tests — justified

[FIRST-PRINCIPLES-REVIEWED] 4c5593f

Description read

[DESCRIPTION-READ] f00739ef052b84da67e74407ace5850f533b1fc511a99ffbbab950df980f881b

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 Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the fix reuses the caption-clearance helper the image and diagram viewers already ship, and browser and macOS layouts don't change.

Notes

  • Nobody has tried this on a real Windows window yet. A maintainer should click Exit full screen there before merge. If the helper misfires, the view behaves as it does today, so the risk is reversible.

[DESIGN-REVIEWED] 4c5593f

Description read

[DESCRIPTION-READ] 3b2ee23d5ced73dd62dc7c2c114e007893be9496956a4088437660d1af69149d

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 Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

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

UX-Verdict: PASS

cannot evaluate: missing a screenshot of the full-screen file and artifact headers with the 42px caption clearance applied. The blind read was not performed because the PR supplies no image.

Evidence gaps

  • Full-screen file view header (markdown-panel-fullscreen-header). Under a frameless Windows/Linux window or the .embedded-win-inset host, the row holding Exit full screen moves down 42px. No screenshot shows the new position, what fills the band above it, or whether Exit full screen now clears the native caption buttons. To close the gap: in a browser tab, add embedded-win-inset to <html> in devtools (the same switch the new tests use), open a .md file full screen, and attach that capture to the description.
  • Full-screen artifact header (artifact-panel-fullscreen-header). It gets the same 42px move and is not shown either. Attach the same embedded-win-inset capture of an artifact opened full screen.

Notes

  • The "Why no screenshot" reason says the change can only be captured in the desktop app. It can be captured in a browser: the helper reads .embedded-win-inset at render time, so a browser tab with that class set shows the shifted header.

[UX-REVIEWED] 4c5593f

Description read

[DESCRIPTION-READ] a29de4291ff8bfbd9907f47f867c1f0fb0d62bb5103f2a9538a3e8c60943b4d3

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 Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 4c5593fe95002c68e1c957a16d2c5adb7f7e3efb — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 4c5593f

Verdict parsed from the review's SHA-scoped output markers for commit 4c5593fe95002c68e1c957a16d2c5adb7f7e3efb.

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

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 4c5593fe95002c68e1c957a16d2c5adb7f7e3efb and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 4c5593f

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

@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 Oct 27, 2026
@iamwhatever
iamwhatever force-pushed the fix/24784-fullscreen-exit branch from b8efae2 to 3801091 Compare October 27, 2026 08:41
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 27, 2026
@iamwhatever
iamwhatever force-pushed the fix/24784-fullscreen-exit branch from 3801091 to 4c5593f Compare October 27, 2026 12:50
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Rebased once onto main d069596, which now carries the fix for the known main red #24765 (PR #24774 merged). New head 4c5593f; the two targeted test files pass locally (55 tests). CI re-running.

@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 Oct 27, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Review-ready at head 4c5593f: all 107 checks pass, readiness: passed, mergeable, base is fresh (no main movement in this PR's files). Design, First Principles and UX lanes PASS; GPT and Opus lanes reviewed this head. Remaining gate is a maintainer approval. Manual check still worth doing on the Windows desktop app: open a .md file from the sidebar, switch to full screen, click Exit full screen. Not merged, approved or auto-merged by the agent.

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving 4c5593f.

The fix reuses overlayCaptionClearancePx(), which the image and diagram viewers already use. It returns 42 only on frameless Windows, frameless Linux, or inside an embedded pane whose Windows host sets .embedded-win-inset, and 0 in a browser tab and on macOS. When it's 0 the header gets no style at all, so the browser layout is unchanged. Only a top margin is added: the Exit full screen button, the dialog's initial focus and its Tab focus trap are untouched, so the control stays reachable by keyboard and Esc behaves as before.

Verified locally: the two touched test files pass (55). Removing the margin from either panel, or applying it unconditionally, turns a test red. CI is green on this head (91 pass, 16 skipped).

Non-blocking: the UX lane's evidence gap still stands. Setting embedded-win-inset on <html> in a browser tab renders the shifted header, so a capture of the file and artifact full-screen headers can be attached, and the "Why no screenshot" reason can be corrected. I haven't verified this on a real Windows or frameless Linux window.

@chenmingwei23
chenmingwei23 merged commit e7791bb into main Oct 27, 2026
108 checks passed
@chenmingwei23
chenmingwei23 deleted the fix/24784-fullscreen-exit branch October 27, 2026 23:09
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 27, 2026
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.

Full-screen view of a sidebar .md file can only be exited with Esc

3 participants