Repository navigation
chore(web): delete the legacy React app - #336
Conversation
Production and the desktop shell already ship apps/web-foldkit, which still reached into apps/web through the `~` alias, its stylesheet and public/. - Move the framework-free modules Foldkit uses (collections, actions, theme, RPC/API clients, notifications, *.styles.ts, styles, public/) into apps/web-foldkit/src/core and apps/web-foldkit/public; `~/` now resolves there. Drop their React-only bits (avatar context, unread selectors, slate-react/react-hotkeys types). - Delete apps/web and libs/tanstack-db-atom (only the React app used it), plus the icon/illustration generators that rendered React components. - Move the web alchemy definition into apps/web-foldkit, point setup's env file there, run Foldkit's tests from the root Vitest projects. - ui-parity: drop the legacy-head target; coverage reads routes from the pinned baseline ref. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Maple review🟢 Confidence 7/10 · likely safe to merge Deletes
Before merge
Findings🟠 Warning · F1 · The
|
| Issue | Service | Occurrences | File |
|---|---|---|---|
| @maple/api/vcs/VcsSourceRepositoryNotFoundError | maple-ai | 68 | apps/web/src/lib/registry.ts |
| @maple/mcp/errors/McpQueryError | maple-chat | 45 | apps/web/src/lib/registry.ts |
| @maple/mcp/errors/McpQueryError | maple-chat | 36 | apps/web/src/lib/registry.ts |
| @maple/mcp/errors/McpQueryError | maple-ai | 18 | apps/web/src/lib/registry.ts |
| @maple/http/errors/IntegrationsUpstreamError | maple-chat | 15 | apps/web/src/lib/registry.ts |
| @maple/api/vcs/GithubAppError | maple-chat | 14 | apps/web/src/lib/registry.ts |
| @maple/http/errors/IntegrationsUpstreamError | maple-chat | 11 | apps/web/src/lib/registry.ts |
| @maple/mcp/errors/McpQueryError | maple-ai | 9 | apps/web/src/lib/registry.ts |
| @maple/mcp/errors/McpQueryError | maple-ai | 9 | apps/web/src/lib/registry.ts |
| @maple/mcp/errors/McpQueryError | maple-chat | 8 | apps/web/src/lib/registry.ts |
After this merges, Maple checks whether they stop.
Production traffic of the changed files (last 7 days)
| File | Calls/day | Busiest operations |
|---|---|---|
apps/web-foldkit/src/core/lib/hotkeys/hotkey-registry.ts |
244 | navigation 244/day, 0.0% err |
What was checked
- Every
~/…specifier in the tree resolves undersrc/core(grep of both apps) - No references remain to
libs/tanstack-db-atomor the three deleted generator scripts (git grepat the head) LEGACY_BASELINE_REFexists as a commit, socoverage'sgit showand thelegacyworktree build resolve
Files not reviewed (1)
The review ended before it read these diffs, so nothing above vouches for them.
apps/web/package.json
f156a84 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
|
Important Review skippedToo many files! This PR contains 799 files, which is 649 over the limit of 150. To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configuration
⛔ Files ignored due to path filters: 11
📒 Files selected for processing: 799
You can disable this status message by setting the
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Merged with 3 steps from "Before merge" still open. If they are done, tick them on the review comment; if not, now is the time.
|
| sourcemap: !!process.env.TAURI_ENV_DEBUG, | ||
| }, | ||
| publicDir: resolve(__dirname, "../web/public"), | ||
| plugins: [tailwindcss(), foldkit({ devToolsMcpPort: false })], |
There was a problem hiding this comment.
Warning
The sw.js retire worker is dropped in the public/ move
F1 · Warning · correctness
apps/web/public/sw.js held the URL the Foldkit site served so browsers still running the React app's workbox worker could update into it and unregister; the move carried every other public asset across but left this one behind, and dropping publicDir means /sw.js now falls through to the SPA shell (apps/web-foldkit/alchemy.run.ts:21). A service worker whose update fetch returns text/html fails with an unsupported MIME type, so the workbox registration survives and keeps serving its precached HTML. Move sw.js into apps/web-foldkit/public/.
Move `apps/web/public/sw.js` to `apps/web-foldkit/public/sw.js`; it is the only public asset this move dropped.
🤖 Prompt to fix with an AI agent
In `apps/web-foldkit/vite.config.ts:30`: The `sw.js` retire worker is dropped in the `public/` move.
`apps/web/public/sw.js` held the URL the Foldkit site served so browsers still running the React app's workbox worker could update into it and unregister; the move carried every other public asset across but left this one behind, and dropping `publicDir` means `/sw.js` now falls through to the SPA shell (`apps/web-foldkit/alchemy.run.ts:21`). A service worker whose update fetch returns `text/html` fails with an unsupported MIME type, so the workbox registration survives and keeps serving its precached HTML. Move `sw.js` into `apps/web-foldkit/public/`.
Suggested fix: Move `apps/web/public/sw.js` to `apps/web-foldkit/public/sw.js`; it is the only public asset this move dropped.
Verify the problem exists at that location before changing it, and keep the fix to those lines.
Maple: after this shipped✅ Shipped clean. Nothing this change touches got worse in the hour after it deployed. Deployed to Errors in the changed files:
Maple looks once, an hour after the first deploy that carries the merge. |
Summary
Production (
app.hazel.sh) and the desktop shell already shipapps/web-foldkit. This deletes the old React app (apps/web), about 76k lines.Foldkit still reached into
apps/webthrough the~alias, the stylesheet andpublic/, so this PR moves those pieces first:apps/web-foldkit/src/core(git renames, contents unchanged): 119 framework-free modules Foldkit imports. These are collections and actions, theme, RPC/API clients, notifications, hotkey registry,*.styles.ts, andstyles/. Their 9 tests moved with them.~/now resolves tosrc/core, so no Foldkit import lines changed.public/moved toapps/web-foldkit/public.AvatarSizeis inlined (the React avatar context is gone). The unreadselectors.ts, a React hook that Foldkit didn't use, is removed. The slate-react/slate-history type augmentation is dropped, and the hotkey type now comes from@tanstack/hotkeys. Foldkit'spackage.jsonnow declares the deps it used to pick up fromapps/web.apps/web,libs/tanstack-db-atom(only the React app used it), and the icon/illustration generator scripts that rendered React components. The files they generated are kept and are now edited by hand.apps/web-foldkit/alchemy.run.ts. It has the sameweblogical id, so it deploys to the same Worker.bun run setupnow writesapps/web-foldkit/.env. Root Vitest runsapps/web-foldkitin place ofapps/web. A lint override turns three Foldkit architecture rules off forsrc/core, because those modules are imperative code, not Foldkit programs.legacy-headtarget is gone.coveragereads the route tree fromLEGACY_BASELINE_REFviagit show.build legacystill works from the pinned worktree.Verification
turbo typecheck(all packages) andalchemy:typecheckpass.vitest --project web-foldkit: 157 files, 1473 passed.vite buildfor web-foldkit succeeds.apps/web-foldkitandpackages/ui-parityis the same as onmain(9).Follow-ups (not in this PR)
FRONTEND_URLandHAZEL_WEB_URLstill default tolocalhost:3000.apps/web-foldkittoapps/web, and splittingsrc/coreinto a cleaner layout.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.