Skip to content

fix(workspace): Esc while renaming a chat discards the edit instead of saving it (#3459) - #3481

Merged
vybe merged 1 commit into
devfrom
feature/3459-workspace-rename-esc-cancels
Oct 9, 2026
Merged

vybe merged 1 commit into
devfrom
feature/3459-workspace-rename-esc-cancels

Conversation

@trinity-ability

Copy link
Copy Markdown
Contributor

Description

Esc only left edit mode; Vue then removed the focused input, the browser fired blur on 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 of PortalEditableTitle are 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

  • Bug fix (non-breaking change that fixes an issue)

Testing

  • I have tested this locally
  • New tests added (if applicable)
  • All existing tests pass
  • Every new test executes the changed path

Mutation: portalEditableTitleEsc.mount.spec.js — 3 red with the fix reverted, and the same 3 with only the !editing blur 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

  • My code follows the project's style guidelines
  • I have updated the documentation (if applicable)
  • I have not committed any sensitive data (API keys, credentials, etc.)

🤖 Generated with Claude Code

…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]>

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

merge-train: batch validated on train/20261009-2301-a (#3500)

@vybe
vybe merged commit 606fa1a into dev Oct 9, 2026
23 checks passed
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.

2 participants