mirror of
https://github.com/stablyai/orca.git
synced 2026-10-20 08:03:28 +00:00
docs(mobile): document the two per-route reset contracts
Both exported helpers exist for a non-obvious reason — they must be re-created or re-derived per worktree, or a reused route inherits the previous workspace's hydration state and the resurrection guard silently disarms.
This commit is contained in:
@@ -6,6 +6,10 @@ type InitialSessionTerminalAutoCreateState = {
|
||||
sawSessionTabs: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Fresh auto-create bookkeeping. The route must re-create this on every worktree
|
||||
* change, or a revisit inherits the previous workspace's `sawSessionTabs`.
|
||||
*/
|
||||
export function createInitialSessionAutoCreateState(): InitialSessionTerminalAutoCreateState {
|
||||
return { autoCreatedForWorktree: null, sawSessionTabs: false }
|
||||
}
|
||||
@@ -81,6 +85,10 @@ export function useInitialSessionTerminalAutoCreate(
|
||||
])
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracks "tabs hydrated" per worktree so a reused route reports `false` until the
|
||||
* new workspace's own snapshot lands, rather than inheriting the old one's.
|
||||
*/
|
||||
export function useWorktreeSessionTabsLoaded(
|
||||
worktreeId: string
|
||||
): readonly [boolean, (loaded: boolean) => void] {
|
||||
|
||||
Reference in New Issue
Block a user