Repository navigation
refactor(web): replace controller prop drilling with svelte context - #80
Merged
andykais merged 3 commits intoOct 14, 2026
Merged
Conversation
andykais
requested changes
Oct 13, 2026
andykais
left a comment
Owner
There was a problem hiding this comment.
Also rebase this branch against main
Comment on lines
+4
to
+7
| import { get_controller } from '$lib/contexts/controller.ts' | ||
|
|
||
| let {controller, height = $bindable()}: {controller: BrowseController, height: number} = $props() | ||
| let {height = $bindable()}: {height: number} = $props() | ||
| const controller = get_controller<BrowseController>() |
Owner
There was a problem hiding this comment.
I'd like this replaced with this pattern:
Suggested change
| import { get_controller } from '$lib/contexts/controller.ts' | |
| let {controller, height = $bindable()}: {controller: BrowseController, height: number} = $props() | |
| let {height = $bindable()}: {height: number} = $props() | |
| const controller = get_controller<BrowseController>() | |
| import * as contexts from '$lib/contexts/index.ts' | |
| let {height = $bindable()}: {height: number} = $props() | |
| const controller = contexts.controller.get<BrowseController>() |
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>
…pace Consumers now import `* as contexts from '$lib/contexts/index.ts'` and call `contexts.controller.get<T>()` / `contexts.controller.set(...)`. Co-authored-by: andykais-ai <andykais-ai@users.noreply.github.com>
cursor
Bot
force-pushed
the
cursor/replace-controller-god-object-with-context-f3ba
branch
from
October 14, 2026 03:27
3909dd5 to
665666c
Compare
andykais
marked this pull request as ready for review
October 14, 2026 03:31
andykais
approved these changes
Oct 14, 2026
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/contextsmodule built on svelte'screateContext; consumers useimport * as contexts from '$lib/contexts/index.ts'withcontexts.controller.set(...)at the page root andcontexts.controller.get<T>()in descendantscontrollerprop through every childcontrollerprop drilling (18+ static prop passes across the browse tree, plus the tags routes)controllerprop fromMediaDetailEntryand a leftover debugconsole.loginSearchLinksvelte5.39.8->5.56.4, sincecreateContextwas added in svelte 5.40mainVision Testing
deno task --cwd packages/web buildsucceedssvelte-checkreports 132 errors on bothmainand this branch with an identical per-file breakdown (0 introduced). The newer svelte addsstate_referenced_locallywarnings onprops, including in files this PR doesn't touch (Sidebar.svelte,Tag.svelte)Media details sidebar
Advanced filters panel
Tag detail page
To show artifacts inline, enable in settings.