Files
ForgeLM/.planning/phases/03-unified-runtime-workspace/03-03-PLAN.md
T

145 lines
8.2 KiB
Markdown

---
phase: 03-unified-runtime-workspace
plan: 03
type: execute
wave: 3
depends_on: [03-02]
files_modified:
- tauri-app/src/components/Sidebar.tsx
- tauri-app/src/components/Sidebar.css
- tauri-app/src/App.tsx
- tauri-app/src/App.css
- tauri-app/src/features/runtime/components/RuntimeWorkspace.tsx
- tauri-app/src/features/runtime/components/RuntimeWorkspace.css
- tauri-app/src/features/runtime/components/RuntimeSurface.test.tsx
autonomous: true
requirements: [WORK-01, DIAG-01]
must_haves:
truths:
- The sidebar shell exposes exactly one authoritative runtime workspace instead of separate runtime status and settings surfaces.
- Desktop and mobile layouts keep runtime controls, health details, and chat navigation usable without overlap or hidden state traps.
- App-level wiring continues to use the existing runtime manager and model refresh flow while removing split-authority runtime UI patterns.
artifacts:
- path: tauri-app/src/components/Sidebar.tsx
provides: shell-level integration of the unified runtime workspace as the primary operator surface
- path: tauri-app/src/components/Sidebar.css
provides: sidebar layout updates for the larger runtime workspace on desktop and mobile
- path: tauri-app/src/App.tsx
provides: app-level wiring that keeps chat and runtime connection behavior aligned with the unified workspace
- path: tauri-app/src/features/runtime/components/RuntimeSurface.test.tsx
provides: final integration coverage proving the split card-plus-drawer flow is gone
key_links:
- from: tauri-app/src/components/Sidebar.tsx
to: tauri-app/src/features/runtime/components/RuntimeWorkspace.tsx
via: direct shell embedding of the authoritative runtime workspace
pattern: RuntimeWorkspace|runtime
- from: tauri-app/src/App.tsx
to: tauri-app/src/features/runtime/useRuntimeManager.ts
via: existing runtime manager and model refresh wiring preserved after shell integration
pattern: useRuntimeManager|useRuntimeReadyModelRefresh
---
<objective>
Finish Phase 3 by making the unified runtime workspace the only authoritative runtime surface in the app shell.
Purpose: remove split runtime authority from the sidebar and modal flow, then make sure the consolidated workspace remains usable in the existing desktop and mobile shell.
Output: sidebar and app-shell integration that embed the unified runtime workspace directly, retire the split status-card plus settings-drawer flow, and keep runtime-aware chat behavior aligned with the same source of truth.
</objective>
<execution_context>
@$HOME/.config/opencode/get-shit-done/workflows/execute-plan.md
@$HOME/.config/opencode/get-shit-done/templates/summary.md
</execution_context>
<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/REQUIREMENTS.md
@.planning/phases/03-unified-runtime-workspace/03-RESEARCH.md
@.planning/phases/03-unified-runtime-workspace/03-02-PLAN.md
@tauri-app/src/App.tsx
@tauri-app/src/App.css
@tauri-app/src/components/Sidebar.tsx
@tauri-app/src/components/Sidebar.css
@tauri-app/src/features/runtime/components/RuntimeWorkspace.tsx
@tauri-app/src/features/runtime/components/RuntimeSurface.test.tsx
</context>
<tasks>
<task type="auto" tdd="true">
<name>Task 1: Replace the split runtime shell flow with the unified workspace</name>
<files>tauri-app/src/components/Sidebar.tsx, tauri-app/src/features/runtime/components/RuntimeWorkspace.tsx, tauri-app/src/features/runtime/components/RuntimeSurface.test.tsx</files>
<read_first>
- tauri-app/src/components/Sidebar.tsx
- tauri-app/src/features/runtime/components/RuntimeWorkspace.tsx
- tauri-app/src/features/runtime/components/RuntimeStatusCard.tsx
- tauri-app/src/features/runtime/components/RuntimeSettingsDrawer.tsx
- tauri-app/src/features/runtime/components/RuntimeSurface.test.tsx
- .planning/phases/03-unified-runtime-workspace/03-RESEARCH.md
</read_first>
<behavior>
- Test 1: the sidebar renders the unified runtime workspace directly instead of separately rendering `RuntimeStatusCard` and opening `RuntimeSettingsDrawer`.
- Test 2: runtime lifecycle actions and draft editing still work from the sidebar-hosted workspace after the shell integration.
- Test 3: the old split launcher flow is removed so runtime health and settings are visible in one authoritative place.
</behavior>
<action>Refactor `tauri-app/src/components/Sidebar.tsx` so it imports and renders `RuntimeWorkspace` directly with the existing runtime manager props. Remove the shell wiring that separately renders `RuntimeStatusCard`, tracks `showRuntimeSettings`, or mounts `RuntimeSettingsDrawer` as a second runtime surface. Update `RuntimeSurface.test.tsx` so the integration harness asserts the sidebar-hosted workspace rather than the old card-plus-drawer composition.</action>
<acceptance_criteria>
- `tauri-app/src/components/Sidebar.tsx` contains `RuntimeWorkspace`.
- `tauri-app/src/components/Sidebar.tsx` no longer contains `RuntimeStatusCard`.
- `tauri-app/src/components/Sidebar.tsx` no longer contains `RuntimeSettingsDrawer`.
- `tauri-app/src/features/runtime/components/RuntimeSurface.test.tsx` contains `RuntimeWorkspace` assertions after shell integration.
</acceptance_criteria>
<verify>
<automated>npm test -- RuntimeSurface</automated>
</verify>
<done>The app shell exposes one authoritative runtime workspace instead of split runtime surfaces.</done>
</task>
<task type="auto" tdd="true">
<name>Task 2: Make the unified workspace fit the app shell on desktop and mobile</name>
<files>tauri-app/src/components/Sidebar.css, tauri-app/src/App.tsx, tauri-app/src/App.css, tauri-app/src/features/runtime/components/RuntimeWorkspace.css</files>
<read_first>
- tauri-app/src/components/Sidebar.css
- tauri-app/src/App.tsx
- tauri-app/src/App.css
- tauri-app/src/features/runtime/components/RuntimeWorkspace.css
- tauri-app/src/features/runtime/components/RuntimeWorkspace.tsx
- .planning/phases/03-unified-runtime-workspace/03-RESEARCH.md
</read_first>
<behavior>
- Test 1: the sidebar and main app layout still render without overflow regressions when the unified workspace replaces the smaller status card.
- Test 2: mobile sidebar open or close behavior still works with the larger runtime workspace present.
- Test 3: the runtime connection and model refresh wiring in `App.tsx` remain unchanged in behavior after the shell integration.
</behavior>
<action>Update `tauri-app/src/components/Sidebar.css`, `tauri-app/src/App.css`, and `tauri-app/src/features/runtime/components/RuntimeWorkspace.css` so the embedded workspace has deliberate spacing, section stacking, and mobile-safe overflow behavior inside the existing sidebar shell. Keep the existing `useRuntimeManager()` and `useRuntimeReadyModelRefresh()` wiring in `tauri-app/src/App.tsx`, but adjust shell structure only as needed so the larger runtime workspace and chat view coexist cleanly on desktop and mobile without clipping the runtime controls or hiding the sidebar backdrop flow.</action>
<acceptance_criteria>
- `tauri-app/src/components/Sidebar.css` contains `.runtime-workspace` layout rules or an equivalent sidebar runtime workspace selector.
- `tauri-app/src/App.tsx` still contains `useRuntimeManager()` and `useRuntimeReadyModelRefresh(`.
- `tauri-app/src/App.css` or `tauri-app/src/features/runtime/components/RuntimeWorkspace.css` contains responsive rules for the unified workspace.
- `npm run build` exits 0 after the shell integration.
</acceptance_criteria>
<verify>
<automated>npm run build</automated>
</verify>
<done>The authoritative runtime workspace fits the existing shell and remains usable on both desktop and mobile layouts.</done>
</task>
</tasks>
<verification>
- `npm test -- RuntimeSurface`
- `npm run build`
</verification>
<success_criteria>
- The sidebar and app shell expose one authoritative runtime workspace.
- The consolidated runtime workspace remains usable in desktop and mobile layouts.
- Runtime connection and model refresh behavior stay aligned with the existing manager contract while split runtime surfaces are removed.
</success_criteria>
<output>
After completion, create `.planning/phases/03-unified-runtime-workspace/03-03-SUMMARY.md`
</output>