Skip to content

channel page is now 3 pages, should be more stable#6

Merged
bmdavis419 merged 2 commits intomainfrom
staging
Dec 18, 2025
Merged

channel page is now 3 pages, should be more stable#6
bmdavis419 merged 2 commits intomainfrom
staging

Conversation

@bmdavis419
Copy link
Collaborator

@bmdavis419 bmdavis419 commented Dec 18, 2025

Greptile Summary

This PR refactors the channel page from a single page with client-side tabs into 3 separate routes (/overview, /last7days, /sponsors) using a shared layout. This architectural change should improve data fetching stability by allowing each route to independently load its data.

Key Changes:

  • Split single-page component with tab state into layout + 3 child routes
  • Old /app/view/channel now redirects to /app/view/channel/overview for backward compatibility
  • Added pagination to ChannelVideos component (20 videos per page)
  • New ChannelSponsorMentions component displays sponsor mentions from comments
  • Updated all internal links to point to /overview route
  • Database layer now returns {videos, totalCount} for pagination support

Data Fetching Improvements:

  • Each route now independently fetches its data
  • Removed client-side tab switching that loaded all data upfront
  • Videos component now uses server-side pagination

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Well-structured refactoring that splits a single-page channel view into 3 separate routes using SvelteKit's layout system. All route references are consistently updated across the codebase. The redirect in the old route maintains backward compatibility.
  • No files require special attention

Important Files Changed

Filename Overview
apps/web/src/routes/app/view/channel/+page.svelte Converted to redirect page that forwards to /overview route, maintains backward compatibility
apps/web/src/routes/app/view/channel/+layout.svelte New layout file with tab navigation for Overview, Last 7 Days, and Sponsors sections
apps/web/src/lib/components/ChannelVideos.svelte Added pagination with currentPage state, page size 20, removed max-height scroll container
apps/web/src/lib/remote/channels.remote.ts Updated remoteGetChannelVideos to accept page/pageSize, added remoteGetChannelSponsorMentions
apps/web/src/lib/services/db.ts getChannelVideos now returns {videos, totalCount}, added offset param and getChannelSponsorMentions method

@bmdavis419 bmdavis419 merged commit 58084a0 into main Dec 18, 2025
2 of 3 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.

1 participant