Repository navigation
refactor(web): a platform layer below features; features never import app/ - #507
Merged
Merged
Conversation
… 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>
Contributor
Bugbot couldn't run - usage limit reachedBugbot 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up from #506. Features were reading auth, toasts, appearance and navigation from
app/store, the layer that composes them. They also took components fromapp/shellandapp/settings. This adds the web counterpart of the server'splatform/.Moves
app/store/{authStore,toastStore,uiStore}.ts(+ tests),app/features/viewIds.tsplatform/app/shell/{Brand,FoxLogo,ErrorBoundary}.tsxshared/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.tschecks 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 --noEmitandnpm run lintclean.vitest runon 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.🤖 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 toshared/components/;CloudProviderCredentialsSectionmoves from settings intofeatures/connections/components/so only the credential manager owns it.app/is narrowed to shell UI, settings screens, and the view registry.Enforcement:
architecture.test.tsnow requires downward-only imports alongapp → features → platform → shared(replacing the older “shared never imports a feature” check). Docs, thefeature:newscaffold (viewIdspath), 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.