Wave 9 #118: Phase 1 catalog UI — state chip primitive + Connect button helper - #100
Open
bernardc6 wants to merge 1 commit into
Open
Wave 9 #118: Phase 1 catalog UI — state chip primitive + Connect button helper#100bernardc6 wants to merge 1 commit into
bernardc6 wants to merge 1 commit into
Conversation
Foundation for the static HTML connection catalog UI. Adds: - 10 standard connection-state CSS chip classes - Pure Python helper emitting state chip + tier chip + Connect button HTML - Pytest tests for the helper - Smoke check wired into check.sh - IKEA-style reference doc - Visible demo on Starlink doc page Changes: - ADD scripts/connection_card.py (~339 LOC pure helper: STANDARD_STATES tuple, format_state_chip, format_tier_chip, format_connect_button, format_connection_card; HTML escaping + kebab-slug validation; CLI --smoke for ad-hoc checks) - ADD homeassistant/packages/tests/test_connection_card.py (~370 LOC pytest: 36 tests covering all 10 states, tier vocabulary back-compat, Connect button href + label overrides, composition, CSS class existence; mirrors sister test_connection_state.py comment + sys.path import pattern) - ADD scripts/checks/catalog-state-chip-smoke.sh (~137 LOC smoke: 3 checks — kebab CSS classes in rc.css, pytest exit 0, every connection.yml state maps to a chip class) - ADD docs/reference/rc-connection-state-chip.md (~107 lines IKEA-style 5-step reference: state table, copy-pastable snippets, colour legend, tier pill link back to #117) - APPEND .rc-state-chip + .rc-state-chip.<kebab> + .rc-state-chip-reason + .rc-connect-button + .rc-state-chip-row classes to docs/styles/rc.css (~200 lines, append only — no edits to existing classes); colour palette per spec (green=good / yellow=needs-you / orange=attention / teal=you-can-do-this / red=offline / gray=unsupported / purple=update) - ADD 1 run_if_present line to scripts/check.sh (after Wave 9 connection-manifest block, before full-suite block — Wave 9 #117 hasn't landed on main yet but the insertion point chains naturally when both PRs merge) - ADD inline state chip + tier chip + Connect button to docs/catalog/connectivity/starlink.md (visible demo: <div class="rc-state-chip-row"> with ready-to-connect chip + verified pill + Connect link) - ADD 1 nav line to mkdocs.yml (Connection state chip under Technical (advanced)) Verification: - bash scripts/check.sh --core-only -> GREEN (exit 0); 36/36 pytest tests pass; all 10 standard-state kebab CSS classes present in rc.css; every connection.yml state maps to a chip class; all sister connection-manifest smokes pass - python3 -m pytest homeassistant/packages/tests/test_connection_card.py -v -> 36 passed in 0.08s (zero failures) - bash scripts/checks/catalog-state-chip-smoke.sh -> PASS - Starlink doc page renders the chip + tier + Connect button inline at the top Rollback: - git revert <this-sha>; clean revert; no schema/state migrations. - No external state touched. No backup needed.
| "verified": "Community Verified", | ||
| "experimental": "Experimental", | ||
| } | ||
| _VALID_TIER_INPUTS: frozenset[str] = frozenset( |
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.
Summary
Wave 9 #118 — Phase 1 catalog UI foundation. Adds the 10 standard connection-state CSS chip classes, a pure Python helper that emits state chip + tier chip + Connect button HTML, pytest coverage, smoke check wired into
scripts/check.sh --core-only, an IKEA-style 5-step reference doc, and a visible demo on the Starlink page.What's in
scripts/connection_card.py(~339 LOC) — pure helper. Exports:STANDARD_STATES— tuple of the 10 literal state strings (matches directive exactly)format_state_chip(state, state_reason=None)— emits<span class="rc-state-chip <kebab>">…</span>+ optional<span class="rc-state-chip-reason">…</span>subtitleformat_tier_chip(tier)— accepts both legacya|b|cletters AND full-wordcertified|verified|experimentalvocabulary (back-compat with sister catalog pages that still emitdata-tier="a|b|c")format_connect_button(slug, label=None)— emits<a class="rc-connect-button" href="/connections/{slug}/connect">…</a>; label override ("Connect" / "Set up" / "Reconnect" / "Update" / "Learn more") matches per-state CTAformat_connection_card(slug, name, tier, state, state_reason=None)— composes all three into a single<div class="rc-state-chip-row">…</div>block--smokeCLI for ad-hoc checkshomeassistant/packages/tests/test_connection_card.py(~370 LOC) — 36 pytest tests:format_state_chipraises plain-English ValueError for unknown states + blankstate_reasonformat_tier_chipaccepts both vocabularies (case-insensitive, whitespace-tolerant)format_connect_buttonhref + label overrides + slug validationformat_connection_cardcomposes all three primitives.rc-state-chip.<kebab>× 10 +.rc-state-chip-reason+.rc-connect-button) exist indocs/styles/rc.csstest_connection_state.pyscripts/checks/catalog-state-chip-smoke.sh(~137 LOC) — 3 checks:docs/styles/rc.csspython3 -m pytest homeassistant/packages/tests/test_connection_card.py -vexits 0connections/*/connection.ymlstate:value maps to a chip CSS class (drift guard)docs/reference/rc-connection-state-chip.md(~107 lines) — IKEA-style 5-step reference:docs/styles/rc.css(+200 lines, APPEND only) — new chip CSS section:.rc-state-chipbase (999px radius, 12px font-weight 900, 3px 10px padding).availableneutral gray /.detectedlight teal /.ready-to-connectteal accent /.connectinganimated pulse /.connectedgreen accent /.needs-informationyellow /.needs-attentionorange /.unsupportedgray + diagonal stripe /.offlinered /.update-availablepurple.rc-state-chip-reasonsubtitle (11px, opacity 0.7).rc-connect-buttonsolid teal (8px radius, 6px 14px padding, no gradient — distinct from existing.rc-cta).rc-state-chip-rowinline-flex wrapper for the catalog rowscripts/check.sh(+8 lines) — one newrun_if_presententry for the smoke check (placed after the Wave 9 connection-manifest block; chains naturally when both Wave 9 #123.c.ii: Phase 7 Security Review — tier-a manifest + services + data-layer + pytest + smoke + IKEA runbook #117 and Wave 9 #122.d.iv — Phase 6 Tailscale wizard: mDNS roamcore.local fallback (Gate E 'local survives Tailscale failure') #118 PRs land)docs/catalog/connectivity/starlink.md(+7 lines) — visible demo at the top: state chip ("Ready to connect") + tier pill ("Community Verified") + Connect buttonmkdocs.yml(+1 line) —Connection state chip: reference/rc-connection-state-chip.mdunder Technical (advanced)Verification
bash scripts/check.sh --core-only→ GREEN (exit 0)python3 -m pytest homeassistant/packages/tests/test_connection_card.py -v→ 36 passed in 0.08s (zero failures)bash scripts/checks/catalog-state-chip-smoke.sh→ PASS.rc-state-<kebab-case>CSS classes present inrc.cssconnections/*/connection.ymlstate:value maps to a chip CSS classOut of scope (per slice spec)
docs/catalog/index.md(PR Wave 9 #124: Docs cleanup + app-store landing #87 owns that file)connections/*/connection.ymlfiles (this slice is purely additive UI)homeassistant/files outside the new test file (no edits to packages yaml, custom_components, etc.)Rollback
git revert <this-sha>. Clean revert; no schema or state migrations. No external state touched; no backup needed.🤖 Generated with OpenClaw subagent (Wave 9 #118)