docs: add Template Gallery + docs PR preview workflow#602
Conversation
|
One issue found — see inline comment on lines 218–219 of docs/samples/index.md: missing closing tag for .tg-body in the card() function. Browsers auto-correct it so the page renders correctly, but the HTML is malformed. Fix: change h += "</div>"; to h += "</div></div>"; |
9b56c83 to
85e8318
Compare
Review summaryOne new finding posted this run: docs/samples/index.md line 182 — ARIA role mismatch on category tabs Category tabs use role=tab inside a role=tablist but set aria-pressed instead of aria-selected. Screen readers will announce these as toggle buttons rather than tabs, breaking the expected keyboard/AT navigation pattern. The companion CSS selector on line 64 (.tg-pill[aria-pressed=true]) also needs to be updated to [aria-selected=true]. |
Add a config-driven Template Gallery page that previews every app under samples/, with category tabs, framework and tag filters, search, and a per-card clone command. Rendered natively in Material for MkDocs so it follows the docs light/dark theme. Adds a nav entry after Sample Application and an Agents.md convention to keep the gallery and preview GIFs in sync when samples change.
85e8318 to
0b320cd
Compare
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
|
New finding this run:
|
Builds the docs site on every PR touching docs/ or mkdocs.yml (build doubles as a CI gate) and publishes a per-PR preview to gh-pages/pr-preview/pr-<N>/ for same-repo PRs, removed on close. pull_request only, write-scoped deploy gated to same-repo, no untrusted interpolation, third-party action pinned to a SHA.
|
role=tab controls require aria-selected, not aria-pressed; screen readers otherwise announce them as toggle buttons. Filter pills keep aria-pressed as they are toggle buttons. CSS matches both states.
Review summaryOne new finding posted this run:
|
Use --md-code-font-family for the mono accents so they match inline code elsewhere in the docs, and set card description to 0.8rem to match docs body.
Review summaryOne new finding posted this run:
(The unresolved Node 18 thread on line 47 remains open from a prior run — no change there.) |
Node 20.x is the stated minimum (architecture.md) and what ci.yml/coverage.yml use. Node 18 could produce different docs:api output and breaks once 18 is EOL in runners.
8f86e13 to
4a30e7b
Compare
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
Review summaryOne new finding posted this run:
(The two previously-flagged unresolved threads — Node.js version and stale action version tag — remain open from prior runs.) |
The rossjrw/pr-preview-action SHA ffa7509 is release v1.8.1, not v1.6.1; fix the human-readable label (the SHA pin itself is unchanged).
Review summaryOne new finding posted this run:
(The two open threads on |
The category controls are a single-select filter over one grid, not a tab/tabpanel widget. Using role=tablist/tab took on the WAI-ARIA Tabs keyboard contract (arrow-key roving + a controlled tabpanel) that was not implemented. Switch to role=group + aria-pressed toggle buttons, consistent with the framework/tag filters, so standard button semantics and Tab navigation apply.
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
|
|
also everytime a new template added , do author need to update samples index file to add respective filter? |
The production docs deploy used `mkdocs gh-deploy --force`, which force-replaces the entire gh-pages branch and deletes the pr-preview/ umbrella dir — so every open PR's preview 404'd whenever prod redeployed. Deploy the already-built site/ via JamesIves/github-pages-deploy-action with `clean-exclude: pr-preview/` (still removes stale docs pages, but keeps previews) and `force: false` (rebase, don't clobber a concurrent preview deploy) — the approach the pr-preview-action docs recommend. Also SHA-pin checkout/setup-node/setup-python to match docs-pr-preview.yml. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two fixes from PR review of the Template Gallery: - drop the auto-generated tag filters (e.g. "modular", "oauth"): each matched only one app and read as inaccurate. Keep the category tabs, framework filter, and search (tags still feed the search box). - resolve sample assets against a single configurable `ref` (default "main") instead of hardcoding "main" in three places. An open PR's new samples aren't on main yet, so the preview 404'd their GIFs and source links. The docs PR-preview build now rewrites that one ref to the PR's head commit, where the assets exist; production keeps "main" unchanged. HEAD_SHA is passed via env and the rewrite is gated to same-repo PRs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per review, repo conventions belong in agent_docs (included by Agents.md), not authored inline in Agents.md. Move the "samples must ship a preview GIF + keep the Template Gallery in sync" convention into agent_docs/rules.md (section Documentation) and drop the inline section from Agents.md — it flows back in via the @agent_docs/rules.md include. Also updated the wording: tags are matched by search (the tag filters were removed), category drives the tabs, framework drives the filter. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
781f54c to
0540b3e
Compare
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
|
Thanks @Raina451 — the rest of your pass is addressed too:
Left the threads open for you to verify and close. |
| </div> | ||
| <div class="tg-row" id="tg-filters"> | ||
| <span class="tg-flabel">Filter</span> | ||
| <span id="tg-fw"></span> |
There was a problem hiding this comment.
#tg-tabs has role="group" so AT users get the group context when navigating into it. #tg-fw has neither — screen readers will announce "React, toggle button, not pressed" with no indication these are framework filters. The visual .tg-flabel "Filter" is a sibling span, not programmatically associated.
For consistency, add the group role directly to the tg-fw span:
| <span id="tg-fw"></span> | |
| <span id="tg-fw" role="group"></span> |
The framework filter container had no group role or accessible name, so AT users heard "React, toggle button" with no filter context. Add role="group" + aria-label, mirroring the category tabs container. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
… link Rename the "Template Gallery" nav entry (and the page title/H1) to "Sample Apps Gallery", and remove the separate "Sample Application" nav item that just linked to the samples/ folder on GitHub — the gallery already links to each sample's source, so the folder link is redundant. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c99ea4f to
b7b7400
Compare
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
1 similar comment
|
✅ No issues found. Checked for bugs and CLAUDE.md compliance. |
Now that the "Sample Application" folder link was removed from the nav, surface it in the gallery meta row instead. Href is built from the same `ref` as the cards, so previews point at the PR commit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| if (app.preview) h += '<a class="tg-badge-live" href="' + esc(BLOB_BASE + app.preview) + '" target="_blank" rel="noopener" title="View the preview GIF"><span class="blip"></span>Live preview</a>'; | ||
| h += '<div class="tg-glyph"><span class="g">' + esc(monogram(app)) + '</span><span class="s">' + esc(c.label) + "</span></div>"; | ||
| if (app.preview) h += '<img alt="' + esc(app.title) + ' preview" loading="lazy" src="' + esc(RAW_BASE + app.preview) + '" />'; | ||
| h += '<a class="tg-thumblink" href="' + esc(folder) + '" target="_blank" rel="noopener" aria-label="Open ' + esc(app.title) + ' on GitHub"></a>'; |
There was a problem hiding this comment.
The invisible overlay anchor (tg-thumblink) and the title anchor (tg-titlelink on line 238) both link to the same folder URL. This creates two focusable tab stops per card going to the same destination — keyboard users must press Tab twice, and screen readers announce both links.
The overlay's only purpose is to make the thumbnail area mouse-clickable; the title link already provides keyboard and AT access to the same page. Adding aria-hidden="true" and tabindex="-1" removes it from the tab order and AT tree while keeping it mouse-clickable for sighted users:
| h += '<a class="tg-thumblink" href="' + esc(folder) + '" target="_blank" rel="noopener" aria-label="Open ' + esc(app.title) + ' on GitHub"></a>'; | |
| h += '<a class="tg-thumblink" href="' + esc(folder) + '" target="_blank" rel="noopener" aria-hidden="true" tabindex="-1"></a>'; |
|
Thanks @Raina451 — both points from this review are now addressed:
Let me know if the naming works for you. |
|








What
Adds a Template Gallery to the documentation site, plus the CI to build and preview docs on PRs. Two commits:
docs:— the Template Gallery page + nav entry + a contributor convention.ci:— a Docs PR Preview workflow (build gate + per-PR preview).1. Template Gallery (
docs/samples/index.md,mkdocs.yml,Agents.md)A config-driven, browsable index of everything under
samples/— category tabs, framework + tag filters, search, and each sample's demo GIF. New nav entry sits after Sample Application..tgroot and mapped to Material's theme variables, so it follows the docs light/dark toggle and brand color.npx degit UiPath/uipath-typescript/samples/<path> <name>— verified for top-level and nested samples) and Open in VS Code (samedegitchained with&& code <name>).Agents.mdgains a convention: adding a sample requires a preview GIF in itsscreenshots/folder and a matching Template Gallery entry, so the site stays in sync.2. Docs PR Preview workflow (
.github/workflows/docs-pr-preview.yml)Closes a gap:
docs.ymlonly builds/deploys on a schedule + manual dispatch, so nothing validated or previewed docs on a PR.docs/**ormkdocs.yml— the build is a CI gate, so a broken docs change fails a check instead of shipping.…/pr-preview/pr-<N>/for same-repo PRs, torn down on close.pull_request(notpull_request_target); write-scoped deploy gated to same-repo PRs; no untrusted event data inrun:steps; third-party action pinned to a commit SHA.gh-pages).Preview
Isolated full-site build of this branch (temporary, personal Pages repo):
https://rajivml.github.io/uipath-typescript/samples/
🤖 Generated with Claude Code