[dashboard-components] Refactor view chrome paragraphs

Daily Dashboard Component Refactorer · pull request · closed

Filter2mode:review mode:live
All recorded Export JSON
github-actions[bot]

published Aug 30, 2026, 1:47 AM · updated Aug 30, 2026, 1:55 AM

Summary

  • extract reusable custom-view paragraph chrome into renderViewChrome(lines) in pages/dashboard/src/components/view-chrome.js
  • rewire renderViewHeader(...) to compose the new helper without changing rendered text or class names
  • add unit coverage and update pages/dashboard/PLAN.md with the bounded refactor and remaining queue

Duplication evidence

  • pages/dashboard/src/components/view-chrome.js:76 previously assembled the same paragraph DOM shape inline for the source line and metadata line, differing only by class selection and text content
  • the repeated shape was the best remaining bounded extraction that fit in one run without changing page semantics or broadening component APIs

Call sites collapsed

  • pages/dashboard/src/components/view-chrome.js:76 source paragraph in renderViewHeader(...)
  • pages/dashboard/src/components/view-chrome.js:77 metadata paragraph in renderViewHeader(...)

Tests added

  • pages/dashboard/test/unit/view-chrome.test.js adds coverage for populated and empty renderViewChrome(...) inputs while preserving existing renderViewHeader(...) assertions

Behavior preservation evidence

  • renderViewHeader(...) now composes renderViewChrome(...), preserving the same .view-source first paragraph and .view-metadata subsequent paragraphs with identical text
  • captured the bounded refactor diff at /tmp/gh-aw/agent/view-chrome-refactor.diff

Gates run

  • cd pages/dashboard && npm install
  • cd pages/dashboard && npm run typecheck
  • cd pages/dashboard && npm run lint
  • cd pages/dashboard && npm test
  • cd pages/dashboard && npx playwright test --config=playwright.config.mjs

Blockers

  • none

Next candidates

  • extract the repeated custom-view section composition shared by metric, table, and chart renderers in src/presenter.js
  • extract shared pure helpers for chart/table row text formatting and link-column composition
  • extract the repeated state-message plus context composition in unavailable and empty custom views

Generated by ♻️ Daily Dashboard Component Refactorer · pi · gpt54 · 19.1 AIC · ⌖ 7.25 AIC · ⊞ 5.4K ·