Repository navigation
Claude/UI component cleanup - #108
Conversation
There was a problem hiding this comment.
🟡 Not ready to approve
It introduces a build-breaking relative import in shared/energyTotals.ts and also maps coolingKwh into the UI’s “Hot Water” total when timeseries data is missing, which yields incorrect displayed values.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR refactors the Building Configurator UI by extracting previously inlined layout/utility logic into dedicated components and helper modules, simplifying BuildingConfigurator.tsx and removing legacy/unused UI pieces.
Changes:
- Extracted header/footer/dialog and overview/configure layouts into
layout/*components. - Extracted “new surface” creation logic and energy totals formatting/computation into
shared/*helper modules. - Removed deprecated
ConfiguratorStylesand deleted legacyElementPanel/ElementListimplementations.
File summaries
| File | Description |
|---|---|
| src/app/components/BuildingConfigurator/shared/ui.tsx | Removes deprecated ConfiguratorStyles no-op component. |
| src/app/components/BuildingConfigurator/shared/surfaceFactory.ts | Adds helper to build seeded default/custom surfaces and a roof-config type guard. |
| src/app/components/BuildingConfigurator/shared/energyTotals.ts | Adds shared energy totals formatting/computation and demand-card row config. |
| src/app/components/BuildingConfigurator/layout/OverviewLayout.tsx | New overview workspace layout wrapper (snapshot aside + envelope column). |
| src/app/components/BuildingConfigurator/layout/EnergyDemandCard.tsx | New extracted preliminary energy demand card UI. |
| src/app/components/BuildingConfigurator/layout/ConfigurePanel.tsx | New extracted configure center-panel router (building/surfaces/tech editors). |
| src/app/components/BuildingConfigurator/layout/ConfigureLayout.tsx | New configure workspace layout (preview + demand + editor + selector). |
| src/app/components/BuildingConfigurator/layout/ConfiguratorHeader.tsx | New extracted configurator header bar (mode/workspace/export/import/close). |
| src/app/components/BuildingConfigurator/layout/ConfiguratorFooter.tsx | New extracted footer actions (reset/recalculate). |
| src/app/components/BuildingConfigurator/layout/CloseConfirmDialog.tsx | New extracted unsaved-changes close confirmation dialog. |
| src/app/components/BuildingConfigurator/configure/surfaces/SurfaceGroupSelector.tsx | Exports props interface for reuse by the new layout components. |
| src/app/components/BuildingConfigurator/configure/surfaces/ElementPanel.tsx | Deletes legacy element panel implementation. |
| src/app/components/BuildingConfigurator/configure/surfaces/ElementList.tsx | Deletes legacy element list implementation. |
| src/app/components/BuildingConfigurator/BuildingConfigurator.tsx | Refactors main component to compose extracted layout/components and shared helpers. |
Review details
Suppressed comments (1)
src/app/components/BuildingConfigurator/layout/ConfigureLayout.tsx:94
- This dismiss button is rendered as just "×" with no accessible name, so screen readers won't announce what it does. Add an
aria-label(and optionally atitle) to describe the action.
<button
type="button"
onClick={onClearPvInvalidated}
className="shrink-0 cursor-pointer text-sm leading-none text-amber-600"
>×</button>
- Files reviewed: 14/14 changed files
- Comments generated: 3
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
| import type { EnergyTotals, LoadDataPoint } from '../../lib/loadProfile'; | ||
| import type { ThermalSummary } from '../../lib/buemAdapter'; |
| <button | ||
| type="button" | ||
| onClick={onClearUploadError} | ||
| className="shrink-0 cursor-pointer text-sm leading-none text-destructive" | ||
| >×</button> |
| heating: thermalSummary.heatingKwh.toFixed(0), | ||
| electricity: thermalSummary.electricityKwh.toFixed(0), | ||
| hotwater: thermalSummary.coolingKwh.toFixed(0), |
No description provided.