Skip to content

Conversation

@matkoniecz
Copy link
Contributor

No description provided.

@matkoniecz matkoniecz requested a review from Copilot September 12, 2025 11:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR splits energy source attribution into more granular fields for energy performance data. The change separates source tracking for aggregate estimate EPC and DEC data, allowing for better documentation of data provenance.

  • Adds new database columns for source type and link tracking for both aggregate estimate EPC and DEC data
  • Updates the frontend configuration to support the new source fields
  • Modifies the energy performance UI to display separate source inputs for each energy metric

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
migrations/056.split_energy_source_part_1.up.sql Adds four new columns to buildings table for source tracking
migrations/056.split_energy_source_part_1.down.sql Provides rollback for the new columns
app/src/frontend/config/data-fields-config.ts Configures frontend field definitions for new source fields and fixes category for existing fields
app/src/frontend/building/data-containers/energy-performance.tsx Adds UI components for the new source input fields
app/src/api/config/dataFields.ts Enables edit and verify permissions for new fields

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@matkoniecz matkoniecz force-pushed the feature/split-energy-source branch from aaed126 to 36cfe35 Compare September 12, 2025 11:36
@matkoniecz matkoniecz requested a review from Copilot September 12, 2025 11:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +66 to +68
{(props.building.sust_aggregate_estimate_epc_source_type == dataFields.sust_aggregate_estimate_epc_source_type.items[0] ||
props.building.sust_aggregate_estimate_epc_source_type == dataFields.sust_aggregate_estimate_epc_source_type.items[1] ||
props.building.sust_aggregate_estimate_epc_source_type == null) ? <></> :
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded array indices [0] and [1] make the code fragile and unclear. Consider extracting these specific source types into named constants or checking for the actual string values to improve readability and maintainability.

Copilot uses AI. Check for mistakes.
Comment on lines +112 to +114
{(props.building.sust_dec_source_type == dataFields.sust_dec_source_type.items[0] ||
props.building.sust_dec_source_type == dataFields.sust_dec_source_type.items[1] ||
props.building.sust_dec_source_type == null) ? <></> :
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the EPC source type check above, this condition uses hardcoded array indices [0] and [1]. This duplicates the same fragile pattern and should use named constants or actual string values for better maintainability.

Copilot uses AI. Check for mistakes.
@matkoniecz matkoniecz merged commit 4e71312 into colouring-cities:master Sep 15, 2025
2 checks passed
@matkoniecz matkoniecz deleted the feature/split-energy-source branch September 15, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant