Skip to content

[Bug] Session rename loses input on blur #337

@Astro-Han

Description

@Astro-Han

What happened?

When renaming a session in PawWork, the current behavior is: double-click a session title (or select "Rename" from the context menu) to enter edit mode, type a new name, and if you click somewhere else (another session, sidebar blank area, or even the action buttons on the same row), the editor closes and all input is lost, reverting the title to the previous name.

This violates user expectations — in macOS Finder, VS Code, and most file managers, clicking outside during a rename means "confirm and save", not "cancel".

Steps to reproduce

  1. In the sidebar session list, double-click any session title to enter edit mode
  2. Type a new session name
  3. Without pressing Enter, click elsewhere in the sidebar (another session, blank area, etc.)
  4. Observe: the editor closes, the title reverts to the original, and the input is lost

The same behavior also occurs in:

  • The top session title area (double-click rename)
  • Workspace directory rename (via context menu)

What did you expect to happen?

  • Escape key: Cancel editing, restore the original title (current behavior is correct)
  • Enter key: Save the new name and exit editing (current behavior is correct)
  • Click outside (blur): Should save the current input and exit editing, not cancel
  • Empty title: If the user deletes all text and clicks outside, it should save as empty (backend falls back to default title)

PawWork version

Current dev branch

OS version

macOS / Windows (cross-platform issue)

Can you reproduce it again?

Yes, every time

Screenshots, recordings, or extra context

Affected code locations

All three rename entry points use onBlur={closeEditor} or onBlur={closeTitleEditor}, causing a cancel on outside click:

  1. Sidebar session list: packages/app/src/pages/layout/inline-editor.tsx line 103

    onBlur={closeEditor}
  2. Top session title: packages/app/src/pages/session/message-timeline.tsx line 824

    onBlur={closeTitleEditor}
  3. Workspace directory: packages/app/src/pages/layout/sidebar-workspace.tsx (reuses the same InlineEditor component with the same onBlur behavior)

Suggested fix direction

Change the onBlur callback in all three entry points from "close editor (cancel)" to "save and close editor":

  • inline-editor.tsx: onBlur={() => saveEditor(props.onSave)}
  • message-timeline.tsx: onBlur={saveTitleEditor}
  • Adjust saveEditor and saveTitleEditor empty-value handling so empty titles are saved correctly

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium prioritybugSomething isn't workinguiDesign system and user interface

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions