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

feat: preferred stream settings #1060

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

antoniosarro
Copy link

Save stream settings for reuse (resolution, FPS, content type). Audio source is excluded due to per-stream variability.

@Vendicated
Copy link
Member

please show a screenshot

<div className="vcd-screen-picker-save-control">
<div
className={`vcd-screen-picker-save-checkbox ${Settings.stream?.preferred && "checked"}`}
onClick={() => {
Copy link
Member

Choose a reason for hiding this comment

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

this markup is very messy and not semantic (using a plain div as a checkbox is very bad. at the very least it should have aria attributes like role that tell user agents that this is a checkbox for visually impaired people and other users of screenreaders). have a look at the rest of Vesktop (& Vencord) Settings UI and see how those implement things like Switches, Checkboxes. Vencord exports a bunch of Discord Components you can use instead of implementing stuff yourself

@antoniosarro
Copy link
Author

image

I initially attempted to use the existing Switch component, but it appeared inconsistent with the current UI due to its hardcoded colors. I'm open to using it if it's the preferred solution. In that case, I can refine the markup based on your suggestions.

@Vendicated
Copy link
Member

Vendicated commented Jan 24, 2025

I see, that's fair yeah! Switch is likely not the right Component, but Discord also has a Checkbox component that should be exactly what you want

image

Vencord doesn't export it for some reason, but you can manually find it via const Checkbox = findExportedComponentLazy("Checkbox", "Switch");. Search (Ctrl + Shift + F) for .Checkbox in sources in chrome devtools to find how Discord uses it & which arguments you can pass

image

@antoniosarro
Copy link
Author

I updated the component using the Checkbox component.

Regarding preferred settings for audio, currently, only the "Entire System" option can be saved. However, I believe it's best to exclude audio settings altogether.

image

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.

2 participants