Skip to content

fix(windows): Open Settings from Chat without blanking it or hanging the next open - #1217

Merged
omesser merged 4 commits into
mainfrom
cursor/windows-settings-chat-blank-14dc
Oct 1, 2026
Merged

omesser merged 4 commits into
mainfrom
cursor/windows-settings-chat-blank-14dc

Conversation

@omesser

@omesser omesser commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Why

On Windows, Chat’s “Window names are off” → Open Settings opens a blank white Settings window and leaves that one shared window wedged. Opening Settings again from the context menu shows the same white window, then the process stops responding and has to be killed.

names_hint_act was a synchronous command, so the build ran on WebView2’s pump thread. The same constraint is already load-bearing for opening Chat (overlay_open_chat, #588). That path also emitted settings-refresh into the window it had just built, before navigation finished. The context menu then activates the same window. set_focus is MoveFocus. SetForegroundWindow delivers WM_SETFOCUS, and wry’s parent subclass calls MoveFocus from that message too. Tray and the menu are not on the Chat pump, and a page that does load already waits for __TAURI__ (#1117 / #1127).

What changed

names_hint_act and show_settings are async, so the Settings build is queued off the pump the way Chat’s open is. Tray, the menu, the anchor, and FIDGET_OPEN_SETTINGS still call present_settings on the shell thread.

A Chat open that creates the window does not emit into it. The reveal stays in the snapshot, which the page reads when it loads. Until that document finishes (not the about:blank the controller starts on), a later open does nothing: no raise, no MoveFocus. Once it has loaded, the menu raises and focuses it, and a Chat open reloads so the aim lands.

How to verify

cargo test -p fidget --bin fidget -- a_menu_open_after_chat_does_not_focus_settings_still_loading chat_reloads_settings_only_after_the_document_has_loaded settings_opened_from_chat_stays_off_the_webview_pump

a_menu_open_after_chat_does_not_focus_settings_still_loading fails if a context-menu open while the document is still loading raises or focuses that window. settings_opened_from_chat_stays_off_the_webview_pump fails to compile if either Chat entry point is synchronous again.

Shell unit tests: 670 passed. Three Linux secret-service tests failed here because no Secret Service is running, and two GTK double-click tests hang without a display. The other workspace crates passed. This environment has no WebView2, so the blank window and the hang were not launched here.

Notes

Closes #1216.

— Cursor agent (Coder), on @omesser's behalf.

Open in Web Open in Cursor 

@omesser omesser added the windows Run the Windows compile job on this pull request label Oct 1, 2026 — with Cursor
@cursor cursor Bot changed the title fix(windows): Settings opened from Chat paints instead of staying blank fix(windows): Open Settings from Chat without blanking it or hanging the next open Oct 1, 2026
omesser

This comment was marked as outdated.

cursoragent and others added 2 commits October 1, 2026 01:53
WebView2 deadlocks when a synchronous Chat command builds the Settings
webview on the main thread. Post that build from another thread.

Co-authored-by: Oded Messer <odedmesser@gmail.com>
The hint and the Chat Settings button are async commands, the same
shape as opening Chat. Tray and the menu still present on the shell thread.

Co-authored-by: Oded Messer <odedmesser@gmail.com>
@cursor
cursor Bot force-pushed the cursor/windows-settings-chat-blank-14dc branch 2 times, most recently from 4a376c4 to f48b346 Compare October 1, 2026 01:55
omesser

This comment was marked as outdated.

@cursor
cursor Bot force-pushed the cursor/windows-settings-chat-blank-14dc branch from f48b346 to 4a376c4 Compare October 1, 2026 01:57
A Chat open that emits before navigation, then a menu open that activates
that window, blanks Settings and hangs on WebView2 MoveFocus.

Co-authored-by: Oded Messer <odedmesser@gmail.com>
@cursor
cursor Bot force-pushed the cursor/windows-settings-chat-blank-14dc branch from 4a376c4 to 6cd34e2 Compare October 1, 2026 01:57
omesser

This comment was marked as outdated.

omesser

This comment was marked as outdated.

omesser

This comment was marked as outdated.

omesser

This comment was marked as outdated.

omesser

This comment was marked as outdated.

omesser

This comment was marked as outdated.

Windows does not call /usr/share absolute, so the Linux search-path
tests drop those directories when the windows job runs them.

Co-authored-by: Oded Messer <odedmesser@gmail.com>
omesser

This comment was marked as outdated.

@omesser

omesser commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Fixed Windows CI failures for the three package::tests tests. The issue was that PathBuf::from("/usr/share").is_absolute() returns false on Windows (no drive letter), causing Linux unit tests to drop XDG bases when run on Windows hosts.

The fix checks if a path starts with / in addition to the host-specific is_absolute() check, allowing Unix-style absolute paths to be treated correctly regardless of the test host OS.

Windows CI now green: https://github.com/omesser/fidget/actions/runs/36804100497/job/110184557572

—

Signed-off-by: Cursor Agent (Cloud)

@omesser omesser left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Soft-re-gate — PR #1217

Verdict: Soft CLEARED — Hard Holds. Soft (f) Open settling → Pass (tip CI fully green). Soft CLEARED = pass (merge-ready pending your yes). Soft Open would mean not pass yet. Do not treat as Approve.

Tip gated: 0a6bd211e6ac980b63ddbd4a74bd728d6aa5c0e0 (cursor/windows-settings-chat-blank-14dc)
vs prior Soft-Pass Soft f settling COMMENT 5374115628 same tip — Soft (f) settled green; no Soft flip elsewhere. Wake was Oded’s issue-comment summarizing the landed XDG Soft-FIX (not a tip move).

Draft: no · Mergeable: yes · mergeStateStatus: CLEAN · Closes #1216: yes · base main @ 0df3b59f · label windows

Hard (value-preservation) — Holds

  • Tray / menu / anchor / FIDGET_OPEN_SETTINGS: still present_settings on the shell thread (MenuAction::OpenSettings, Linux GTK connect_focus_in_event, Windows WA_CLICKACTIVE, env hook). Chat webview commands alone are async.
  • Chat open still works: names_hint_act / show_settings stay async (WebView2 pump off), same shape as overlay_open_chat.
  • No new sync rebuild on the pump: settings_opened_from_chat_stays_off_the_webview_pump still pins Future bounds.
  • Load hang gate: Show while !document_ready → empty effects (no raise / MoveFocus); after load Focus+Raise; Chat reload only when ready; about: skipped; generation match.
  • XDG Soft-FIX is package-path only: xdg_bases keeps leading-/ entries as absolute bases on Windows; no Settings pump/load change.

Soft ledger

Soft Status Evidence
(a) #1216 acceptance Pass Chat Open Settings off-pump; no emit into just-built window; menu leave-loading-alone; Closes #1216.
(b) Pump / async Pass Chat commands async → present_settings; tray/menu/GTK/WA_CLICKACTIVE/env → present_settings on shell thread.
(c) Load gating Pass Create: Build+Raise. Show while loading: empty. After load: Focus+Raise; Chat reload only when ready. about: skipped; generation match.
(d) Tests Pass Named filters present (a_menu_open_after_chat_does_not_focus_settings_still_loading, chat_reloads_settings_only_after_the_document_has_loaded, settings_opened_from_chat_stays_off_the_webview_pump); sync regression compile-time. Tip CI green includes Settings Soft tests.
(e) Merge hygiene Pass 4 coherent commits (3 Settings + 1 XDG Soft-FIX); MERGEABLE CLEAN; files main.rs + package.rs; Closes #1216.
(f) CI on tip Pass Tip 0a6bd211: PR Tests run 36804100497 — ubuntu / macos / windows SUCCESS; Pages build SUCCESS / deploy SKIPPED. Soft (f) Open settling → Pass.
(g) Cross-platform / #1212 Pass Linux GTK focus → present_settings intact; shared helpers not Windows-only; XDG leading-/ filter is platform-correct for Linux path strings on Windows runners.

Soft-FIX

None. Softs a–g Pass; Hard Holds.

Notes

  • UX/UI delta: Same user job (Open Settings from Chat / menu / tray). On Windows Chat path: Settings should paint instead of blanking/hanging; menu/tray behavior unchanged (still shell-thread present_settings). Linux/macOS Settings open paths unchanged by this PR’s Chat-async/load gate; #1212 Linux GTK taskbar focus path remains shell-thread present_settings.
  • Soft CLEARED at tip after Soft (f) green — await Oded merge yes; never merge without that yes.

— Cursor agent (Architect), on @omesser's behalf.

@cursor

cursor Bot commented Oct 1, 2026

Copy link
Copy Markdown

Soft-FIX — Soft (f) CLEARED

Tip: 0a6bd211e6ac980b63ddbd4a74bd728d6aa5c0e0
Failed tip: 6cd34e2d (Windows red on the three package::tests from #1207; same failure on main @ 0df3b59f)

Those tests pass Desktop::Linux and still run on the Windows host. xdg_bases already splits XDG_DATA_DIRS on :. Windows then drops /usr/share because Path::is_absolute is false without a drive letter. A leading / now counts as an absolute XDG base. Linux behavior is unchanged: those paths were already absolute there. The three tests were not cfg-gated.

Soft (f): windows success — https://github.com/omesser/fidget/actions/runs/36804100497/job/110184557572
Ubuntu and macOS on the same run also succeeded. Merge state is CLEAN. The pull request stays ready.

— Cursor agent (Coder), on @omesser's behalf.

cursor Bot pushed a commit that referenced this pull request Oct 1, 2026
Replaces the XDG bases filter with the already-green version from
#1217 tip 0a6bd21 that passed cargo-fmt. Uses as_os_str() and
is_some_and() for cleaner formatting.

Co-authored-by: Oded Messer <odedmesser@gmail.com>

@omesser omesser left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Design note — caveats (not Soft-FIX)

Soft CLEARED still holds. Design judgment on tip 0a6bd211: the dual fix (async Chat entry points off WebView2’s pump + document_ready / generation gating of Focus/Raise/Reload) is the right shape for #1216’s blank + hang race. These are residual caveats to watch, not merge blockers.

1. Create still Raises before ready

settings_effects(Create) is Build + Raise, while Show while !document_ready is deliberately empty (no Focus / Raise — Raise → SetForegroundWindow → wry MoveFocus is the hang path on a loading HWND).

So “don’t MoveFocus until ready” is not uniform: first open still Raises on a newborn controller. That is assumed safe on the create turn (hang attributed to later activation of an already-loading window). If a hang ever shows on first open only, defer Raise into finish_settings_document (trade: Settings may sit under the overlay until load finishes).

2. “Leave loading alone” can strand

While gens don’t match, every open is a pure no-op. Create has already raised a white window; menu/tray clicks do nothing until on_page_load Finished (non-about:). If navigation never finishes, there is no timeout, rebuild, or queued post-ready Focus — user stays stuck until kill.

Optional follow-up (not required for this tip): on finish_settings_document, drain a pending_raise / single deferred Focus; or timeout → destroy + recreate.

Out of scope here

XDG package.rs Soft-FIX is unrelated to this race.

— Cursor agent (Architect), on @omesser's behalf.

omesser commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Addressing Architect’s design note (review): caveats tracked as V1 Todo follow-ups, not Soft-FIX for this tip. Soft CLEARED on 0a6bd211 unchanged.

  1. Create still Raises before ready → #1225 (reproduce/refute first-open hang; defer Raise into finish_settings_document only if confirmed).
  2. Leave-loading-alone can strand → #1226 (pending_raise / deferred Focus, or timeout → destroy+recreate).

XDG Soft-FIX stays out of scope for this race, as noted.

— Cursor agent (Coder), on @omesser's behalf.

@omesser
omesser merged commit be462d2 into main Oct 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

windows Run the Windows compile job on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(windows): Settings from Chat “Open Settings” (window-names hint) opens blank white

2 participants