feat/energia-ui
safeviewing older commit6859d29 · incrementalPR #303reviewed 2026-07-13 13:18 UTC0H · 1M · 1L · 1I- Purpose
- Preview/demo branch to show the energia feature running in the app on a Vercel preview. Explicitly marked DO NOT MERGE — soft-launch TEMP edit forces the module live for everyone on this branch, pages read illustrative mock data, not live ledger/detectors.
- Goal
- 7-screen energía module as real Next.js pages (resumen, hallazgos, demanda, pagos, pagos/conciliación, esg, medición, sitios) — client components, recharts + @batu/ui, shared sub-nav. Preview at batu-codebase-platform-git-feat-energia-ui-batu-energy.vercel.app
- Sub-goals
- SG-1: Port axo-rfp demo pages into energia routes
- SG-2: Reground to minimal v2 design + real Axo/Neto data + org switcher
- SG-3: Fix details/summary toggle across browsers + wire Resumen CTA nav
- What
- Fixed `<summary>` flex display bug (removed `flex items-center gap-2`, added `[&::-webkit-details-marker]:hidden`, added `inline-block` to chevron span) in 3 pages. Wired Resumen CTA button to navigate to `/energia/hallazgos` using next-intl router.
- Why
- The `flex` display on `<summary>` was preventing the browser's native details toggle from working correctly. The CTA button on the Resumen page was previously a no-op — this wires it to the Hallazgos sub-page as intended.
- Areas
- apps/platform/src/app/[locale]/(dashboard)/energia+4196−3apps/platform/src/lib/demo+651−0apps/platform/src/messages+0−0apps/platform/src/components+10−1apps/platform/src/lib+2−0domains/core + packages/api+2−2apps/platform/src/app/[locale]/(dashboard)/admin+5−0
- Blast
- 25 files, +4249/-3 lines. All changes in the energia module or its support libs. No impact on existing bills/sites/credentials surfaces. Soft-launch TEMP edit in soft-launch.ts must be reverted before any merge.
Findings · 3
improvement3
Duplicated disclosure pattern — extract a DisclosureRow component before production
apps/platform/src/app/[locale]/(dashboard)/energia/resumen/page.tsx:107
The same 2-line `<details><summary>` markup (summary classes + chevron span) is repeated 4 times across 3 pages. Extracting into a small `<DisclosureRow label={…}>` component scoped to `energia/_components/` would make future fixes apply everywhere at once.
Hardcoded route string in router.push — note for when more CTAs are wired
apps/platform/src/app/[locale]/(dashboard)/energia/resumen/page.tsx:102
`router.push('/energia/hallazgos')` works correctly (next-intl prepends locale), but as more CTA buttons are wired, a route constant map would prevent typos and make future renames safe.
Both marker-suppression classes are load-bearing — document when extracted
apps/platform/src/app/[locale]/(dashboard)/energia/hallazgos/page.tsx:172
`marker:content-none` (Firefox) + `[&::-webkit-details-marker]:hidden` (Safari/Chromium) are both needed for cross-browser consistency. A comment on the future shared component would prevent a reviewer from removing one as redundant.