[dashboard-components] Extract renderContextList helper

Daily Dashboard Component Refactorer · pull request · closed

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

published Aug 29, 2026, 7:50 PM · updated Aug 29, 2026, 8:33 PM

Summary

  • extract reusable renderContextList(details) into pages/dashboard/src/components/view-chrome.js
  • replace every repeated custom-view .view-context list assembly in pages/dashboard/src/presenter.js
  • add unit coverage for populated and empty context-list rendering and update pages/dashboard/PLAN.md

Duplication evidence

  • pages/dashboard/src/presenter.js:1238 repeated .view-context list construction in renderCustomViewState
  • pages/dashboard/src/presenter.js:1296 repeated .view-context list construction in renderMetricView
  • pages/dashboard/src/presenter.js:1341 repeated .view-context list construction in renderTableView
  • pages/dashboard/src/presenter.js:1397 repeated .view-context list construction in renderChartView

Call sites collapsed

  • renderCustomViewState(...)
  • renderMetricView(...)
  • renderTableView(...)
  • renderChartView(...)

Tests added

  • pages/dashboard/test/unit/view-chrome.test.js
    • DLS-VIEW-013 populated custom-view context list rendering
    • DLS-VIEW-013 empty custom-view context list rendering

Behavior preservation proof

  • Full existing test suite remains green unchanged.
  • Captured the bounded refactor diff at /tmp/gh-aw/agent/context-list-refactor.diff.
  • Rendered the existing custom-views presenter fixture after the refactor to /tmp/gh-aw/agent/custom-page-after.html, confirming the same custom metric, table, chart, empty, and unavailable view text is still emitted.
  • No DOM text, class names, accessible labels, or fallback messages were changed; only repeated .view-context assembly moved behind the shared helper.

Quality gates

  • 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 && npm run test:e2e

Blockers

  • None.

Next candidates

  • extract repeated built-in summary-section composition for count lists
  • extract the next shared pure helpers around subject/provenance/count formatting in pages/dashboard/src/presenter.js
  • extract repeated built-in definitions/observations dual-region composition in pages/dashboard/src/presenter.js

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