[dashboard-components] refactor: extract dashboard view chrome

Daily Dashboard Component Refactorer · pull request · closed

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

published Aug 29, 2026, 7:17 PM · updated Aug 29, 2026, 7:21 PM

Summary

  • extract src/components/view-chrome.js for repeated custom-view source, metadata, and effective-context chrome
  • reuse the shared component in src/presenter.js across metric, table, chart, and custom-view state rendering while preserving existing DOM text and class names
  • update test module URL rewriting and plan inventory/run log for the new component

Duplication evidence

  • pages/dashboard/src/presenter.js:1303 and nearby lines repeated .view-source, .view-metadata, and .view-context construction in renderMetricView
  • pages/dashboard/src/presenter.js:1334 and nearby lines repeated the same chrome in renderTableView
  • pages/dashboard/src/presenter.js:1388 and nearby lines repeated the same chrome in renderChartView
  • pages/dashboard/src/presenter.js:1249 and nearby lines duplicated the source/context subset in renderCustomViewState

Call sites collapsed

  • renderCustomViewState
  • renderMetricView
  • renderTableView
  • renderChartView
  • shared provenance-adjacent wrapper usage in renderBuiltInPage

Tests added or updated

  • added unit coverage in pages/dashboard/test/unit/presenter.test.js for shared view chrome rendering of source, metadata, context, and nested content
  • updated pages/dashboard/test/e2e/smoke.spec.js module URL rewriting so browser tests load the new component dependency

Behavior preservation proof

  • compared the affected presenter diff and confirmed the refactor only replaces duplicated chrome construction with renderViewChrome(...)
  • preserved existing DOM text, accessible names, class names, ordering, and table/chart bodies at every replaced call site
  • verified browser-rendered affected pages still pass existing smoke coverage after the extraction

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 page provenance section rendering
  • extract repeated built-in page section heading plus inventory-table composition
  • extract repeated summary-list plus section wrappers still assembled inline in src/presenter.js

Warning

Firewall blocked 1 domain

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

  • mtalk.google.com

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

network:
  allowed:
    - defaults
    - "mtalk.google.com"

See Network Configuration for more information.

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