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

make swipe exceptions user-configurable #2

Open
zanna-37 opened this issue Jun 11, 2022 · 4 comments
Open

make swipe exceptions user-configurable #2

zanna-37 opened this issue Jun 11, 2022 · 4 comments
Labels
💡 discussion A discussion on this would be beneficial ✨ feature New feature or request

Comments

@zanna-37
Copy link
Owner

zanna-37 commented Jun 11, 2022

Enhancements

Provide a way to bypass the default hard-coded exceptions

This could be easily done with a flag use_default_exceptions which defaults to true.

swipe_nav:
  use_default_exceptions: false

This flag would be quite useless alone, therefore the user should be able to add custom exceptions.

Provide a way for the user to add exceptions via CSS selectors

swipe_nav:
  custom_exceptions:
    - div.class1.class2
    - special-tag
    - g.my-special-class

Drawbacks

In this implementation, when setting use_default_exceptions to false the user needs to manually copy the hard-coded exception list and put them as custom_exceptions. And although it is suboptimal, it is not that uncommon. Home Assistant default configuration works in the same way.
I think that creating a system of inclusions/exclusions would only complicate things with little gain since I suspect that use_default_exceptions would only be used in rare circumstances.


See also:

@zanna-37 zanna-37 added ✨ feature New feature or request 💡 discussion A discussion on this would be beneficial labels Jun 11, 2022
@zanna-37
Copy link
Owner Author

I think that this should be implemented only when the swipe exception format is considered stable, to avoid breaking-changes down the road.
If you are interested, upvote the first post with a 👍.

@usernein
Copy link
Contributor

Ahhh i need it so much! What about using css selectors for the custom exceptions?

@zanna-37
Copy link
Owner Author

css selectors are an interesting suggestion. They could replace the current method so we don't have to reinvent the wheel. 🤔

@zanna-37
Copy link
Owner Author

CSS selectors are now implemented in v1.5.0, but before enabling user-defined exceptions I would like to gather more opinions and I would like to wait until the exception format is stable, to avoid breaking-changes in the future.

In the meantime, feel free to propose pull requests with other exceptions, so everyone can benefit from them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 discussion A discussion on this would be beneficial ✨ feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants