Document upstream visibility enum + cascade for advanced/hidden flags#182
Draft
Document upstream visibility enum + cascade for advanced/hidden flags#182
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Documentation update to clarify the upstream (ESPHome) source-of-truth for the ConfigEntry.advanced and ConfigEntry.hidden flags, so future maintainers understand these values come from schema annotations rather than frontend-side heuristics.
Changes:
- Expanded
ConfigEntry.advancedJSDoc to point to ESPHome’scv.Optional(..., advanced=True)annotation as the authoritative source. - Expanded
ConfigEntry.hiddenJSDoc to point to ESPHome’scv.Optional(..., yaml_only=True)annotation and explain the intended UX behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
16 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Multi-line backticked spans render poorly in TS-tooling hovers (VS Code in particular). Shorten the references to bare `Visibility.ADVANCED` / `Visibility.YAML_ONLY` so each inline- code span sits on a single line.
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?
Documentation pass on the
ConfigEntry.advanced/ConfigEntry.hiddenTypeScript types, calling out that theauthoritative source for those flags will be upstream esphome's
new
cv.Optional(..., visibility=cv.Visibility.ADVANCED)/cv.Optional(..., visibility=cv.Visibility.YAML_ONLY)schemakwarg (esphome/esphome#16267) — not the hand-curated heuristic
in the catalog generator. Also notes the cascade pass added to
the catalog generator (esphome/device-builder#350): a stricter
parent forces every descendant at-least as strict, so a child's
hidden=truemay have arrived from an ancestor'sYAML_ONLYrather than from the field's own schema marker.
No runtime change. The frontend already filters
entry.hiddencorrectly (
isEntryVisibleinsrc/util/config-validation.ts)and renders
entry.advancedunder the disclosure(
config-entry-render-filter.ts). The catalog generator'scompanion PR is what wires the new schema kwarg + cascade onto
those existing fields.
This PR exists so the frontend type docstrings explicitly point
future maintainers at the upstream source. As upstream adoption
of the new kwarg grows, the catalog's heuristic fallback will
shrink — but readers of the frontend code shouldn't have to
trace through the catalog generator to figure out where
entry.advancedwas decided.Types of changes
Related issue or feature (if applicable):
Consume schema-author visibility hints + cascade strictness through nested groups device-builder#350 (catalog generator + cascade).
Checklist:
npm run lintpasses.npm run testpasses (699/699).