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(ui): display entity hint on mouse hover #1962

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

Conversation

grafalex82
Copy link

Some devices may expose quite a lot of items. If these items are supplied with a description, the interface may get cluttered. If the description has certain amount of text describing values of the field, the interface gets too busy.

The idea of the proposed change is to have a hint field in addition to the description field in the device definition. The description may be used for a short 1-line description of the entity, while the hint may include big amount of text describing entity values or more detailed description of the setting. The hint text is not visible by default, but is shown in a hint/bubble when mouse is over the element.

image

This is a UI part of the change, it comes with this change in the herdsman converters, adding support for Hint field. Here is the usage:

    const relay_mode_description = "Mode of the internal relay switch";
    const relay_mode_hint = `The mode of the internal relay switch:
	unlinked - relay decoupled, button triggers only logical actions.
	front - relay toggles on initial press for immediate response.
	single - relay toggles on one press, generates 'single' action.
	double - relay toggles on two presses, generates 'double' action.
	triple - relay toggles on three presses, generates 'triple' action.
	long - relay toggles on press-and-hold, generates 'hold' action, and 'release' action upon button release`;
    sw.withFeature(e.enum('relay_mode', ea.ALL, relayModeValues)
        .withDescription(relay_mode_description)
        .withHint(relay_mode_hint));

@nurikk
Copy link
Owner

nurikk commented Mar 24, 2024

I don't like this approach, using hover will even more reduce ux for mobile users. We should trim this text instead of adding yet another hint, this will also require a lot of work on translation side

@grafalex82
Copy link
Author

On mobile devices hint may be shown by clicking on the parameter name or description.

If you trim the text it may look ugly - pretty much every parameter description will be trimmed in the middle of the sentence. Moreover you will still have to provide the user a way to un-trim the text by clicking on the text, and expanding the parameter box.

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.

None yet

2 participants