Skip to content

refactor: separate panel configuration from runtime state - #6

Merged
tylerlv3 merged 3 commits into
mainfrom
feature/panel-data-seperation-v2
Nov 10, 2025
Merged

refactor: separate panel configuration from runtime state#6
tylerlv3 merged 3 commits into
mainfrom
feature/panel-data-seperation-v2

Conversation

@tylerlv3

@tylerlv3 tylerlv3 commented Nov 6, 2025

Copy link
Copy Markdown
Collaborator

Split panels.json into panels_config.json (tracked) and panels_state.json (ignored). Add an automatic migration function to convert legacy panels.json format. Update state management to load/save config and state separately.

Summary

This helps separate run-time data from configuration data to make repo management easier. This also helps in making our application more versatile, as panels can be added in panels_config.json, and data for any added panels will automatically be logged in panels_state.json.

Type

  • Feature
  • Fix
  • Docs
  • Chore

Testing

Ran Web and API and checked for successful migration from legacy panels.json. Everything still behaves as it did before.

Risk and rollout

Risks include changing data logging, so the possibility of lost data will continue to be monitored and will revert to legacy panels.json if issues are found.

Checklist

  • Issue linked if applicable
  • Added or updated docs
  • CI green
  • At least one reviewer not the author

@tylerlv3
tylerlv3 requested a review from Copilot November 6, 2025 23:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 refactors the panel configuration storage by separating structural configuration (panel definitions and groups) from runtime state (tint levels and timestamps), and reduces the default panel count from 20 to 18 facade panels. The new architecture tracks panels_config.json in version control while keeping runtime state in the ignored panels_state.json.

  • Splits panels.json into panels_config.json (tracked) and panels_state.json (ignored)
  • Adds migration logic to convert legacy panels.json to the new format
  • Updates default panel count from 20 to 18 facade panels (20 total including skylights)

Reviewed Changes

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

Show a summary per file
File Description
svc/app/config.py Adds file path constants for separated config and state files
svc/app/state.py Implements file separation logic with migration, new load/save functions
svc/svc/data/panels_config.json New tracked file containing structural panel and group definitions
svc/tests/test_basic.py Updates test assertion and comment to reflect new panel count (20 total)
.gitignore Adds panels_state.json to ignore list with explanatory comment

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread svc/app/state.py Outdated
Comment thread svc/app/state.py Outdated

@CarlosVasquez04 CarlosVasquez04 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good but in .gitignore shouldn't it be svc/ instead of svc/svc/

@tylerlv3

tylerlv3 commented Nov 7, 2025

Copy link
Copy Markdown
Collaborator Author

Looks good but in .gitignore shouldn't it be svc/ instead of svc/svc/

Ah yea let me update

@tylerlv3

tylerlv3 commented Nov 7, 2025

Copy link
Copy Markdown
Collaborator Author

Looks good but in .gitignore shouldn't it be svc/ instead of svc/svc/

Ah yea let me update

Actually, it looks like we've had it as svc/svc/data, which doesn't make that much sense, so I'll refactor to remove the extra svc directory

tylerlv3 and others added 3 commits November 6, 2025 19:31
Split panels.json into panels_config.json (tracked) and panels_state.json (ignored).
Add automatic migration function to convert legacy panels.json format.
Update state management to load/save config and state separately.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tylerlv3
tylerlv3 force-pushed the feature/panel-data-seperation-v2 branch from 57c5a1d to 57c154d Compare November 7, 2025 03:39
@tylerlv3
tylerlv3 requested a review from Copilot November 7, 2025 03:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 4 out of 5 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tylerlv3
tylerlv3 merged commit c9f147f into main Nov 10, 2025
7 checks passed
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.

3 participants