refactor: project layout Svelte 5 migration and cleanup#9140
Open
ericpgreen2 wants to merge 8 commits intomainfrom
Open
refactor: project layout Svelte 5 migration and cleanup#9140ericpgreen2 wants to merge 8 commits intomainfrom
ericpgreen2 wants to merge 8 commits intomainfrom
Conversation
… utilities - Migrate `+layout.svelte` from Svelte 4 to Svelte 5 runes (`$derived`, `$effect`, `$props`) - Extract `baseGetProjectQueryOptions` polling config to `project-query-options.ts` - Extract `resolveRuntimeConnection` to `project-runtime.ts` with unit tests - Remove duplicate mock query chain from `ProjectHeader` (layout already passes mock-aware permissions) - Add section comments and component-level doc block to layout
- Delete `invalidations.ts` (dead code, zero consumers) - Delete `ResourceError.svelte` (dead code, shadowed by `web-common` version) - Move `constants.ts` to `user-management/constants.ts` (closer to its only consumer)
8 tasks
Replace three positional mock params (userId, credentials, permissions) with a single `mockUser` object. The caller constructs it or passes undefined, so the "all or nothing" relationship is enforced by the type system rather than a runtime check.
Remove `pageData`, `pathname`, and `projectError` — pure aliases that add indirection without simplifying anything. Use `page.data`, `page.url.pathname`, and `$projectQuery.error` directly.
…pages Report and alert routes don't have a `[token]` route param, so the fallback was always undefined. Keeping it suggested a code path that doesn't exist.
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.
The project layout (
[organization]/[project]/+layout.svelte) is one of the most complex files inweb-admin— it's the convergence point for auth mode, deployment lifecycle, runtime connection, and navigation chrome. The upcoming branch deployment UI (#9011) adds a fifth dimension (branch state), so this PR cleans up and simplifies the layout first.+layout.sveltefrom Svelte 4 to Svelte 5 runes ($derived,$effect,$props)baseGetProjectQueryOptionspolling config toproject-query-options.tsresolveRuntimeConnectiontoproject-runtime.tswith unit testsProjectHeader(layout already passes mock-aware permissions)invalidations.ts,ResourceError.svelte) and relocateconstants.tsChecklist:
Developed in collaboration with Claude Code