Skip to content

feat: compact (reading) view for TestMeta block#68

Merged
littlefrontender merged 2 commits into
feat/block-test-metafrom
feat/testmeta-compact
Jun 4, 2026
Merged

feat: compact (reading) view for TestMeta block#68
littlefrontender merged 2 commits into
feat/block-test-metafrom
feat/testmeta-compact

Conversation

@DavertMik

@DavertMik DavertMik commented Jun 3, 2026

Copy link
Copy Markdown
Contributor
image image

Summary

Adds a compact / reading view to the TestMeta (test/suite metadata) block. By default the block now renders its data as a single truncated one-liner with an expand/collapse chevron pinned to the far right; expanding reveals the full editable key/value rows.

Before: the block always showed every field as a stacked editable row.
After: TEST @T12345678 priority: high · type: regression · tags: smoke, login · … [⌄] — click the chevron (or the summary) to expand into the full editable rows + add-field button.

Behaviour

  • Collapsed is the default for populated blocks; a block with no readable fields starts expanded so it's immediately editable.
  • The summary line ellipsizes when it overflows the header width (title attribute shows the full text on hover).
  • expanded is UI-only local state — the markdown serialization is untouched, so round-tripping <!-- test … --> comments is unchanged.

Testing

  • tsc -b clean; all 166 unit tests pass (incl. the TestMeta serializer tests).
  • Verified in a real browser (headless Chrome via CDP): seeded a populated block via markdown paste → defaults to a truncated one-liner with the chevron on the right; expanding shows all 5 rows + add button; collapsing returns to the summary; markdown preview round-trips identically; no console exceptions.

Note

Based on feat/block-test-meta (where the TestMeta block lives — it isn't on master yet), so this PR contains only the compact-mode diff. Retarget to master if you'd rather land the block + compact view together.

🤖 Generated with Claude Code

Render the test/suite metadata block as a single truncated one-liner by
default (e.g. `priority: high · tags: smoke, login`), with an expand/collapse
chevron pinned to the far right. Expanding reveals the full editable key/value
rows and the add-field button; collapsing returns to the summary line.

- A block with no readable fields starts expanded so it is immediately editable.
- Clicking the one-liner (or the chevron) expands it; the summary ellipsizes
  when it overflows the header.
- `expanded` is UI-only local state — the markdown serialization is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 3, 2026

Copy link
Copy Markdown

Deploying blocks with  Cloudflare Pages  Cloudflare Pages

Latest commit: afc8881
Status: ✅  Deploy successful!
Preview URL: https://cd80b9f8.blocks-cno.pages.dev
Branch Preview URL: https://feat-testmeta-compact.blocks-cno.pages.dev

View logs

The collapsed one-liner now lists only fields that have a value; keys with
empty values are an editing-only concern and are shown only in the expanded
rows. A block with no valued fields starts expanded so the summary is never
misleadingly empty.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@littlefrontender littlefrontender merged commit 58c9489 into feat/block-test-meta Jun 4, 2026
3 checks passed
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.

2 participants