docs(demo): add "what it is / when to use" captions to demo section groups - #630
Conversation
…roups 62 of 122 narrative <h3> groups in demo/index.html lacked a one-line description saying what the group demonstrates and when to reach for it. Add a muted caption paragraph under each group that was missing one (65 groups), matching the existing caption style already used by the layout sections. Wording is grounded in the per-entry descriptions from docs/api-index.json. Two <h3>s that are demo content rather than group headings (the "h3 — The quick brown fox" type specimen and the "Lists Are Restored" heading inside the .sf-prose sample) are intentionally left untouched. No token/class coverage change; coverage.test.js and the demo-visual e2e suite stay green.
|
Warning Review limit reached
Next review available in: 25 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR adds one-line descriptive captions under 65
Confidence Score: 3/5Two of the new caption paragraphs contain raw, unescaped HTML element names that the browser will interpret as actual tags rather than display as text, producing broken markup in the rendered demo. The demo/index.html — specifically the "Link States" caption (line 1152) and the "HR & Separator" caption (line 2591). Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[demo/index.html h3 group heading] --> B{Had caption already?}
B -- Yes --> C[Left untouched]
B -- No --> D[New muted caption paragraph added]
D --> E{Caption text contains raw HTML tag?}
E -- No: 63 captions --> F[Renders correctly]
E -- Yes: 2 captions --> G[Unescaped tag in text]
G --> H[lt-a-gt wraps tail text in phantom anchor]
G --> I[lt-hr-gt breaks paragraph, orphans tail text]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[demo/index.html h3 group heading] --> B{Had caption already?}
B -- Yes --> C[Left untouched]
B -- No --> D[New muted caption paragraph added]
D --> E{Caption text contains raw HTML tag?}
E -- No: 63 captions --> F[Renders correctly]
E -- Yes: 2 captions --> G[Unescaped tag in text]
G --> H[lt-a-gt wraps tail text in phantom anchor]
G --> I[lt-hr-gt breaks paragraph, orphans tail text]
Reviews (1): Last reviewed commit: "docs(demo): add "what it is / when to us..." | Re-trigger Greptile |
| </ul> | ||
|
|
||
| <h3>HR & Separator</h3> | ||
| <p style="font-size: var(--sf-text-s); color: var(--sf-color-text--muted); margin-block-end: var(--sf-space-m)">The default <hr> — a themed divider using border-color tokens; spacing follows the surrounding rhythm.</p> |
There was a problem hiding this comment.
Unescaped
<hr> in paragraph text will break the DOM. Because <p> cannot contain a block-level element, the browser implicitly closes the <p> before rendering the <hr>, so the text "— a themed divider…" is orphaned outside any paragraph. Line 2593 directly below already shows the correct pattern: <code><hr></code>.
| <p style="font-size: var(--sf-text-s); color: var(--sf-color-text--muted); margin-block-end: var(--sf-space-m)">The default <hr> — a themed divider using border-color tokens; spacing follows the surrounding rhythm.</p> | |
| <p style="font-size: var(--sf-text-s); color: var(--sf-color-text--muted); margin-block-end: var(--sf-space-m)">The default <code><hr></code> — a themed divider using border-color tokens; spacing follows the surrounding rhythm.</p> |
| </blockquote> | ||
|
|
||
| <h3>Link States</h3> | ||
| <p style="font-size: var(--sf-text-s); color: var(--sf-color-text--muted); margin-block-end: var(--sf-space-m)">Default, hover, visited and active link colors on bare <a> — a consistent affordance with no utility class.</p> |
There was a problem hiding this comment.
The unescaped
<a> here creates a real (invisible) anchor element, causing everything after it — "— a consistent affordance with no utility class." — to be wrapped inside an implicit <a> tag with no href. The intent is clearly to reference the HTML element name as text, so it should use escaped entities or a <code> tag, consistent with the rest of the file.
| <p style="font-size: var(--sf-text-s); color: var(--sf-color-text--muted); margin-block-end: var(--sf-space-m)">Default, hover, visited and active link colors on bare <a> — a consistent affordance with no utility class.</p> | |
| <p style="font-size: var(--sf-text-s); color: var(--sf-color-text--muted); margin-block-end: var(--sf-space-m)">Default, hover, visited and active link colors on bare <code><a></code> — a consistent affordance with no utility class.</p> |
Two of the new captions wrote HTML element names as raw tags in text: "bare <a>" (Link States) and "default <hr>" (HR & Separator). Because <p> cannot contain a block-level <hr>, the browser closed the paragraph early and orphaned the trailing text; the raw <a> wrapped the rest of the sentence in an empty anchor. Escape both to <code><a></code> / <code><hr></code>, matching the convention already used elsewhere in the file. Flagged by Greptile review on PR #630.
62 of 122 narrative
groups in demo/index.html lacked a one-line
description saying what the group demonstrates and when to reach for it.
Add a muted caption paragraph under each group that was missing one (65
groups), matching the existing caption style already used by the layout
sections. Wording is grounded in the per-entry descriptions from
docs/api-index.json.
Two
s that are demo content rather than group headings (the "h3 — The
quick brown fox" type specimen and the "Lists Are Restored" heading inside
the .sf-prose sample) are intentionally left untouched.
No token/class coverage change; coverage.test.js and the demo-visual e2e
suite stay green.