Skip to content

refactor: project layout Svelte 5 migration and cleanup#9140

Open
ericpgreen2 wants to merge 8 commits intomainfrom
ericgreen/project-layout-refactor
Open

refactor: project layout Svelte 5 migration and cleanup#9140
ericpgreen2 wants to merge 8 commits intomainfrom
ericgreen/project-layout-refactor

Conversation

@ericpgreen2
Copy link
Copy Markdown
Contributor

@ericpgreen2 ericpgreen2 commented Mar 30, 2026

The project layout ([organization]/[project]/+layout.svelte) is one of the most complex files in web-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.

  • 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 dead code (invalidations.ts, ResourceError.svelte) and relocate constants.ts

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Developed in collaboration with Claude Code

… 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)
@ericpgreen2 ericpgreen2 changed the title refactor: extract shared utilities and convert project layout to Svelte 5 refactor: project layout Svelte 5 migration and cleanup Mar 30, 2026
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.
@ericpgreen2 ericpgreen2 requested a review from AdityaHegde March 30, 2026 12:39
@ericpgreen2 ericpgreen2 self-assigned this Mar 30, 2026
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.
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