Skip to content

fix(session): correct shell-history copy and load command history off-main - #4

Merged
crmolinaz merged 1 commit into
mainfrom
fix/session-history-copy-and-async-load
Jun 21, 2026
Merged

crmolinaz merged 1 commit into
mainfrom
fix/session-history-copy-and-async-load

Conversation

@crmolinaz

Copy link
Copy Markdown
Owner

Follow-up to the per-tab shell history / session restore work, addressing review feedback on upstream PR manaflow-ai#6548.

Changes

Correct the "grouped by project" copy (history is keyed by surface ID).
Per-tab shell history is keyed by the tab's stable surface UUID, not by project directory. The shipped localized strings (xcstrings + all web locales) were already accurate, but three source references still described the old behavior. Aligned them with what actually happens:

  • SessionSection.swift — section doc comment and the String(localized:) defaultValue fallback (the fallback had drifted out of sync with the real translation).
  • SessionCatalogSection.swift — the persistShellHistory key doc comment.

Load command history off the main thread.
Opening the command history from the palette decoded the per-surface JSON synchronously on @MainActor, which can block the UI for a tab near the entry cap. showCommandHistoryForFocusedSurface now loads and decodes on a detached task and presents the window back on the main actor.

Notes

A third review item — the unconditional declaration of the debugRestoreSessionConfirmationHandler test seam — was intentionally left as-is: its usage is already #if DEBUG-guarded, and the unguarded declaration matches the two pre-existing sibling seams next to it. Guarding only this one would make it inconsistent with the established convention.

Testing

  • Localization audit: no remaining "grouped by project" / "namespaced by project directory" wording in any locale; no new user-facing strings introduced.
  • Tagged Debug build compiles cleanly.

…-main

The per-tab shell history is keyed by the tab's stable surface ID, not by
project directory. Three source references still described it as "grouped
by project" / "namespaced by project directory" — the shipped localized
strings were already correct, but the doc comments and the String(localized:)
defaultValue fallback had drifted out of sync. Align them with the actual
behavior.

Also move the command-history disk read off the main thread: opening the
command history from the palette decoded the per-surface JSON synchronously
on @mainactor, which can block the UI for a tab near the entry cap. Load and
decode on a detached task and present the window back on the main actor.
@crmolinaz
crmolinaz merged commit ff2af77 into main Jun 21, 2026
@crmolinaz
crmolinaz deleted the fix/session-history-copy-and-async-load branch June 21, 2026 17:20
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