Skip to content

[tui] GoToMode hook and state machine #123

@roninjin10

Description

@roninjin10

GoToMode hook and state machine

Type: engineering
Domain: Codeplane TUI

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

Dependencies: tui-nav-chrome-eng-01, tui-nav-chrome-eng-02


Auto-generated by smithers workflow

Metadata

Metadata

Assignees

No one assigned

    Labels

    tuiTerminal UI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions