Add library toggler#2373
Conversation
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 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
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
|
There was a problem hiding this comment.
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.
| text: () => 'Plex', | ||
| label: () => 'Plex', |
There was a problem hiding this comment.
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.
| text: () => 'Plex', | |
| label: () => 'Plex', | |
| text: m.translated_value_library_plex, | |
| label: m.translated_value_library_plex, |
There was a problem hiding this comment.
@gemini-code-assist, plex is a brand name, it doesn't need to be translated.
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
@gemini-code-assist, plex is a brand name, it doesn't need to be translated.
There was a problem hiding this comment.
You are correct, 'Plex' is a brand name and does not require translation. Thank you for the clarification.
seferturan
left a comment
There was a problem hiding this comment.
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?
|
This is so cool with the Gemini code assist, makes implementing changes like this so much easier and faster! |
Summary
Adds a shared Library toggler for switching between Plex and Custom Library.
trakt-toggler/users/me/library?library=plex|otherCustomLibraryIconand maps Plex/Custom icons in the toggler