feat(FN-1470): implement ScreenRouter with tab bar and keyboard navigation
- Add ScreenRouter component for multi-screen navigation in TUI - Implement tab bar with icon labels and active state indicators - Support keyboard navigation with arrow keys and Tab/Shift+Tab - Add mouse click support for tab selection - Export new screen router components from package index - Add comprehensive unit tests for navigation behavior - Update documentation with architecture and gap analysis - Update TUI README with ScreenRouter usage examples
This commit is contained in:
@@ -16,7 +16,7 @@ At a high level, Fusion is split into:
|
||||
- **Dashboard API + SPA** (`@fusion/dashboard`)
|
||||
- **CLI + Pi extension** (`@gsxdsm/fusion`)
|
||||
- **Desktop shell** (`@fusion/desktop`)
|
||||
- **TUI stub** (`@fusion/tui`)
|
||||
- **TUI** (`@fusion/tui`)
|
||||
|
||||
### High-level runtime diagram
|
||||
|
||||
@@ -64,7 +64,7 @@ At a high level, Fusion is split into:
|
||||
| `@fusion/dashboard` | Private | Express API server + React app | `packages/dashboard/src/server.ts`, `routes.ts`, `sse.ts`, `websocket.ts`, `packages/dashboard/app/App.tsx` |
|
||||
| `@gsxdsm/fusion` | **Published** | CLI binary (`fn`) + Pi extension | `packages/cli/src/bin.ts`, `commands/*`, `project-resolver.ts`, `extension.ts` |
|
||||
| `@fusion/desktop` | Private | Electron shell around Fusion dashboard/client | `packages/desktop/src/main.ts`, `ipc.ts`, `preload.ts`, `scripts/build.ts` |
|
||||
| `@fusion/tui` | Private | Ink-based terminal package (currently minimal stub) | `packages/tui/src/index.tsx` |
|
||||
| `@fusion/tui` | Private | Ink-based terminal package with ScreenRouter and tab navigation | `packages/tui/src/index.tsx`, `packages/tui/src/components/screen-router.tsx` |
|
||||
|
||||
> Note: The workspace also contains `@fusion/mobile` (`packages/mobile`), which packages dashboard assets for Capacitor targets.
|
||||
|
||||
@@ -97,7 +97,7 @@ At a high level, Fusion is split into:
|
||||
│ (embeds dashboard client) │
|
||||
└──────────────────────────────┘
|
||||
|
||||
@fusion/tui is currently independent/minimal.
|
||||
@fusion/tui provides keyboard-navigable screen routing.
|
||||
```
|
||||
|
||||
Concrete references:
|
||||
|
||||
@@ -5,10 +5,10 @@ Scope: `packages/core`, `packages/engine`, `packages/dashboard`, `packages/cli`,
|
||||
|
||||
## 1) Incomplete & Stub Packages
|
||||
|
||||
### Finding 1.1 — `@fusion/tui` is still a stub package (**Medium**)
|
||||
- Evidence: `packages/tui/src/index.tsx` only renders `Hello from @fusion/tui!` via Ink and has no command routing, task views, or integration points.
|
||||
- Impact: The workspace includes a TUI package, but it is not usable for real workflows and may be mistaken as production-ready.
|
||||
- Existing tracking: **FN-1055** is present in task list and describes this exact stub gap.
|
||||
### Finding 1.1 — `@fusion/tui` has basic screen navigation (**Medium**)
|
||||
- Evidence: `packages/tui/src/index.tsx` renders `DemoApp` with `FusionProvider` and `ScreenRouter`. The `ScreenRouter` component (`packages/tui/src/components/screen-router.tsx`) provides keyboard-navigable tab switching with support for five screens (board, detail, activity, agents, settings). Number keys 1-5 and Tab/Shift+Tab navigate between tabs. However, the actual screen content is still placeholder text.
|
||||
- Impact: The TUI package now has a foundation for real screen implementations, but full task views and integration points remain to be built.
|
||||
- Existing tracking: **FN-1055** and **FN-1470** track TUI development.
|
||||
|
||||
### Finding 1.2 — `packages/desktop` is implemented, not a placeholder (**Info / correction to preflight assumption**)
|
||||
- Evidence: `packages/desktop` contains `package.json`, `tsconfig.json`, `vitest.config.ts`, `README.md`, build scripts, and substantial source files (`src/main.ts`, `src/ipc.ts`, `src/menu.ts`, `src/tray.ts`, `src/preload.ts`, renderer components/hooks, etc.).
|
||||
|
||||
Reference in New Issue
Block a user