Skip to content

Web UI: optimistic pin + rename (Phase 2)#285

Merged
edwin-zvs merged 1 commit into
mainfrom
webui-phase2-optimistic-actions
May 30, 2026
Merged

Web UI: optimistic pin + rename (Phase 2)#285
edwin-zvs merged 1 commit into
mainfrom
webui-phase2-optimistic-actions

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Phase 2 — makes the two cleanest session-list actions feel instant instead of waiting on the round-trip + session/state echo.

Change

  • Pin (handleRowAction): flips the star and the toolbar button immediately, then reconciles the authoritative value on the (idempotent) session/state echo. Rolls back the local flag if the RPC fails.
  • Rename (submitRename): applies the new title locally and closes the dialog at once, so it feels instant and doesn't depend on the echo — which can lag (see Web UI doesn't live-update a session's title after rename #272), so this also masks that symptom for web-initiated renames. Rolls back the title if the RPC fails.

Both surface failures via appendError and restore prior state on rollback. Move / delete / restart stay echo-driven for now (more edge cases — a later item).

Compatibility

The web_smoke pin test (handleRowAction('pin', 's1')) makes the identical session.set_pinned call and ends in the same DOM/toolbar state, so it's unaffected. No test drives rename.

How to observe

Pin/unpin a session → star + toolbar button flip instantly. Rename a session → title updates and the dialog closes immediately, even on a slow connection.

🤖 Generated with Claude Code

Toolbar pin and the rename dialog waited for the RPC round-trip and the
session/state echo before the UI updated. Make them optimistic:

- Pin flips the star + toolbar button immediately, then reconciles on the
  (idempotent) session/state echo; rolls back the local flag if the RPC
  fails.
- Rename applies the new title locally and closes the dialog at once, so
  it feels instant and doesn't depend on the echo (which can lag — see
  #272); rolls back the title if the RPC fails.

Both surface failures via appendError and restore prior state. Move /
delete / restart are unchanged (echo-driven) for now.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@edwin-zvs
edwin-zvs merged commit 54d49df into main May 30, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the webui-phase2-optimistic-actions branch May 30, 2026 23:39
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.

1 participant