Skip to content

feat(card): collapsedHeight, a body that peeks and opens on a click - #915

Open
fedepini wants to merge 1 commit into
mainfrom
feat/card-collapsed-height
Open

fedepini wants to merge 1 commit into
mainfrom
feat/card-collapsed-height

Conversation

@fedepini

@fedepini fedepini commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Card gets collapsedHeight: the body is cut to that height and fades into the card, with one button underneath that opens it whole and closes it again.

  • expandLabel / collapseLabel name the button. Both are translatable (key siblings generated). When absent they read "Show all" / "Show less", with en and it catalog entries.
  • The body's height is watched with a ResizeObserver, because a card's children arrive after it. A body no taller than the cut is drawn whole, with no fade and no button.
  • Header, extra and footer are never cut. A Card without the field renders as before, and the body is not wrapped.
  • The button carries aria-expanded and aria-controls.

Use: the composition page's Topology card (the graph peeks, "Show full graph"), and its Specification and Manifest cards, whose values can hold whole files. That is the portal PR that follows; it needs this release (1.8.182).

The schema, generated types, CRD, widget kinds, translation keys and API reference are regenerated (sync-translation-keys, generate-types, generate-crds, gen-widget-kinds, update-readme-widgets). Below this CRD, the API server prunes the field from a Card CR. I checked this on kind.

Verification

  • vitest run src/widgets src/utils src/components src/i18n: 403 files, 5204 tests pass. New: Card.collapsedHeight.test.tsx covers:
    • a cut body;
    • open and close;
    • custom labels;
    • a short body drawn whole;
    • no field, no wrapper.
  • tsc --noEmit, eslint, stylelint clean; sync-translation-keys --check, gen-widget-kinds --check, update-readme-widgets --check in step.
  • Live on kind (vite dev, updated Card CRD), composition cloud-meetup-turin: the Topology card is cut at 260px and fades out. "Show full graph" opens the whole graph and "Hide graph" closes it. Manifest and Specification behave the same.

🤖 Generated with Claude Code

Card `collapsedHeight`: the body drawn cut to that height, fading into the card, with one button
that opens it whole and closes it again (`expandLabel` / `collapseLabel`, translatable; absent,
"Show all" / "Show less"). The body's height is watched, so a body no taller than the cut is drawn
whole, with no fade and no button. Header, extra and footer are never cut. For the composition
page's Topology (the graph peeks, one click shows it all) and its Specification and Manifest.

Schema, generated types, CRD, widget kinds, translation keys (en, it) and the API reference
regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fedepini
fedepini requested a review from a team as a code owner December 3, 2026 17:20
@fedepini
fedepini requested review from braghettos and removed request for a team December 3, 2026 17:20
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