Skip to content

Commit 9d8b502

Browse files
authored
Merge pull request #46 from spencerkit/develop
feat: merge develop into main
2 parents a02a135 + 07cab28 commit 9d8b502

157 files changed

Lines changed: 15945 additions & 3160 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@spencer-kit/coder-studio": patch
3+
---
4+
5+
Minor bug fixes and polish.

docs/superpowers/plans/2026-05-14-conversion-first-activation-phase-1-foundation.md

Lines changed: 122 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,109 +6,181 @@
66
>
77
> **Spec:** `docs/superpowers/specs/2026-05-14-conversion-first-activation-design.md`
88
9-
**Goal:** Ship the new activation entry point so a new user can move from `Welcome` to `/setup`, and give the product a backend readiness surface the UI can depend on.
9+
**Goal:** Ship the activation foundation without forcing users into a visible onboarding funnel. The product should stay quiet in healthy flows, recover inline when possible, and expose a diagnostics surface only when users need deeper environment visibility.
1010

11-
**Architecture:** Phase 1 establishes the new activation frame without yet solving the full funnel. The web app gets a setup route and welcome CTA rewrite, while the server and shared domain layer expose `setup.status` and `setup.mobileAccessStatus` as the canonical readiness inputs for later phases.
11+
**Architecture:** Phase 1 does not introduce a mandatory onboarding step. Instead, it establishes two layers: the normal product flow continues inline, while `/diagnostics` becomes a secondary full-environment diagnostics surface. Workspace open and agent launch keep their native behavior first, then link or redirect into diagnostics only at explicit failure points.
1212

13-
**Tech Stack:** TypeScript, React, React Router, Jotai, Vitest, Zod, websocket command dispatch
13+
**Tech Stack:** TypeScript, React, React Router, Jotai, Vitest, websocket command dispatch, Zod
1414

1515
---
1616

1717
## Phase Scope
1818

1919
**Includes master tasks:**
2020

