Skip to content

refactor(web): a platform layer below features; features never import app/ - #507

Merged
huyplb merged 1 commit into
mainfrom
refactor/web-platform-layer
Oct 11, 2026
Merged

huyplb merged 1 commit into
mainfrom
refactor/web-platform-layer

Conversation

@huyplb

@huyplb huyplb commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up from #506. Features were reading auth, toasts, appearance and navigation from app/store, the layer that composes them. They also took components from app/shell and app/settings. This adds the web counterpart of the server's platform/.

Moves

From To
app/store/{authStore,toastStore,uiStore}.ts (+ tests), app/features/viewIds.ts platform/
app/shell/{Brand,FoxLogo,ErrorBoundary}.tsx shared/components/
app/settings/CloudProviderCredentialsSection.tsx (only the credential manager uses it) features/connections/components/

app/ is now the shell, settings screens and the view registry.

Rule

architecture.test.ts checks one ordered rule: app → features → platform → shared, and each layer imports only the layers below it. It replaces "shared never imports a feature". A/B: planting features → app, platform → features and shared → platform imports fails it, naming each one.

Verification

  • tsc --noEmit and npm run lint clean.
  • Frontend and structure tests: 1608 passed.
  • Full vitest run on a heavily loaded machine (load average 31): 10 timeouts after 300–950 s each, all in code this PR doesn't touch (code-cell sandbox, MCP server, workflow). Their 8 files then passed in isolation, 97/97.
  • Build: first visit unchanged at 144.1 KB gzip.
  • Live e2e on the dev server: smoke, schema history, send-feedback, workspaces, lazy-loading — 22/22.

🤖 Generated with Claude Code


Note

Low Risk
Mechanical moves and import-path updates with architecture tests and docs updated; no described behavior or API changes.

Overview
Introduces a platform/ layer for app-wide state (authStore, toastStore, uiStore, viewIds) and updates imports across the web app from @/app/store/* and shell paths to @/platform/* and the new locations below.

Relocations: shell branding and error handling (Brand, FoxLogo, ErrorBoundary) move to shared/components/; CloudProviderCredentialsSection moves from settings into features/connections/components/ so only the credential manager owns it. app/ is narrowed to shell UI, settings screens, and the view registry.

Enforcement: architecture.test.ts now requires downward-only imports along app → features → platform → shared (replacing the older “shared never imports a feature” check). Docs, the feature:new scaffold (viewIds path), and the e2e test-ids catalog are aligned with the new layout.

Reviewed by Cursor Bugbot for commit 24d8e3d. Bugbot is set up for automated code reviews on this repo. Configure here.

… app/

The web side had no layer below features. Features read auth, toasts, appearance
and navigation from `app/store`, the layer that composes them, and took components
from `app/shell` and `app/settings`. That is the gap the server closed with
`platform/`.

- `platform/`: `authStore`, `toastStore`, `uiStore` and `viewIds` move from
  `app/store` and `app/features`.
- `shared/components/`: `Brand`, `FoxLogo` and `ErrorBoundary` move from `app/shell`.
- `features/connections/`: `CloudProviderCredentialsSection` moves from
  `app/settings`; the credential manager is its only user.
- `architecture.test.ts`: the layers are `app → features → platform → shared`, and
  each imports only the layers below it. This replaces the single
  "shared never imports a feature" rule.
- Docs: CODE_MAP, ARCHITECTURE, the module guide and the dependency rules. The
  scaffold now writes the view id in `platform/viewIds.ts`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 71a0b5da-148b-4e34-aca7-76eae1185aec)

@huyplb
huyplb merged commit 0b2ba24 into main Oct 11, 2026
13 checks passed
@huyplb
huyplb deleted the refactor/web-platform-layer branch October 11, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant