Skip to content

Feat/watchlist sorting#1584

Merged
seferturan merged 3 commits intomainfrom
feat/watchlist_sorting
Jan 30, 2026
Merged

Feat/watchlist sorting#1584
seferturan merged 3 commits intomainfrom
feat/watchlist_sorting

Conversation

@seferturan
Copy link
Copy Markdown
Contributor

@seferturan seferturan commented Jan 23, 2026

🎶 Notes 🎶

  • Fixes Add sorting support to watchlist page #1479
  • Adds support to sorting watch list items.
    • ⚠️ The direction seems to be reversed. I left a fixme in there to pick up when fixed in backend
      • This is now fixed in the API.

👀 Example 👀

Screen.Recording.2026-01-23.at.12.57.50.mov

@trakt-bot trakt-bot Bot enabled auto-merge (rebase) January 23, 2026 12:01
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @seferturan, 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 delivers a significant enhancement by enabling sorting capabilities for watchlist items, directly addressing issue #1479. The changes encompass an update to the Trakt API client, a comprehensive refactoring of watchlist data fetching parameters to support explicit sorting criteria, and the integration of new UI components to allow users to interact with these sorting options. The update also includes improvements to URL generation for various list types, ensuring consistent navigation and state management. A temporary fix for a reversed sort direction from the backend is in place, marked for future resolution.

Highlights

  • Watchlist Sorting Implementation: Introduced the functionality to sort items within a user's watchlist, allowing users to organize their watchlists based on various criteria.
  • Trakt API Client Update: Updated the @jsr/trakt__api dependency from version 0.3.0 to 0.3.2, ensuring the client uses the latest API features and fixes.
  • Refactored Watchlist Query Parameters: The watchlistQuery now utilizes sortBy and sortHow parameters instead of a single sort parameter, providing more granular control over sorting direction.
  • Enhanced URL Generation for Lists: The getListUrl utility has been refactored to support both user-defined lists and watchlists, and can now incorporate sorting parameters directly into the generated URLs.
  • Dynamic Sorting UI Integration: Integrated sorting actions into the WatchlistPaginatedList.svelte and UserListPaginatedList.svelte components, providing a user interface for selecting sorting options.
  • Temporary Sort Direction Inversion: A FIXME comment and corresponding logic have been added to temporarily invert the sort direction for watchlist items, addressing a potential discrepancy with the backend API's sorting behavior.
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 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 counter productive. 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

@seferturan seferturan force-pushed the feat/watchlist_sorting branch from ade47f7 to ec8d965 Compare January 23, 2026 12:01
@seferturan seferturan requested a review from vladjerca January 23, 2026 12:02
@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented Jan 23, 2026

Here's the code health analysis summary for commits 8366989..5a9d104. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScript✅ SuccessView Check ↗
DeepSource Test coverage LogoTest coverage✅ SuccessView Check ↗

Code Coverage Report

MetricAggregateJavascript
Branch Coverage25%25%
Composite Coverage27.5%27.5%
Line Coverage28.6%28.6%

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link
Copy Markdown
Contributor

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

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 introduces sorting functionality for watchlist items, addressing issue #1479. It involves significant refactoring of URL generation and sorting logic across several Svelte components and utility functions. The changes are generally well-structured and adhere to the repository's naming conventions and TypeScript standards. A FIXME comment highlights a known issue with the backend regarding sort direction, which is temporarily handled in the frontend. All original comments have been retained as they do not contradict any provided rules.

Comment thread projects/client/src/lib/sections/lists/watchlist/useWatchList.ts Outdated
@seferturan seferturan force-pushed the feat/watchlist_sorting branch from ec8d965 to 7efd2a1 Compare January 23, 2026 14:43
@CanePlayz
Copy link
Copy Markdown
Contributor

@seferturan You might already be aware of that, but that inverse direction problem happens on all lists if I'm not mistaken

@seferturan
Copy link
Copy Markdown
Contributor Author

@CanePlayz, that was indeed an issue, but in v3 the list items should be sorted in the correct direction.

@seferturan
Copy link
Copy Markdown
Contributor Author

Drafting this for now until backend sorting is changed.

@seferturan seferturan marked this pull request as draft January 26, 2026 07:33
auto-merge was automatically disabled January 26, 2026 07:33

Pull request was converted to draft

@CanePlayz
Copy link
Copy Markdown
Contributor

@CanePlayz, that was indeed an issue, but in v3 the list items should be sorted in the correct direction.

I see what my issue is. When opening a list in v3, the defined sorting direction is just not reflected properly.

image image

@seferturan seferturan force-pushed the feat/watchlist_sorting branch from 7efd2a1 to 5a9d104 Compare January 30, 2026 09:26
@seferturan seferturan marked this pull request as ready for review January 30, 2026 09:26
@trakt-bot trakt-bot Bot enabled auto-merge (rebase) January 30, 2026 09:26
@seferturan
Copy link
Copy Markdown
Contributor Author

@CanePlayz, that's due to v2 inverting the sort setting 😅 In the list settings it seems to be set to desc. As a workaround for now, you can change the default sorting to be ascending.

@seferturan seferturan disabled auto-merge January 30, 2026 09:39
@seferturan seferturan merged commit 363c107 into main Jan 30, 2026
17 checks passed
@seferturan seferturan deleted the feat/watchlist_sorting branch January 30, 2026 09:39
@CanePlayz
Copy link
Copy Markdown
Contributor

CanePlayz commented Jan 30, 2026

@CanePlayz, that's due to v2 inverting the sort setting 😅 In the list settings it seems to be set to desc. As a workaround for now, you can change the default sorting to be ascending.

@seferturan Sorry for having to ask again, I'm just a bit lost on this issue.

image

It seems to be set to ascending in the list settings.

And v2 sorts ascending. v3 doesn't.

Edit: Ohh, was that related to the API issue and will be fixed soon?

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.

Add sorting support to watchlist page

3 participants