Skip to content

feat(components): shared DescriptionList Twig component family#100

Merged
martinyde merged 3 commits into
developfrom
feature/issue-94-description-list-component
Jun 22, 2026
Merged

feat(components): shared DescriptionList Twig component family#100
martinyde merged 3 commits into
developfrom
feature/issue-94-description-list-component

Conversation

@martinydeAI

Copy link
Copy Markdown
Collaborator

Links to issues

Closes #94.

Description

templates/assistant/show.html.twig hand-rolls a <dl> with two
<div><dt><dd> triplets to render the runtime attribute grid.
Extract a shared DescriptionList Twig component family so the
markup and typography stay consistent across the app.

  • New templates/components/DescriptionList/List.html.twig
    outer <dl> with a class slot for grid/column configuration.
  • New templates/components/DescriptionList/Item.html.twig
    one label/value pair with the standard typography (text-xs uppercase label, text-lg font-semibold value). label is a
    translation key; the value comes from the block.
  • Refactored call site on develop:
    • templates/assistant/show.html.twig (runtime attribute grid)

Mirrors the project's existing family-with-inner-item pattern
(CardRail/Container + CardRail/Card, TagList/List +
TagList/Tag, Stats/List + Stats/Item).

Stats/List + Stats/Item are intentionally left alone — they're
a specialised hero-stats family with a much larger value treatment
(text-3xl) and a fixed outer layout. Collapsing them into
DescriptionList would require a size prop that bleeds two
visual identities into one component.

Screenshot of the result

n/a — the refactored assistant detail page preserves the same
markup output (the component emits the same <dl> / <div> /
<dt> / <dd> chain with identical class strings). Visual output
is unchanged.

Checklist

  • My code is covered by test cases.
  • My code passes our test (all our tests).
  • My code passes our static analysis suite.
  • My code passes our continuous integration process.

Verified locally:

  • task coding-standards-twig-check — green.
  • task test-coverage — 70 tests, 267 assertions, 100% coverage.

Additional comments or questions

Twig Components invokes nested namespaces with a colon, so the call
sites read <twig:DescriptionList:List> /
<twig:DescriptionList:Item>. Matches how <twig:Form:Label> /
<twig:Form:TextInput> already read.


Details - AI specificities

Adds `templates/components/DescriptionList/List.html.twig` and
`templates/components/DescriptionList/Item.html.twig` so label/value
pairs share one home. Mirrors the existing CardRail / TagList /
Stats family pattern (outer container + inner item).

- `DescriptionList/List` wraps in `<dl class="grid gap-4 ...">` and
  takes a `class` slot so the caller picks the column layout
  (1-col on profile pages, 2-col on assistant detail).
- `DescriptionList/Item` renders a `<div><dt><dd>` triplet with the
  standard typography (`text-xs uppercase` label, `text-lg
  font-semibold` value). `label` is a translation key; the value
  comes from the block.

Refactors the one duplicated call site on develop:

- templates/assistant/show.html.twig (runtime attribute grid)

Leaves `Stats/List` + `Stats/Item` alone - they're a specialised
hero-stats family with a much larger value treatment (`text-3xl`)
and a fixed outer layout. Collapsing them into DescriptionList
would require a `size` prop that bleeds two visual identities into
one component.

Refs #94.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@martinyde martinyde requested a review from yepzdk June 22, 2026 06:54
yepzdk
yepzdk previously approved these changes Jun 22, 2026
@martinyde martinyde merged commit 64fb78f into develop Jun 22, 2026
5 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.

feat(components): shared DescriptionList Twig component family

3 participants