SIGN IN SIGN UP

fix: present session teardown as archive, not delete (#5865)

* fix(sessions): present session teardown as archive, not delete

The control that archives a session carried a Trash2 icon and red danger
styling on every surface, so it read as a permanent delete — hiding both
what the action does and that an Archive section exists to restore from.
The sidebar row also archived on the bare click while the session page
asked first, and that prompt was an inline popover rather than the shared
modal.

- Swap Trash2 for the Archive icon and drop the danger-red treatment on
  the sidebar row, session top bar, board card, and inspector. The
  "Remove project" trash icons stay: that one really does delete.
- Confirm before archiving from the sidebar row, via the same dialog the
  other surfaces use.
- Replace SessionTerminationPopover with SessionArchiveDialog, built on
  the shared ConfirmDialog: "Are you sure you want to archive ...?", a
  subtext pointing at the Archive section, and Confirm / No buttons.
  ConfirmDialog gains optional cancelLabel and confirmAriaLabel props,
  both defaulting to today's behavior.
- Retitle the kill/terminate strings as archive across all 8 locales.

ConfirmDialog now stops click propagation on its content and overlay:
React portals re-dispatch synthetic events up the React tree, not the
DOM tree, so confirming from inside a board card also fired that card's
onClick and opened the very session being archived. The old popover
guarded against this; a board test caught the regression.

Fixes #5768

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(confirm-dialog): return focus to whatever opened the confirm

Radix's Dialog.Content aims its close-time focus at a DialogTrigger and
calls preventDefault() on FocusScope's own restore. These confirms are
opened programmatically — the trigger is rendered bare so a repeated tap
re-opens rather than toggles — so that ref is null and dismissing the
dialog dropped the keyboard user on <body>, several tab stops from the
control they came from.

The old termination popover wrapped its trigger in PopoverTrigger, so
Radix knew the element and restored focus to it; switching to the modal
lost that. Remember whatever held focus when the dialog opened and put it
back, falling through to Radix when that element is gone (a confirmed
archive removes its own row).

This also repairs the pre-existing remove-project confirm, which is
opened the same way.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* refactor(sessions): name the archive strings and topbar control for archive

The retitle kept the old i18n keys, so the catalogs read
"shell.killSession": "Archive session" and "termination.dialog": "Are you
sure you want to archive the session?". The next person reaching for a
kill or terminate string would pick up archive copy.

- Rename the 16 retitled keys in all 8 catalogs: termination.* ->
  archive.*, shell.kill*/terminate* -> shell.archive*/archiving*,
  inspector.terminate* -> inspector.archive*. shell.killSession and
  shell.terminateSession carried identical copy in every locale and fold
  into one shell.archiveSession.
- Rename TopbarKillButton -> TopbarArchiveButton.

Values are unchanged, so no copy moves. The daemon route
(POST /api/v1/sessions/{sessionId}/kill) and the hooks and callbacks that
wrap it keep the API's name: the CLI, mobile app, and cloud agent call the
same route, so renaming it is an API change rather than a UI one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
J
Just_Anniee committed
8913c61ebd684b484ae573edafa2b537cfde8715
Parent: 13f0286
Committed by GitHub <noreply@github.com> on 9/27/2026, 5:24:30 PM