Skip to content

fix(ui): keep the chat-create error clear of the desktop title bar - #6973

Merged
kovtcharov-amd merged 2 commits into
amd:mainfrom
ityashag:fix/toast-clear-of-titlebar
Nov 9, 2026
Merged

kovtcharov-amd merged 2 commits into
amd:mainfrom
ityashag:fix/toast-clear-of-titlebar

Conversation

@ityashag

@ityashag ityashag commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

In the desktop app, the "chat was created, but…" error can now be selected and copied, and it no longer sits under the Windows window buttons. Before, it sat inside the title bar's drag strip: pressing on its text moved the window, and on a Windows window about 770–900 px wide it overlapped the minimize, maximize and close buttons until dismissed.

Why

The review on #6912 pointed this out. #6912 moved the error to the top of the window so it no longer covers the chat box, but in the desktop app the top 48 px is the invisible drag strip. Its Dismiss button already worked, since buttons are excluded from dragging, but the error itself (role="alert") wasn't.

Linked issue

Refs #4819, which #6912 closed. This is the follow-up from that PR's review.

Changes

  • .toast-dismissible sets -webkit-app-region: no-drag, so a press on the error's text selects it instead of dragging the window.
  • Under :root[data-titlebar], the error moves to top: calc(var(--titlebar-h) + 8px), below the window buttons. In the browser it stays at 16 px.

The review's other note, that toastIn rises from below at the top position, is cosmetic and left as is.

Test plan

Run in a node:22-slim container, rebased on current main:

  • npx tsc --noEmit: passes.
  • npx vite build: passes.
  • New rule in visual/rtl.visual.ts, "the chat-create error sits below the window controls and is not a drag handle": passes in ar and en. With this PR's CSS reverted, both fail (Expected: >= 48, Received: 16).
  • npm test: 3,157 of 3,169 pass on a busy machine; the 12 failures were timeouts of 4–66 s while another test suite ran. Each of those 9 files passes when rerun on its own, and ChatView.liveStatus passed 3 of 3 more runs.
  • python util/lint.py --all: passes. This PR changes no Python.

Evidence

The production build with visual/fixtures.ts in Chromium at 1200x760. data-titlebar="overlay" is set as the Windows desktop app sets it, and a refused permission-mode request triggers the error.

Measured Value
Error's top edge 56 px (--titlebar-h is 48 px)
-webkit-app-region on the error no-drag
Still visible after 6 s Yes

Error below the title bar

Not tested in the packaged Electron app or in Arabic, so the window buttons themselves aren't in the screenshot. The change sets only a vertical offset and the drag region, which don't depend on text direction.

  • Agent exposed in the Agent UI: shown above with fixture data.
  • MCP tools / servers: N/A
  • CLI: N/A
  • HTTP API / REST: N/A

Checklist

  • I have linked a GitHub issue above (Closes #N / Fixes #N / Refs #N).
  • I have described why this change is being made, not just what changed.
  • I have run linting and tests locally (python util/lint.py --all, pytest tests/unit/). No Python changed, so I ran the web checks above instead of pytest.
  • I have attached real-world evidence matched to the surface I changed (see Evidence above), or marked each surface N/A.
  • I have updated documentation if user-visible behavior changed (see CONTRIBUTING.md). N/A: no docs describe this error's position.

In the desktop app the error sat in the title bar's drag strip, so pressing
on its text moved the window instead of selecting it, and on a narrow
Windows window it overlapped the window buttons. It now opts out of the drag
region and sits below the title bar.
@github-actions github-actions Bot added the electron Electron app changes label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Verdict: Request changes

The fix works: in the desktop app, the "chat was created, but…" error now sits just below the title bar, clear of the Windows window buttons, and you can select its text without dragging the window. The browser layout doesn't change. One thing is missing: project policy says a UI bug someone finds by hand gets an automated check in the same change. A near-identical check already exists for the top notice, so adding one for this error is a short copy.

  • Add a visual test that shows this error with the Windows window buttons drawn and asserts it stays below them, in English and Arabic. Without it, the next layout change can push the error back under the buttons and every test will still pass.

Real-world evidence

N/A: no evidence bundle ran for this PR. The author's own Chromium run (production build, Windows title-bar mode) measured the error's top edge at 56 px under a 48 px title bar, with no-drag applied, and attached a screenshot. Nobody tested it in the packaged desktop app or in Arabic, so the verdict rests on static review for those.

🔍 Technical details

Issues

🟡 No regression check for a bug found by hand (visual/rtl.visual.ts)
CLAUDE.md ("A UI change isn't done until someone has looked at it") says a person-found bug gets a rule in visual/rtl.visual.ts, and that rule should fail before the fix lands. The template already exists: the top notice keeps its action clear of the window controls (${locale}) (~line 2166) uses withWindowsControls, sets --titlebar-controls-w to WINDOW_CONTROLS_W, and asserts that no box overlaps { left: 1400 - WINDOW_CONTROLS_W, bottom: 48 }. Copy it for .toast-dismissible (trigger it the way your evidence run did, with a refused permission-mode request). Assert box.top >= 48 and that getComputedStyle(el).webkitAppRegion (or getPropertyValue('-webkit-app-region')) is no-drag. Run it in ar and en.

Checked, no issue

  • Specificity: :root[data-titlebar] .toast-dismissible (0,3,0) overrides .toast-dismissible's top: 16px (0,1,0). The mac and overlay modes both get the offset, which is right because the toast is centred and the 48 px drag strip covers the full width in both.
  • no-drag on the toast still matters after the move: .task-header is a drag region with only a min-height of 48 px, so it can grow past 56 px and overlap the toast.
  • No docs describe the toast's position, so there's no doc drift. Missed bug classes: none of the Code: lines apply to a CSS-only change.

Strengths

  • The fix is small and stays inside the existing :root[data-titlebar] frame rules, using --titlebar-h rather than a hard-coded 48 px.
  • The PR's evidence measured the actual outcome (top edge and computed app-region), not just a screenshot.

Adds a visual rule, in Arabic and English, that draws the Windows window
controls, triggers the chat-create error and asserts it starts below the
48 px title band and is not a drag region. It fails without the fix
(top 16 px).
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Nov 9, 2026
Merged via the queue into amd:main with commit 814dae9 Nov 9, 2026
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

electron Electron app changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants