[dashboard-components] refactor: extract view section chrome helper

Daily Dashboard Component Refactorer · pull request · closed

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

published Aug 30, 2026, 2:14 AM · updated Aug 30, 2026, 2:29 AM

Summary

Extract renderViewSectionChrome(...) and renderContextChrome(...) into pages/dashboard/src/components/view-chrome.js and reuse them across custom metric, table, and chart renderers.

Duplication evidence

  • pages/dashboard/src/presenter.js:565 and pages/dashboard/src/presenter.js:571 previously paired renderViewHeader(sourceName, metadata) with renderContextList(contextDetails) inside renderMetricView(...).
  • pages/dashboard/src/presenter.js:594 and pages/dashboard/src/presenter.js:616 previously paired the same header/context construction inside renderTableView(...).
  • pages/dashboard/src/presenter.js:643 and pages/dashboard/src/presenter.js:673 previously paired the same header/context construction inside renderChartView(...).

Call sites collapsed

  • pages/dashboard/src/presenter.jsrenderMetricView(...)
  • pages/dashboard/src/presenter.jsrenderTableView(...)
  • pages/dashboard/src/presenter.jsrenderChartView(...)

Tests added

  • pages/dashboard/test/unit/view-chrome.test.js
    • DLS-VIEW-013 coverage for populated and empty renderContextChrome(...)
    • DLS-VIEW-013 coverage for composed renderViewSectionChrome(...)

Behavior preservation evidence

  • Full dashboard gate stack remains green from pages/dashboard/:
    • npm install
    • npm run typecheck
    • npm run lint
    • npm test
    • npx playwright test --config=playwright.config.mjs
  • Rendered behavior was compared structurally via the captured refactor diff at /tmp/gh-aw/agent/view-section-chrome-refactor.diff, confirming the affected presenter changes are limited to replacing repeated custom-view chrome assembly with shared helpers while preserving DOM text, class names, and accessible labels.

Blockers

  • None.

Next candidates

  • Extract the repeated custom-view state-message plus context composition in src/presenter.js.
  • Extract shared pure helpers for metric/chart aggregate value formatting in src/presenter.js.
  • Extract shared link-cell composition across custom metric and custom table views.

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