Skip to content

perf(calendar): move day-grouping server-side via group=day#2901

Merged
trakt-bot[bot] merged 1 commit into
mainfrom
feat/calendar_group
Jul 14, 2026
Merged

perf(calendar): move day-grouping server-side via group=day#2901
trakt-bot[bot] merged 1 commit into
mainfrom
feat/calendar_group

Conversation

@vladjerca

Copy link
Copy Markdown
Contributor

What

Completes the calendar-grouping move: drops the client-side coalesceEpisodes from the calendar feeds and lets the worker collapse same-show-same-day episodes via ?group=day.

  • upcomingEpisodesQuery (shows), upcomingMediaQuery, releasesCalendarQuery now pass group=day; their mappers render the server's grouped cards directly.
  • mapToUpcomingEpisodeEntry carries the nested episodes array for multiple_episodes cards (only when present, matching the old coalesce shape).
  • @trakt/api bumped to 0.4.25.

Notes

  • coalesceEpisodes is kept - still used by coalesceBinges (non-calendar).
  • mapToPostCredits now takes a structural { during_credits?, after_credits? } param so it accepts the widened calendar episode (which gained the full_season/multiple_episodes types) without coupling to the episode enum.

Dependency chain

Verification

  • svelte-check: 0 errors
  • test:unit: 26 passed (releasesCalendar / coalesceEpisodes / coalesceBinges specs)

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.
@trakt-bot trakt-bot Bot enabled auto-merge (rebase) July 14, 2026 09:59
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 group=day API parameter, the application now receives pre-collapsed episode data, allowing for the removal of redundant client-side coalescing logic. These changes improve performance and simplify the data mapping process for calendar feeds.

Highlights

  • Server-side grouping: Offloaded episode grouping to the server by passing the group=day parameter to calendar-related API requests.
  • Removal of client-side logic: Removed the coalesceEpisodes utility from calendar feed queries, as the server now provides pre-grouped data.
  • Dependency update: Updated @trakt/api to version 0.4.25 to support the new grouping contract.
  • Type and mapper adjustments: Updated mapToUpcomingEpisodeEntry to handle nested episodes and adjusted mapToPostCredits to accept a structural parameter for widened episode types.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@deepsource-io

deepsource-io Bot commented Jul 14, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 7d60547...d77e83f on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@trakt-bot trakt-bot Bot merged commit 1f1d710 into main Jul 14, 2026
23 checks passed
@trakt-bot trakt-bot Bot deleted the feat/calendar_group branch July 14, 2026 18:41
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