feat(web): focus composer on /new and /clear, keep viewport scalable - #1159
Conversation
🦋 Changeset detectedLatest commit: a94c964 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e341051b23
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| <!-- Backdrop --> | ||
| <div class="backdrop" @click.self="emit('close')"> | ||
| <div class="dialog" role="dialog" :aria-label="t('newSession.title')"> | ||
| <div class="dialog" role="dialog" :aria-label="t('newSession.title')" @keydown="handleKeydown"> |
There was a problem hiding this comment.
Keep Escape handling document-wide
When focus is not inside .dialog (for example after tabbing past the dialog controls, or if the programmatic cwdInputEl.focus() is ignored), this element-level @keydown never sees Escape. App.vue intentionally skips its global Escape handler while showNewSession is true, so the New Session modal no longer dismisses from the keyboard in that state; the previous document listener covered this.
Useful? React with 👍 / 👎.
e341051 to
a94c964
Compare
|
@chatgpt-codex-connector 感谢指出。已修复:
请再 review 一下。 |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Related Issue
No prior issue — this is a focused UX polish for the bundled web UI.
Problem
/newor/clearin the web UI opened the new-session dialog instead of focusing the composer, so users had to click the input before typing.maximum-scale=1, user-scalable=no), which hurts accessibility and triggers Lighthouse warnings.keydownlistener and an unnecessarynextTickbefore focusing the CWD input.What changed
/newand/clearare now aliases that open the workspace onboarding composer and focus the input immediately.focus()toComposer,ChatDock, andConversationPaneso the active composer can be focused programmatically.focusComposerAfterDraft()inApp.vueto avoid duplicating thenextTick(...)logic.16px.NewSessionDialog:keydownlistener in favor of@keydownon the dialog root.onMountedwithoutnextTick.16px.preventScroll: trueto the composerfocus()call to avoid unexpected page jumps.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.