Skip to content

Polish the built-in docs UI (v0.6.6)#95

Merged
FumingPower3925 merged 2 commits into
mainfrom
release/v0.6.6
Jun 14, 2026
Merged

Polish the built-in docs UI (v0.6.6)#95
FumingPower3925 merged 2 commits into
mainfrom
release/v0.6.6

Conversation

@FumingPower3925

Copy link
Copy Markdown
Owner

Closes #94.

A light polish of the minimal built-in docs page — still tiny, flat, dependency-free, no CDN, under the same strict CSP.

What changed

  • Coloured method badges (GET/POST/PUT/PATCH/DELETE), with a neutral badge for custom methods (PURGE, LOCK, …) — the built-in UI is still the only one that renders custom methods.
  • A padlock on operations that require auth — a custom inline <svg> cloned from a <template> (no emoji, no innerHTML).
  • Deprecated operations dimmed and flagged.
  • Header now shows the API version, description, and links to openapi.json / openapi.yaml.
  • Path grouping kept (your call); monospace path headings; subtle row hover.

CSP / safety

  • No inline style="" attributes (the policy has no unsafe-inline); the notice and template hide via the hidden attribute.
  • The inline script/style sha256 hashes in defaultDocsCSP are re-pinned (the parity test recomputes them from the served page).

Validation

  • TestDefaultUINotice extended to guard the new markup (lock template, spec links).
  • TestDefaultDocsCSP (hash parity) + TestUISmoke/builtin (renders under the enforced CSP in real headless Chrome) + TestDefaultUINoticeDismiss (dismiss + localStorage) all pass.
  • Full suite, go vet, gofmt, golangci-lint (0 issues with and without the uismoke tag).

Cuts v0.6.6.

The built-in page stays minimal, flat and dependency-free, but is no
longer quite so bare: operations carry coloured method badges (custom
methods included), a padlock marks the ones that require auth, deprecated
operations are dimmed and flagged, and the header shows the API version,
description, and links to the JSON and YAML spec. Grouping stays by path.

It remains under the page's strict CSP: no inline style attributes, the
padlock is a static inline SVG cloned from a <template> rather than an
emoji or an injected string, and the inline script/style hashes are
re-pinned. A structural test guards the new markup and the ui-smoke
browser test still renders it under the enforced policy.
@FumingPower3925 FumingPower3925 merged commit dba3f22 into main Jun 14, 2026
38 checks passed
@FumingPower3925 FumingPower3925 deleted the release/v0.6.6 branch June 14, 2026 14:11
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.

Polish the built-in docs UI (badges, auth padlock, deprecated markers, header)

1 participant