Skip to content

Restore prior focus after programmatic rename dialogs close - #3218

Open
bb-slop-cop[bot] wants to merge 1 commit into
mainfrom
slopcop/issue-3217
Open

Restore prior focus after programmatic rename dialogs close#3218
bb-slop-cop[bot] wants to merge 1 commit into
mainfrom
slopcop/issue-3217

Conversation

@bb-slop-cop

@bb-slop-cop bb-slop-cop Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

The controlled rename shell can be opened without a registered dialog trigger. Its desktop close path therefore has no target for the primitive's default focus restoration, and the shell did not retain the element that was active before open. The verified investigation is published at https://get-bb.github.io/reports/issues/3217.html.

What changed

The shared application rename shell now captures the active element before moving focus into the rename field. After the dialog closes, it restores that element when it is still connected and outside hidden or inert content. A focused DOM regression test covers the programmatic open and close sequence.

How you verified

  • Before the production change, pnpm exec turbo run test --filter=@bb/app -- src/components/dialogs/RenameDialog.test.tsx failed because document.body retained focus instead of the composer.
  • After the change, the focused test passed.
  • pnpm exec turbo run test typecheck lint build --filter=@bb/app passed: 481 test files and 3,927 tests passed, with 3 skipped; typecheck, lint, and build also completed successfully.
  • pnpm exec oxfmt --check apps/app/src/components/dialogs/RenameDialog.tsx apps/app/src/components/dialogs/RenameDialog.test.tsx passed.
  • git diff --check passed.
  • Changed-line count: 77 text lines (76 additions, 1 deletion) across 2 files.

Fixes #3217

AGENT GENERATED

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.

Focus is not returned to the composer after the rename dialog closes

1 participant