Auth state refactor#1380
Merged
Merged
Conversation
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>
|
Preview removed. |
eyeseast
marked this pull request as ready for review
July 20, 2026 16:38
allanlasser
reviewed
Jul 22, 2026
…o 1264-auth-state-refactor
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.
Replace
$me/$org/$user_orgs/$org_userscontext stores withpage.datareads. 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.sveltecomponents are deleted. Los of tests were added before refactoring.Closes #1264