Skip to content

Add library toggler#2373

Open
kevincador wants to merge 1 commit into
mainfrom
feature/library-toggler
Open

Add library toggler#2373
kevincador wants to merge 1 commit into
mainfrom
feature/library-toggler

Conversation

@kevincador
Copy link
Copy Markdown
Contributor

Summary

Adds a shared Library toggler for switching between Plex and Custom Library.

  • Replaces the profile Library dropdown with the shared trakt-toggler
  • Adds the same toggler to /users/me/library
  • Keeps the full Library page mode reflected in ?library=plex|other
  • Adds a CustomLibraryIcon and maps Plex/Custom icons in the toggler
  • Shows the active library mode as metadata while keeping the toggler icon-only
Screenshot 2026-05-18 at 17 12 21 Screenshot 2026-05-18 at 17 12 03

@kevincador kevincador requested a review from seferturan May 18, 2026 15:14
@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 introduces a unified Library toggler component to replace the existing dropdown implementation. The change streamlines the user experience for switching between Plex and Custom library views across the application, ensuring consistent state management and visual representation.

Highlights

  • Library Toggler Integration: Replaced the profile Library dropdown with a shared LibraryToggler component to provide a consistent UI for switching between Plex and Custom library modes.
  • Expanded Toggler Functionality: Implemented the LibraryToggler across both the main library list and the user library page, ensuring that the active library mode is correctly reflected in the UI and URL parameters.
  • UI/UX Enhancements: Added a CustomLibraryIcon and updated internal components to support dynamic icon mapping and metadata display for the active library mode.
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.

@trakt-bot trakt-bot Bot enabled auto-merge (rebase) May 18, 2026 15:14
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 refactors the library selection UI by replacing the LibraryDropdown with a new LibraryToggler component, utilizing the project's standardized toggler system. Changes include defining a new 'library' toggler type, adding corresponding icons, and updating the library list and user library pages to support this new interaction pattern. The reviewer recommended replacing hardcoded 'Plex' strings with translation keys in the toggler constants and translation utilities to ensure consistency with the project's localization standards.

Comment on lines +139 to +140
text: () => 'Plex',
label: () => 'Plex',
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.

medium

The string 'Plex' is hardcoded. To maintain consistency with the internationalization (i18n) standards of the project and to allow for potential localization, please use a translation key from the messages file, similar to how the other option is handled.

Suggested change
text: () => 'Plex',
label: () => 'Plex',
text: m.translated_value_library_plex,
label: m.translated_value_library_plex,

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.

@gemini-code-assist, plex is a brand name, it doesn't need to be translated.

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.

You are correct that 'Plex' is a brand name and generally does not require translation. Thank you for the clarification.

import * as m from '$lib/features/i18n/messages.ts';

const LIBRARY_MAP = {
plex: () => 'Plex',
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.

medium

The string 'Plex' is hardcoded here as well. Please use the corresponding translation key to ensure all user-facing strings are localized.

Suggested change
plex: () => 'Plex',
plex: m.translated_value_library_plex,

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.

@gemini-code-assist, plex is a brand name, it doesn't need to be translated.

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.

You are correct, 'Plex' is a brand name and does not require translation. Thank you for the clarification.

Copy link
Copy Markdown
Contributor

@seferturan seferturan left a comment

Choose a reason for hiding this comment

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

I like having this in a toggler :D

The icon used for Plex is the one we also use as the generic Library icon in the sidebar. Maybe we could make some better icons here; for Plex something with their > logo? And ideally also a better icon for the custom one, but I have no inspiration atm for that 😅
@ElMagnea, thoughts?

@SebastianRasch
Copy link
Copy Markdown

This is so cool with the Gemini code assist, makes implementing changes like this so much easier and faster!

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.

3 participants