perf(calendar): move day-grouping server-side via group=day#2901
Conversation
Drops the client-side `coalesceEpisodes` from the calendar feeds and asks the worker to collapse same-show-same-day episodes with `?group=day`. The shows, media and hot-releases queries now pass `group=day`; their mappers render the server's grouped cards directly (`mapToUpcomingEpisodeEntry` carries the nested `episodes` for `multiple_episodes` cards). Bumps @trakt/api to 0.4.25. `coalesceEpisodes` stays (still used by `coalesceBinges`). `mapToPostCredits` takes a structural param so it accepts the widened calendar episode.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request completes the migration of calendar episode grouping from the client to the server. By leveraging the new Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
|
Overall Grade |
Security Reliability Complexity Hygiene Coverage |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | Jul 14, 2026 9:59a.m. | Review ↗ | |
| Code coverage | Jul 14, 2026 9:59a.m. | Review ↗ |
Code Coverage Summary
| Language | Line Coverage (Overall) |
|---|---|
| Aggregate | 65.5% |
| Javascript | 65.5% |
➟ Additional coverage metrics may have been reported. See full coverage report ↗
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
Code Review
This pull request updates the @trakt/api dependency to version 0.4.25 and implements grouping by day (group: 'day') for calendar queries, which collapses multi-episode days into a single card and returns grouped episodes under episode.episodes. Consequently, the client-side coalesceEpisodes utility is removed, and the mapping logic is updated to handle the nested episodes array. Feedback on the changes highlights that UpcomingEpisodeEntrySchema must be updated to include the new episodes field; otherwise, Zod validation will strip this property before it reaches the UI.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
What
Completes the calendar-grouping move: drops the client-side
coalesceEpisodesfrom the calendar feeds and lets the worker collapse same-show-same-day episodes via?group=day.upcomingEpisodesQuery(shows),upcomingMediaQuery,releasesCalendarQuerynow passgroup=day; their mappers render the server's grouped cards directly.mapToUpcomingEpisodeEntrycarries the nestedepisodesarray formultiple_episodescards (only when present, matching the old coalesce shape).@trakt/apibumped to 0.4.25.Notes
coalesceEpisodesis kept - still used bycoalesceBinges(non-calendar).mapToPostCreditsnow takes a structural{ during_credits?, after_credits? }param so it accepts the widened calendar episode (which gained thefull_season/multiple_episodestypes) without coupling to the episode enum.Dependency chain
@trakt/api@0.4.25Verification
svelte-check: 0 errorstest:unit: 26 passed (releasesCalendar / coalesceEpisodes / coalesceBinges specs)