github-actions[bot]
published Aug 30, 2026, 4:25 AM · updated Aug 30, 2026, 4:45 AM
Summary
- extract shared custom-view aggregate formatting into
src/view-formatters.js - replace the inline metric aggregate branch in
src/presenter.jswith the shared helper - add focused unit coverage for aggregate and numeric formatter edge cases and update the browser harness import rewrites
Duplication evidence
pages/dashboard/src/presenter.js:527previously inlined the fullcount/distinct-count/sum/mean/min/maxaggregate formatting branch insiderenderMetricView(...)pages/dashboard/src/presenter.js:636,pages/dashboard/src/presenter.js:683, andpages/dashboard/src/presenter.js:879also reused the same numeric formatting helpers for chart point construction and text labels- this run collapses that repeated helper logic behind one shared presentation-only module for future custom metric and chart slices
Call sites collapsed
pages/dashboard/src/presenter.js:527now callsformatAggregateValue(...)instead of rebuilding aggregate formatting inlinepages/dashboard/src/presenter.jschart helpers now import the same sharedformatNumber(...)andtoNumber(...)functions fromsrc/view-formatters.jspages/dashboard/test/e2e/smoke.spec.jsbrowser harness now rewrites the new helper import so the same presenter behavior is exercised in browser tests
Tests added
pages/dashboard/test/unit/view-formatters.test.js- aggregate formatting for
count,distinct-count,sum,mean,min,max, and default field access - empty, missing-field, and non-numeric inputs
- deterministic shared numeric helper output
- aggregate formatting for
Behavior preservation proof
- preserved existing DOM text, class names, and custom-view metric/chart behavior by extracting only formatting logic
- compared the committed change scope with
git diff --stat HEAD~1 HEADand confirmed the affected files are limited to the presenter helper extraction, its tests, the Playwright module-rewrite harness, andPLAN.md - reran the existing presenter unit suite and browser suite after wiring the new module into the Playwright data-URL harness
Quality gates
Ran from pages/dashboard/:
npm install✅npm run build✅npm run typecheck✅npm run lint✅npm test✅npx playwright test --config=playwright.config.mjs✅
Blockers
- None
Next candidates
- extract the repeated custom-view state-message plus affected-source/context composition in
src/presenter.js - extract shared link-cell composition across custom metric and custom table views
- extract shared chart-series grouping and textual legend helpers if upcoming feature slices add more chart variants
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 · 37.8 AIC · ⌖ 6.08 AIC · ⊞ 5.4K · ◷