Skip to content

Setup page: copy buttons on every command, path and URL, one block per level, skeletons as download buttons (#141) - #150

Merged
Arthurvdv merged 4 commits into
mainfrom
wp16/setup-buttons
Oct 28, 2026
Merged

Arthurvdv merged 4 commits into
mainfrom
wp16/setup-buttons

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

Closes #141. Part of WP16 #136.

What

  • setup/ renders the two commands of the init script and the al.ruleSetPath / rulesetFile lines once per level, in a <details> per level (the first open; no level picker, decided 2026-10-28). The page stays complete without JavaScript; the anchors #al-project, #levels and #stage-<slug> stay.
  • Every command, path and URL has a copy button with an aria-label that names what it copies: one button for both init commands (data-copy-target="#init-<slug>"), one per settings line, the rulebook.json URL and every endpoint URL (data-copy). Every skeleton is a download button (a.button.download[download]) in the endpoint row; the endpoint tables scroll inside .table-wrap.
  • js/shell.js shows and binds the buttons: the Clipboard API in a secure context, a textarea + execCommand('copy') fallback, "Copied" on the button and in the one live region p.copy-status.sr-only[aria-live=polite], reset after two seconds; a missing target reports a failure. Without JavaScript the buttons stay hidden and the text stays selectable; they are not printed. No new asset: the published paths and the asset lists are unchanged.
  • Docs: template/docs/al-project.md, template/docs/dashboard.md section 1, docs/dashboard.md (the setup page row, the copy hook in the shell part), RELEASENOTES.md.

Deviations from the issue

  • No level picker: one block per level instead, so without JavaScript the page shows the per-level blocks rather than one example; the level list folds into the block summaries.
  • The copy function lives in shell.js, not a separate copy.js; the live region sits in the setup layout and is visually hidden (the button shows "Copied").
  • Screenshots and details: WP16: copy and download buttons on the setup page #141 (comment)

Verification

  • Pester: Rulebook.Site 55 (real-Hugo build included, new assertions on the copy buttons and their labels, the per-level blocks, the download links, the table wrapper and the live region), Rulebook.Deploy 76, Publish.Action 52, Rulebook.Template 77, Docs 340; all green.
  • node --test tests/site/: 35 passed.
  • Playwright (throwaway, local build): 32 + 12 checks green. Clipboard contents per button, "Copied" and its reset, a repeated announcement, the textarea fallback, a missing target, 12 downloads under their skeleton names, accessible names, table semantics and unclipped focus rings, no buttons without JavaScript or in print, no horizontal scroll at 390 px, both colour schemes, no request off 127.0.0.1, no page error.

Review

Sonnet code-review round 1: no must-fix; five should-fix items and the nits applied in 601ffe7.

🤖 Generated with Claude Code

Arthurvdv and others added 4 commits October 28, 2026 22:37
…as download buttons (#141)

The init commands and the al.ruleSetPath and rulesetFile lines are rendered once per level in a details element,
the first open; every command, path and URL gets a copy button (data-copy or data-copy-target) that shell.js shows
and binds: the Clipboard API with a textarea fallback, "Copied" on the button and in the one live region
p.copy-status, reset after two seconds. Without JavaScript the buttons stay hidden and the text stays selectable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d links and the live region on the real build (#141)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…etup page, the copy hook of the shell (#141)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, the fallback selection range, a repeated announcement, room for "Copy failed", no copy buttons in print (#141)

A missing data-copy-target reports a failure instead of copying an empty string; the label is restored from
dataset.label; the live region reuses .sr-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WP16: copy and download buttons on the setup page

1 participant