Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# Allow option for viewing custom menu links #229

Merged

Conversation

herrrta
Copy link

@herrrta herrrta commented Nov 29, 2024

Requested by me here: #228

This is my first time using something like react native. Let me know if I followed any conventions incorrectly

  • Added new 'Other' setting to toggle new tab visibility
  • Added new Tab to show custom links
  • Added icon asset for list

Tab layout

image

'Other' setting toggle

image

Summary by Sourcery

Add a new feature to allow users to toggle and view custom menu links through a new tab in the application. This includes a new setting to control the tab's visibility and the integration of custom links from the Jellyfin web config.json file.

New Features:

  • Introduce a new 'Other' setting to toggle the visibility of a new tab for custom menu links.
  • Add a new tab to display custom links, which are defined in the Jellyfin web config.json file.
  • Include a new icon asset for the list view in the custom links tab.

Copy link

sourcery-ai bot commented Nov 29, 2024

Reviewer's Guide by Sourcery

This PR implements a new feature that allows users to view custom menu links defined in the Jellyfin web config.json file. The implementation adds a new tab in the navigation bar and a settings toggle to control its visibility. The custom links tab displays a list of menu links that can be opened in a web browser.

Class Diagram for Settings and MenuLink

classDiagram
    class Settings {
        +boolean showCustomMenuLinks
        +number rewindSkipTime
        +String optimizedVersionsServerUrl
        +String downloadMethod
        +boolean autoDownload
    }
    class MenuLink {
        +String name
        +String url
        +String icon
    }
    Settings --> MenuLink : uses
    note for Settings "Added showCustomMenuLinks attribute"
    note for MenuLink "New class for menu link representation"
Loading

File-Level Changes

Change Details Files
Added new tab navigation for custom menu links
  • Added new tab screen with conditional rendering based on settings
  • Configured tab icon for both Android and iOS platforms
  • Created new layout configuration for the custom links tab
app/(auth)/(tabs)/_layout.tsx
app/(auth)/(tabs)/(custom-links)/_layout.tsx
Implemented custom menu links display screen
  • Created FlatList to display menu links
  • Added functionality to fetch menu links from config.json
  • Implemented web browser opening for link clicks
  • Added list item styling and icons
app/(auth)/(tabs)/(custom-links)/index.tsx
Added settings toggle for custom menu links visibility
  • Added new setting toggle UI component
  • Added showCustomMenuLinks flag to settings type
  • Initialized default value for showCustomMenuLinks
components/settings/SettingToggles.tsx
utils/atoms/settings.ts

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @herrrta - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Fix incorrect JavaScript syntax for property existence check (link)

Overall Comments:

  • There's a syntax error in the menu links component: "menuLinks" !in config is incorrect JavaScript syntax. Use !config.hasOwnProperty("menuLinks") or !("menuLinks" in config) instead.
  • Consider adding proper TypeScript interfaces for the API response data to improve type safety. The config.json response should be properly typed rather than using implicit any types.
Here's what I looked at during the review
  • 🔴 General issues: 1 blocking issue, 1 other issue
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

app/(auth)/(tabs)/(custom-links)/index.tsx Outdated Show resolved Hide resolved
app/(auth)/(tabs)/(custom-links)/index.tsx Show resolved Hide resolved
@herrrta herrrta force-pushed the feat/custom-menu-links branch 4 times, most recently from 3797a2a to d46e182 Compare November 30, 2024 03:25
@Alexk2309
Copy link
Contributor

Alexk2309 commented Nov 30, 2024

Like this feature, would be nice if we could use this for the optimized sever, to automatically connect it.

- Added new 'Other' setting to toggle new tab visibility
- Added new Tab to show custom links
- Added icon asset for list
@fredrikburmester fredrikburmester merged commit 3e45adf into fredrikburmester:master Dec 1, 2024
1 check passed
@herrrta herrrta deleted the feat/custom-menu-links branch December 2, 2024 12:44
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