Repository navigation
fix(workspace): Esc while renaming a chat discards the edit instead of saving it (#3459) - #3481
Merged
Merged
Conversation
…f saving it (#3459) Esc left edit mode, the field's removal blurred it, and the blur handler saved any draft that differed from the stored title, so the abandoned text became the title. The blur handler now ignores a blur that arrives once the editor has already left edit mode, which is the editor's own teardown and not the person leaving the field. The same guard stops Enter from saving a second time when the stored title has not caught up by the time the field is removed. Esc also returns focus to the pencil that opened the editor. Enter and a blur with a changed draft still save; a blur with an unchanged draft is still an abandon. The fix is in PortalEditableTitle, so it holds for the sidebar row, the 1:1 header and the room header. Test: tests/unit/portalEditableTitleEsc.mount.spec.js mounts the component attached to the document. With the fix reverted, "Esc discards the draft: no save, and the stored title is shown again", "Esc hands focus back to the pencil, and reopening starts from the stored title" and "Enter saves the trimmed draft exactly once, even through the teardown blur" go red. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Esc only left edit mode; Vue then removed the focused input, the browser fired
bluron it, and the blur handler committed the changed draft.onBlur()now ignores a blur that arrives after editing has ended, which also closes a possible second save after Enter, and Esc returns focus to the pencil button. All three consumers ofPortalEditableTitleare covered without edits.Part of the UI sweep epic #3471.
Related Issue
Fixes #3459
Journey Impact
Journey Impact: none: bug fix to existing behaviour found by the UI sweep; no journey promise is added or changed
Type of Change
Testing
Mutation:
portalEditableTitleEsc.mount.spec.js— 3 red with the fix reverted, and the same 3 with only the!editingblur guard removed (Esc discards the draft; Esc hands focus back to the pencil; Enter saves exactly once through the teardown blur). Restored byte-identical.UI verification: on a preview frontend over a live local backend, in the sidebar row and the conversation header: typing a new title and pressing Esc restores the old title with no rename request and focus on the pencil, and it survives a reload; Enter issues exactly one PATCH; a blur with no change issues none.
Checklist
🤖 Generated with Claude Code