Skip to content

Auth state refactor#1380

Merged
eyeseast merged 5 commits into
mainfrom
1264-auth-state-refactor
Jul 22, 2026
Merged

Auth state refactor#1380
eyeseast merged 5 commits into
mainfrom
1264-auth-state-refactor

Conversation

@eyeseast

Copy link
Copy Markdown
Collaborator

Replace $me/$org/$user_orgs/$org_users context stores with page.data reads. This touches a lot of files but mostly just renames things and skips the overhead of managing stores. This removes the last remaining warnings from the Svelte 5 upgrade and syntax migration.

In the course of this, I cleaned up some testing files to use a newer wrapper pattern: https://svelte.dev/docs/svelte/context#Component-testing. So that's why lots of *.demo.svelte components are deleted. Los of tests were added before refactoring.

Closes #1264

eyeseast and others added 3 commits July 20, 2026 10:29
The layout's writable context stores were just reactive mirrors of load
data that nothing ever wrote back to, so getCurrentUser() and the
org/user_orgs/org_users consumers now read directly from page.data
(via $app/state) instead. Removes the layout's setContext/$effect sync
block entirely and drops the now-redundant {#await} wrapper in
Navigation since user_orgs/org_users are already-resolved arrays.

Updates the Storybook decorators and test mocks accordingly, mocking
$app/state instead of setting Svelte context.

Fixes #1264

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

Preview removed.

@eyeseast
eyeseast marked this pull request as ready for review July 20, 2026 16:38
Comment thread src/lib/utils/permissions.ts

@allanlasser allanlasser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@eyeseast
eyeseast changed the base branch from 1376-storybook-9 to main July 22, 2026 14:58
@eyeseast
eyeseast merged commit c743b57 into main Jul 22, 2026
6 checks passed
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.

Refactor top-level auth checks to use state instead of stores

2 participants