21-
- [Task 1](./2026-05-14-conversion-first-activation.md#task-1-rewrite-welcome-and-add-the-setup-route-shell): rewrite welcome and add the `/setup` route shell
22-
- [Task 2](./2026-05-14-conversion-first-activation.md#task-2-add-shared-setup-dtos-and-the-setupmobile-server-commands): add shared setup DTOs and server readiness commands
21+
- quiet diagnostics route and navigation surface
22+
- full-environment diagnostics command contract
23+
- inline provider launch recovery for desktop and mobile
24+
- failure-path routing from blocked workspace open into diagnostics
2325

2426
**Does not include yet:**
2527

26-
- Environment Doctor UI
27-
- provider-first launch flow
28-
- mobile continuation surface
29-
- return/resume and Supervisor quick-start
28+
- mandatory onboarding wizard
29+
- proactive environment interruption before user intent
30+
- provider auth gating as a product-level entry requirement
31+
- broader welcome-page funnel redesign
3032

3133
**Exit criteria:**
3234

33-
- primary welcome CTA sends users to `/setup`
34-
- `DesktopShell` renders `SetupPage`
35-
- shared DTOs exist for setup/mobile status
36-
- server returns structured readiness data via `setup.status`
37-
- server returns structured LAN/auth exposure data via `setup.mobileAccessStatus`
35+
- no required onboarding step in the primary activation path
36+
- `/diagnostics` exists on desktop and mobile
37+
- diagnostics can be opened manually from Settings
38+
- agent launch keeps inline install/manual recovery behavior
39+
- diagnostics acts as a secondary helper surface, not the default launch path
40+
- diagnostics returns full environment checks for workspace, providers, auth, and mobile access
41+
42+
## Product Definition
43+
44+
### Core Principle
45+
46+
Environment help should behave like a quiet assistant, not a gate. It should help confirm and repair issues when needed, but it should not interrupt healthy flows or force users through an explicit ceremony.
47+
48+
### Primary Flows
49+
50+
- Opening a workspace should continue to use the existing workspace flow.
51+
- Starting an agent should continue to use the existing launcher flow.
52+
- If the runtime is healthy, the product should proceed directly.
53+
- If a recoverable issue exists, the product should try to handle it inline first.
54+
- If the issue needs deeper inspection, the product should offer diagnostics as a secondary path.
55+
56+
### Diagnostics Role
57+
58+
- `/diagnostics` is a full environment diagnostics page.
59+
- It is manually reachable from Settings.
60+
- It can also be reached from explicit failure points such as failed workspace open or blocked session launch.
61+
- It should present environment state clearly, support recheck, and help users understand what is wrong.
62+
- It should not own the normal provider install or session start flow.
3863

3964
## Deliverables
4065

41-
- welcome positioning moved from generic IDE framing to activation-first framing
42-
- new `packages/web/src/features/setup/*` shell exists and is routable
43-
- new shared readiness types in `packages/core`
44-
- new server command surface in `packages/server/src/commands/setup.ts`
66+
- new diagnostics route on desktop and mobile shells
67+
- diagnostics navigation helper and route intent model
68+
- settings entry for manual diagnostics access
69+
- server diagnostics command surface for full environment inspection
70+
- inline desktop and mobile provider launch recovery with diagnostics as secondary affordance
71+
- workspace-open failure handoff into diagnostics
4572

4673
## Tracking Checklist
4774

48-
- [ ] Replace the welcome primary CTA with `Start Setup`
49-
- [ ] Add `/setup` to `DesktopShell`
50-
- [ ] Create the initial `SetupPage` shell and step shell component
51-
- [ ] Add and pass welcome/route tests
52-
- [ ] Add `SetupCheckDto`, `SetupCheckStatus`, and `MobileAccessStatusDto`
53-
- [ ] Extend `CommandContext` with config needed for mobile access reporting
54-
- [ ] Implement `setup.status`
55-
- [ ] Implement `setup.mobileAccessStatus`
56-
- [ ] Add and pass server command tests
75+
- [x] Add `/diagnostics` to desktop and mobile routing
76+
- [x] Add a manual Diagnostics entry in Settings
77+
- [x] Define diagnostics route intent and query parsing helpers
78+
- [x] Add shared diagnostics DTOs in `packages/core`
79+
- [x] Implement server-side full environment diagnostics commands
80+
- [x] Render a diagnostics page with contextual header, checks, docs links, and recheck action
81+
- [x] Keep workspace-open failure redirect into diagnostics
82+
- [x] Keep provider launch inline when runtime is healthy
83+
- [x] Keep provider install inline when CLI is missing and auto-install is supported
84+
- [x] Show inline manual recovery when prerequisites are missing or auto-install is unavailable
85+
- [x] Expose diagnostics as a secondary link from inline launch-help states
86+
- [x] Add and pass focused web and server tests
5787
- [ ] Commit Phase 1 changes
5888

89+
## Status
90+
91+
Completed in the current worktree except for the final commit boundary.
92+
93+
Implemented outcomes:
94+
95+
- diagnostics is available on both desktop and mobile shells
96+
- Settings exposes Diagnostics as its own section entry rather than a buried inline link
97+
- diagnostics reports a full environment view while keeping contextual entry copy and continuation behavior
98+
- blocked workspace and provider/session flows can hand off into diagnostics with intent preserved
99+
- healthy launches and supported auto-install cases still stay inline
100+
101+
Verified on 2026-05-17 with:
102+
103+
```bash
104+
pnpm exec vitest run \
105+
packages/server/src/__tests__/diagnostics-commands.test.ts \
106+
packages/web/src/features/agent-panes/actions/use-provider-launcher.test.tsx \
107+
packages/web/src/features/agent-panes/index.test.tsx \
108+
packages/web/src/features/diagnostics/index.test.tsx \
109+
packages/web/src/features/settings/components/settings-page.test.tsx \
110+
packages/web/src/shells/mobile-shell/index.test.tsx \
111+
packages/web/src/features/workspace/views/mobile/mobile-agent-sheet.test.tsx \
112+
packages/web/src/features/workspace/views/shared/workspace-launch-modal.test.tsx
113+
```
114+
59115
## Files In Play
60116

61117
**Web**
62118

63-
- Modify: `packages/web/src/features/welcome/index.tsx`
64-
- Modify: `packages/web/src/features/welcome/index.test.tsx`
119+
- Modify: `packages/web/src/features/agent-panes/actions/use-provider-launcher.ts`
120+
- Modify: `packages/web/src/features/agent-panes/views/shared/draft-launcher.tsx`
121+
- Modify: `packages/web/src/features/workspace/views/mobile/mobile-agent-sheet.tsx`
122+
- Modify: `packages/web/src/features/workspace/actions/use-workspace-launch-actions.ts`
123+
- Modify: `packages/web/src/features/settings/components/settings-page.tsx`
65124
- Modify: `packages/web/src/shells/desktop-shell.tsx`
66-
- Modify: `packages/web/src/shells/desktop-shell.test.tsx`
125+
- Modify: `packages/web/src/shells/mobile-shell/index.tsx`
67126
- Modify: `packages/web/src/locales/en.json`
68127
- Modify: `packages/web/src/locales/zh.json`
69-
- Create: `packages/web/src/features/setup/index.ts`
70-
- Create: `packages/web/src/features/setup/views/setup-page.tsx`
71-
- Create: `packages/web/src/features/setup/views/setup-page.test.tsx`
72-
- Create: `packages/web/src/features/setup/components/setup-step-shell.tsx`
128+
- Create: `packages/web/src/features/diagnostics/index.ts`
129+
- Create: `packages/web/src/features/diagnostics/navigation.ts`
130+
- Create: `packages/web/src/features/diagnostics/page.tsx`
73131

74132
**Core and server**
75133

134+
- Create: `packages/core/src/domain/diagnostics.ts`
76135
- Modify: `packages/core/src/domain/types.ts`
77-
- Modify: `packages/server/src/ws/dispatch.ts`
78-
- Modify: `packages/server/src/ws/hub.ts`
79136
- Modify: `packages/server/src/commands/index.ts`
80-
- Create: `packages/server/src/commands/setup.ts`
81-
- Create: `packages/server/src/commands/setup.test.ts`
137+
- Create: `packages/server/src/commands/diagnostics.ts`
138+
139+
**Tests**
140+
141+
- Create: `packages/server/src/__tests__/diagnostics-commands.test.ts`
142+
- Create: `packages/web/src/features/agent-panes/actions/use-provider-launcher.test.tsx`
143+
- Create: `packages/web/src/features/diagnostics/index.test.tsx`
144+
- Modify: `packages/web/src/features/agent-panes/index.test.tsx`
145+
- Modify: `packages/web/src/features/settings/components/settings-page.test.tsx`
146+
- Modify: `packages/web/src/shells/mobile-shell/index.test.tsx`
147+
- Modify: `packages/web/src/features/workspace/views/mobile/mobile-agent-sheet.test.tsx`
148+
- Modify: `packages/web/src/features/workspace/views/shared/workspace-launch-modal.test.tsx`
82149

83150
## Verification
84151

85152
Run these before closing the phase:
86153

87154
```bash
88155
pnpm exec vitest run \
89-
packages/web/src/features/welcome/index.test.tsx \
90-
packages/web/src/shells/desktop-shell.test.tsx \
91-
packages/web/src/features/setup/views/setup-page.test.tsx \
92-
packages/server/src/commands/setup.test.ts
156+
packages/server/src/__tests__/diagnostics-commands.test.ts \
157+
packages/web/src/features/agent-panes/actions/use-provider-launcher.test.tsx \
158+
packages/web/src/features/agent-panes/index.test.tsx \
159+
packages/web/src/features/diagnostics/index.test.tsx \
160+
packages/web/src/features/settings/components/settings-page.test.tsx \
161+
packages/web/src/shells/mobile-shell/index.test.tsx \
162+
packages/web/src/features/workspace/views/mobile/mobile-agent-sheet.test.tsx \
163+
packages/web/src/features/workspace/views/shared/workspace-launch-modal.test.tsx
93164
```
94165

95-
Expected outcome: the welcome-to-setup path is green, the `/setup` route is green, and both setup readiness commands return typed data.
166+
Expected outcome: diagnostics is available as a quiet support surface, workspace and agent flows stay inline-first, and explicit failure paths can hand off to a full environment report.
96167

97168
## Watchouts
98169

99-
- Keep the welcome rewrite focused on the conversion path; do not broaden this into a full UI redesign.
100-
- Do not build the actual doctor flow yet; Phase 1 only needs the route shell plus backend contract.
101-
- Preserve future compatibility for mobile continuation by keeping `setup.mobileAccessStatus` stable.
170+
- Do not reintroduce a mandatory onboarding funnel.
171+
- Do not redirect healthy provider launches into diagnostics.
172+
- Do not let diagnostics take ownership of normal provider install/session continuation.
173+
- Do not gate product access on provider auth readiness.
174+
- Keep diagnostics useful but low-emphasis when users do not need it.
102175

103176
## Detailed Execution Source
104177

105-
Use the detailed step-by-step instructions in the master plan:
178+
Use the detailed step-by-step instructions in the contextual diagnostics implementation plan:
106179

107-
- [Task 1 detailed steps](./2026-05-14-conversion-first-activation.md#task-1-rewrite-welcome-and-add-the-setup-route-shell)
108-
- [Task 2 detailed steps](./2026-05-14-conversion-first-activation.md#task-2-add-shared-setup-dtos-and-the-setupmobile-server-commands)
180+
- [Contextual Diagnostics Assistant plan](./2026-05-15-contextual-diagnostics-assistant.md)
109181

110182
## Suggested Commit Boundary
111183

112184
```bash
113-
git commit -m "feat: add setup entrypoint and readiness foundation"
185+
git commit -m "feat: add quiet diagnostics foundation for activation"
114186
```

0 commit comments

Comments
 (0)