Skip to content

Document upstream visibility enum + cascade for advanced/hidden flags#182

Draft
bdraco wants to merge 4 commits intomainfrom
docs/upstream-ui-hint-flags
Draft

Document upstream visibility enum + cascade for advanced/hidden flags#182
bdraco wants to merge 4 commits intomainfrom
docs/upstream-ui-hint-flags

Conversation

@bdraco
Copy link
Copy Markdown
Member

@bdraco bdraco commented May 6, 2026

What does this implement/fix?

Documentation pass on the ConfigEntry.advanced /
ConfigEntry.hidden TypeScript types, calling out that the
authoritative source for those flags will be upstream esphome's
new cv.Optional(..., visibility=cv.Visibility.ADVANCED) /
cv.Optional(..., visibility=cv.Visibility.YAML_ONLY) schema
kwarg (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=true may have arrived from an ancestor's YAML_ONLY
rather than from the field's own schema marker.

No runtime change. The frontend already filters entry.hidden
correctly (isEntryVisible in src/util/config-validation.ts)
and renders entry.advanced under the disclosure
(config-entry-render-filter.ts). The catalog generator's
companion 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.advanced was decided.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code quality improvements to existing code or addition of tests
  • Other

Related issue or feature (if applicable):

Checklist:

  • The code change is tested and works locally.
  • npm run lint passes.
  • npm run test passes (699/699).
  • Tests have been added to verify that the new code works (where applicable).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.advanced JSDoc to point to ESPHome’s cv.Optional(..., advanced=True) annotation as the authoritative source.
  • Expanded ConfigEntry.hidden JSDoc to point to ESPHome’s cv.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.

Comment thread src/api/types.ts Outdated
Comment thread src/api/types.ts Outdated
Comment thread src/api/types.ts Outdated
@bdraco bdraco changed the title Document upstream esphome source for advanced/hidden flags Document upstream visibility enum + cascade for advanced/hidden flags May 6, 2026
@bdraco bdraco requested a review from Copilot May 6, 2026 03:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread src/api/types.ts Outdated
Comment thread src/api/types.ts Outdated
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants