Repository navigation
fix(session): correct shell-history copy and load command history off-main - #4
Merged
Merged
Conversation
…-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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theString(localized:)defaultValuefallback (the fallback had drifted out of sync with the real translation).SessionCatalogSection.swift— thepersistShellHistorykey 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.showCommandHistoryForFocusedSurfacenow 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
debugRestoreSessionConfirmationHandlertest 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