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

Add option to view one attribute in the sidebar #1254

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Masaneth
Copy link

@Masaneth Masaneth commented Jul 3, 2024

Add option to view speed of the device in the sidebar

With the option to activate it or not to each user's taste.

image

image

@tananaev
Copy link
Member

tananaev commented Jul 3, 2024

I don't think it makes sense to have a dedicated checkbox just for the speed. We should probably support any position attribute.

@Masaneth Masaneth changed the title Add option to view speed in the sidebar Add option to view one attribute in the sidebar Jul 4, 2024
@Masaneth
Copy link
Author

Masaneth commented Jul 4, 2024

I had not thought about the possibility to see any attribute, it is better more customizable, it is implemented in the second commit.

Now you can choose which attribute to display or not display any

image

image

src/resources/l10n/es.json Outdated Show resolved Hide resolved
src/settings/PreferencesPage.jsx Outdated Show resolved Hide resolved
label={t('deviceShowAttribute')}
value={attributes.deviceShowAttribute || ''}
onChange={(e) => {
setAttributes({ ...attributes, deviceShowAttribute: e.target.value });
Copy link
Member

Choose a reason for hiding this comment

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

Is there an easy way to clear this attribute when empty value is selected?

Copy link
Author

Choose a reason for hiding this comment

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

In the existing code of the page, attributes are normally not removed when they are set with empty values; they are kept with an empty string or a default value. To maintain consistency, I manage empty values in a similar way:

Copy link
Member

Choose a reason for hiding this comment

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

OK, I think it's ok to keep as is. It's a bit different though because most of the other attributes are basically expected to have something. This one is basically optional.

src/main/DeviceRow.jsx Outdated Show resolved Hide resolved
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