[dashboard-components] Consolidate duplicate dt/dd row markup into shared renderDlRow - #7888
Merged
pelikhan merged 1 commit intoSep 9, 2026
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Duplication
renderDlRow(term, description, detail)indashboard/site/src/components/ui-primitives.jsalready 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 wroteh('div', null, h('dt', null, ...), h('dd', null, ...))directly.work-project-view.js: a privatemobileDetailRow(label, value)helper (used at 10 call sites in the mobile work-item detail dialog) reimplemented the identicalh('div', null, h('dt', ...), h('dd', ...))structure instead of delegating torenderDlRow.Change
package-readme.jsnow importsrenderDlRowfrom./ui-primitives.jsand uses it for all three "About" rows, including the conditionalRolloutrow (passing the existing<span>badge as thedescriptionargument, matchingrenderDlRow'sunknowndescription parameter type).work-project-view.js'smobileDetailRownow delegates torenderDlRow(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— passednpm run lint— passednpm test— 764 tests passed (76 files)npm run test:e2e— 58 tests passedControl Plane
34413728632-489githubnext/gh-aw-caoWarning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
dashboard.testTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.