Skip to content

[dashboard-components] Consolidate duplicate dt/dd row markup into shared renderDlRow - #7888

Merged
pelikhan merged 1 commit into
mainfrom
selfcare/consolidate-dl-row-pattern-8994840-3bdc4c22d654bef7
Sep 9, 2026
Merged

[dashboard-components] Consolidate duplicate dt/dd row markup into shared renderDlRow#7888
pelikhan merged 1 commit into
mainfrom
selfcare/consolidate-dl-row-pattern-8994840-3bdc4c22d654bef7

Conversation

@cao-githubnext-gh-aw-cao-write

Copy link
Copy Markdown
Contributor

Duplication

renderDlRow(term, description, detail) in dashboard/site/src/components/ui-primitives.js already builds a single shared <div><dt>...</dt><dd>...</dd></div> definition-list row, used across vital-stat metrics and metadata summaries. Two other files bypassed it and rebuilt the same markup inline:

  • package-readme.js: three call sites in the package "About" <dl> (Workflows, Owner, Rollout) each wrote h('div', null, h('dt', null, ...), h('dd', null, ...)) directly.
  • work-project-view.js: a private mobileDetailRow(label, value) helper (used at 10 call sites in the mobile work-item detail dialog) reimplemented the identical h('div', null, h('dt', ...), h('dd', ...)) structure instead of delegating to renderDlRow.

Change

  • package-readme.js now imports renderDlRow from ./ui-primitives.js and uses it for all three "About" rows, including the conditional Rollout row (passing the existing <span> badge as the description argument, matching renderDlRow's unknown description parameter type).
  • work-project-view.js's mobileDetailRow now delegates to renderDlRow(label, value || 'Unavailable') instead of constructing the markup itself, removing the duplicated implementation while every one of its 10 call sites is unaffected.

No rendered markup, public module APIs, or Dashboard Language behavior changed — both files produce the exact same <div><dt>...</dt><dd>...</dd></div> DOM structure as before, just through the shared helper.

Scope

Changed files: dashboard/site/src/components/package-readme.js, dashboard/site/src/components/work-project-view.js. No dependency, manifest, CI, or generated-file changes.

Validation (from dashboard/site)

  • npm run typecheck — passed
  • npm run lint — passed
  • npm test — 764 tests passed (76 files)
  • npm run test:e2e — 58 tests passed

Control Plane

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • dashboard.test

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "dashboard.test"

See Network Configuration for more information.

Generated by SelfCare / Code Quality · copilot · auto · 84.5 AIC · ⌖ 10.2 AIC · ⊞ 12K ·

  • expires on Sep 16, 2026, 11:03 PM UTC

package-readme.js and work-project-view.js each built raw
h('div', null, h('dt', ...), h('dd', ...)) rows for definition-list
entries at multiple call sites, duplicating the already-shared
renderDlRow(term, description, detail) helper in ui-primitives.js.
work-project-view.js additionally defined a private mobileDetailRow
wrapper that reimplemented the same markup instead of delegating to
renderDlRow.

Both call sites now import and use renderDlRow, removing the
duplicated dt/dd construction while preserving identical rendered
markup and behavior.

Validation (dashboard/site): npm run typecheck, npm run lint, npm
test (764 tests passed), npm run test:e2e (58 tests passed).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review September 9, 2026 23:31
@pelikhan
pelikhan merged commit 11ffe42 into main Sep 9, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant