Skip to content

[tui] GoToMode hook and state machine#203

Open
roninjin10 wants to merge 14 commits intotui-impl/tui-nav-chrome-eng-02from
tui-impl/tui-nav-chrome-eng-05
Open

[tui] GoToMode hook and state machine#203
roninjin10 wants to merge 14 commits intotui-impl/tui-nav-chrome-eng-02from
tui-impl/tui-nav-chrome-eng-05

Conversation

@roninjin10
Copy link
Copy Markdown
Contributor

GoToMode hook and state machine

Implement the go-to mode state machine as a reusable hook.

  1. useGoToMode(): Returns { active, activate(), cancel(), destinationHints: GoToHint[], error: string|null }
  2. State machine: Inactive → press g → Active (1500ms timer) → second key resolves/cancels → Inactive
  3. GoToHint[]: Static array of { key, destination, requiresRepo }
  4. Timeout: 1500ms from activation, cleared on any second key or cancel
  5. Timer cleanup: useEffect cleanup clears timeout on unmount
  6. Error state: 'No repository in context' displayed for 2000ms then auto-clears

Files: apps/tui/src/hooks/useGoToMode.ts

Closes #123


Auto-generated by smithers workflow
Domain: Codeplane TUI
Ticket: tui-nav-chrome-eng-05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tui Terminal UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant