Skip to content

Built-in UI: expandable operations (v0.6.7)#97

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

Built-in UI: expandable operations (v0.6.7)#97
FumingPower3925 merged 2 commits into
mainfrom
release/v0.6.7

Conversation

@FumingPower3925

Copy link
Copy Markdown
Owner

Closes #96.

Clicking an operation on the built-in docs page now expands a panel with its description, parameters (name · in · type · required), and a generated JSON example of the request body and each response — $refs resolved, recursion-capped.

Stays in character

  • Generated examples, not a full schema table (that's what the rich UIs are for).
  • Dependency-free, default collapsed, still a flat skim-first list.
  • Under the same strict CSP: no inline styles, the chevron is a cloned inline <svg> template, every value renders via textContent, and the inline script/style hashes in defaultDocsCSP are re-pinned.
  • Keyboard-accessible (Tab + Enter/Space); panels build lazily on first open.

Validation

  • TestDefaultDocsCSP (hash parity) + TestDefaultUINotice (extended to guard the chevron template / op clickable / buildDetail).
  • ui-smoke browser tests: TestUISmoke/builtin (renders under CSP), TestDefaultUINoticeDismiss (dismiss + localStorage), and the new TestDefaultUIExpand (clicks an op, asserts the JSON example panel appears).
  • Full suite, -race, go vet, gofmt, golangci-lint (0 issues with and without the uismoke tag). Reviewed live on a complex server before publishing.

Cuts v0.6.7.

The built-in page was a flat list — fine to skim, but you could not see
what an operation takes or returns without opening the raw spec. Each
operation is now clickable: it drops down its description, parameters
(name, location, type, required), and a generated JSON example of the
request body and each response. Examples are built from the schemas with
their $refs resolved and recursion capped, so a self-referential type
cannot loop.

It stays in character: generated examples rather than a full schema
table (that is what the rich UIs are for), dependency-free, default
collapsed, still a skim-first list. And it stays under the page's strict
CSP — no inline styles, the chevron is a cloned inline <svg> template,
every value renders through textContent, and the inline script/style
hashes are re-pinned. A structural test guards the new markup and a
ui-smoke browser test clicks an operation and checks the JSON example
panel appears.
@FumingPower3925 FumingPower3925 merged commit 5415cb6 into main Jun 14, 2026
38 checks passed
@FumingPower3925 FumingPower3925 deleted the release/v0.6.7 branch June 14, 2026 15:55
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.

Built-in UI: expand operations to show request/response detail

1 participant