Skip to content

refactor(web): replace controller prop drilling with svelte context#80

Draft
andykais-claude wants to merge 2 commits into
mainfrom
cursor/replace-controller-god-object-with-context-f3ba
Draft

refactor(web): replace controller prop drilling with svelte context#80
andykais-claude wants to merge 2 commits into
mainfrom
cursor/replace-controller-god-object-with-context-f3ba

Conversation

@andykais-claude

Copy link
Copy Markdown
Collaborator

Summary

  • implements a typed $lib/contexts/controller helper built on svelte's createContext (set_controller / get_controller<T>())
  • improves the browse and tags routes by setting the route controller in component context at the page root instead of passing a controller prop through every child
  • removes all controller prop drilling (18+ static prop passes across the browse tree, plus the tags routes); descendants now read the controller via get_controller()
  • drops the unused controller prop from MediaDetailEntry and a leftover debug console.log in SearchLink
  • bumps svelte 5.39.8 -> 5.56.4, since createContext was added in svelte 5.40

Vision Testing

  • deno task --cwd packages/web build succeeds
  • deno task --cwd packages/web check reports an identical per-file error distribution before and after the change (131 pre-existing errors, 0 introduced)
  • manually verified the browse UI (search, advanced filters, thumbnail selection, media detail sidebar, tag autocomplete, footer controls) and the tags list + tag detail pages render and behave correctly with the controller sourced from context
Open in Web Open in Cursor 

cursoragent and others added 2 commits July 15, 2026 02:40
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>
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.

2 participants