Document the visibility schema kwarg + cascade rule for visual editors#141
Draft
Document the visibility schema kwarg + cascade rule for visual editors#141
Conversation
Pairs with esphome/esphome#16267 which adds the kwargs to cv.Optional / cv.Required. Adds a new subsection under 'Configuration Schema' explaining the semantics, when to use each flag, and the helper-kwarg pattern for shared schemas like polling_component_schema.
✅ Deploy Preview for esphome-dev-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
19 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Documents the new schema-driven UI hint mechanism (cv.Visibility and the visibility= kwarg on cv.Optional/cv.Required) for downstream visual editors, including how consumers should compute effective visibility via cascading.
Changes:
- Added a new “Schema-driven UI hints (
visibility)" subsection under the public Python API / Configuration Schema docs. - Documented the three visibility levels, intended usage guidance, and strictness ordering.
- Documented the consumer-side cascading rule and coordination considerations when changing visibility on existing fields.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…at least' as adverbial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this implement/fix?
Documents the new
cv.VisibilityStrEnumandvisibility=kwarg on
cv.Optional/cv.Requiredintroduced inesphome/esphome#16267.
The kwarg is a UI hint consumed by schema-driven editors (the
device-builder dashboard catalog, third-party tools); it doesn't
affect YAML validation. This PR adds a
#### Schema-driven UI hints (visibility)subsection under the existing "ConfigurationSchema" / public-Python-API section in
docs/contributing/code.mdcovering:ADVANCED/YAML_ONLY) and whento reach for each.
YAML_ONLY>ADVANCEDsetup_priority→Visibility.YAML_ONLY, time-platformupdate_interval→Visibility.ADVANCED).cv.Optionalinside a function call (e.g.
polling_component_schema's newvisibility=parameter).##### Cascadingsubsection explaining the consumer-siderule: a stricter parent forces every descendant at-least as
strict. The schema marker stays per-field as the author wrote
it; the cascade is computed by consumers when they walk the
tree.
visibilityisn't a YAML-side breakingchange but does need coordination with catalog consumers when
flipping a previously-shown field to
Visibility.YAML_ONLY.Related issue or feature (if applicable):