FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

[Feature Request]: Hide IV related options when IV API isnt set as primary/fallback

Open efb4f5ff-1298-471a-8973-3d47447115dc opened this issue 7 months ago • 3 comments

Guidelines

Problem Description

When Primary API is set to Local and fallback is disabled we can safely assume that the user doesnt want to use the IV API. While we do hide some elements under these conditions others are still being displayed.

Proposed Solution

Example of elements where we could hide IV related options

Image Image Image Image Image Image

Alternatives Considered

None.

Issue Labels

visual improvement

Additional Information

No response

I've taken a quick look at this and it's simple for any Vue components, but hit a bit of a roadblock with links inside the context menu.

Since the electron-context-menu is only called once, my idea was to de-couple the context menu from the main app index.js and have it re-initialize (with appropriate params) every time the Invidious backend is toggled inside the settings. I wanted to check if this would be the preferred way to implement this or if anyone else has some other ideas?

ozrendev avatar Jun 14 '25 07:06 ozrendev

@ozrendev Great to hear you are interested in looking into this! While yes we do call the initialise function once, we actually register prepend and append callbacks that are called every time the context menu is triggered, which is how we customise the Copy Link options.

As those callbacks are synchronous and reading from the databases is an asynchronous operation, my suggestion would be to instead read the two relevant settings once at start-up (you can take inspiration for how we handle the proxy settings), store them in variables that can be used in those callbacks and update the variables when the settings change (you can take inspiration for how we handle updating the app menu).

If you need any more specific guidance feel free to reach out.

absidue avatar Jun 14 '25 19:06 absidue

@absidue Thanks for the detailed reply, it really helped a lot! I've created the relevant pull request #7572

It covers the scenarios in the original issue and I couldn't find any other places where it was necessary.

ozrendev avatar Jun 17 '25 07:06 ozrendev