refactor(web): replace controller prop drilling with svelte context#80
Draft
andykais-claude wants to merge 2 commits into
Draft
refactor(web): replace controller prop drilling with svelte context#80andykais-claude wants to merge 2 commits into
andykais-claude wants to merge 2 commits into
Conversation
Co-authored-by: andykais-claude <andykais-claude@users.noreply.github.com>
Introduce a typed $lib/contexts/controller helper built on svelte's createContext, and set the route controller in each page's context (browse, tags, tags/[slug]). Descendant components now read the controller via get_controller() instead of receiving it as a prop, removing all controller prop drilling. MediaDetailEntry drops its unused controller prop entirely. Co-authored-by: andykais-claude <andykais-claude@users.noreply.github.com>
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.
Summary
$lib/contexts/controllerhelper built on svelte'screateContext(set_controller/get_controller<T>())controllerprop through every childcontrollerprop drilling (18+ static prop passes across the browse tree, plus the tags routes); descendants now read the controller viaget_controller()controllerprop fromMediaDetailEntryand a leftover debugconsole.loginSearchLinksvelte5.39.8->5.56.4, sincecreateContextwas added in svelte 5.40Vision Testing
deno task --cwd packages/web buildsucceedsdeno task --cwd packages/web checkreports an identical per-file error distribution before and after the change (131 pre-existing errors, 0 introduced)