Skip to content

fix: default suite meta blocks to compact (reading) view#70

Merged
DavertMik merged 1 commit into
masterfrom
feat/testmeta-suite-compact
Jun 13, 2026
Merged

fix: default suite meta blocks to compact (reading) view#70
DavertMik merged 1 commit into
masterfrom
feat/testmeta-suite-compact

Conversation

@DavertMik

Copy link
Copy Markdown
Contributor

Problem

Test meta blocks render compact, but suite blocks stay expanded (see screenshot below). The compact view defaulted to expanded whenever the summary line was empty:

const [expanded, setExpanded] = useState(() => summaryText.length === 0);

summaryText is built only from fields that have a value. Suite blocks commonly carry a seeded field with no value yet (e.g. emoji:), so their summary is empty and they always rendered expanded — while test blocks (populated type / priority / creator) collapsed.

Fix

Base the collapsed-by-default decision on whether the block has any fields, not on whether it has a non-empty summary:

const [expanded, setExpanded] = useState(() => fields.length === 0);
  • Any block carrying fields starts compact — suites included, even when the fields have no value yet.
  • A genuinely empty block (no fields at all) still starts expanded so it's immediately editable.
  • No change to the summary contents, the chevron toggle, or markdown serialization (expanded remains UI-only state).

Testing

  • tsc -b — clean
  • npm run test:run175 passed
  • npm run build:package — succeeds

🤖 Generated with Claude Code

…elds

The compact view started expanded whenever the summary was empty
(summaryText.length === 0). Suite blocks typically carry a seeded field
with no value yet (e.g. `emoji:`), which produces an empty summary, so
they always rendered expanded while test blocks (which have populated
fields) collapsed.

Base the default on whether the block has any fields at all instead of
whether it has a non-empty summary: any block with fields starts compact
(suites included), and only a genuinely empty block stays expanded so
it's immediately editable.

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

Copy link
Copy Markdown

Deploying blocks with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7b88f0e
Status: ✅  Deploy successful!
Preview URL: https://30f80abe.blocks-cno.pages.dev
Branch Preview URL: https://feat-testmeta-suite-compact.blocks-cno.pages.dev

View logs

@DavertMik DavertMik merged commit 3ebea39 into master Jun 13, 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.

1 participant