Skip to content

feat: block every tab's input while a dialog's scrim covers the window - #7

Merged
iamEvanYT merged 5 commits into
mainfrom
devin/1795167368-tab-input-locks
Nov 20, 2026
Merged

iamEvanYT merged 5 commits into
mainfrom
devin/1795167368-tab-input-locks

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

While one of Wren's dialogs is up, its scrim now blocks input to every tab in the window, including both panes of a split and tabs in other spaces of that window.

  • Lock list per tab (src/main/tabs/input.rs): each tab has its own set of InputLock IDs, and calls BrowserTab::set_ignores_input only when that set goes from empty to non-empty or back. Since each lock has its own ID, letting one go never lifts another.
  • Window-wide locks: a window holds InputLock::Dialog on all of its tabs. Tabs that come to the window while it's held get the lock, and a tab moved to another window takes that window's locks instead. InputLock::is_window_wide is an exhaustive match, so each new lock has to say which kind it is. A closed tab's list is deleted.
  • Keyboard: when a window takes its first lock, its page takes the keyboard. A tab that ignores input can still get text from an input method and the Tab key.
  • Interface page crash or reload: PageWindow::watch_page_gone fires when the page crashes or a new load starts (a reload from DevTools or the dev server). The window then lets go of every lock its page held, so tabs can't stay blocked.
  • Renderer: Dialog calls useTabInputLockWhile("dialog", present), so the lock is held from when its card shows until its exit animation ends. Dialogs waiting their turn hold nothing. TabInputLockContext is provided only by the ui page; other pages get a lock function that does nothing. state/tab-input-lock.ts counts the holders of each lock and calls window.lockTabInput only on the first take and the last release.

How you checked it

  • tsc and the React Compiler check pass.
  • Against the v0.5.1 release's Rust SDK, cargo clippy --all-targets reports no errors in the changed files. This was on Linux, where only the macOS-only platform::current code fails.
  • Not yet run on a Mac: bun run check, and opening the Quit dialog over a tab to confirm that clicks, scrolling and typing don't reach it, and that they work again once the dialog closes or the interface page reloads.

Contributor Licence Agreement

Link to Devin session: https://app.devin.ai/sessions/d11ad27aac4b4a039850e7ddf305a767
Open in Devin Desktop: https://app.devin.ai/desktop/session/d11ad27aac4b4a039850e7ddf305a767?variant=devin
Requested by: @iamEvanYT


🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Devin Review found 2 findings. Devin automatically fixed all 2 findings.

Fixed by Devin (2)
  • Page recovery stops after first transition — The crashed and loading flags were only replaced while true, so they never reset. Both are now replaced on every change.
  • Dialogs crash the standalone interface preview — lockTabInput now returns a no-op release when there is no app (hasApp false), as the rest of the renderer's state does.

View findings in Devin Review · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 4 commits November 20, 2026 19:37
Each tab keeps its own list of input locks, each with an ID, and ignores
input while any lock is on it, so letting one lock go never lifts another.
A window's dialog holds its lock on all the window's tabs, tabs that come
to the window take it, and a tab moved away drops it. The locks go with
the interface page if it crashes or loads again, so a dialog that never
closed can't leave the tabs stuck.

Co-Authored-By: Evan <47493765+iamEvanYT@users.noreply.github.com>
…irst

The flags that tell a new crash or load from one already seen were only
updated while true, so they stayed set, and a later crash went without a
reload and a later load kept the page's locks.

Co-Authored-By: Evan <47493765+iamEvanYT@users.noreply.github.com>
Opening a dialog with no app behind the page called the app's missing
`wren` and failed, as other state does not.

Co-Authored-By: Evan <47493765+iamEvanYT@users.noreply.github.com>
Every change to a tab's locks now goes through one function that sets
whether it ignores input, so a window's locks replace the last window's
in one step.

Co-Authored-By: Evan <47493765+iamEvanYT@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1795167368-tab-input-locks branch from b8ca657 to 70d46ef Compare November 20, 2026 19:37
@iamEvanYT
iamEvanYT merged commit 89828ba into main Nov 20, 2026
4 checks passed
@iamEvanYT
iamEvanYT deleted the devin/1795167368-tab-input-locks branch November 20, 2026 19:56
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