feat: Profile active hours / schedule management UI#159
Merged
hokiepokedad2 merged 6 commits intomainfrom Apr 8, 2026
Merged
Conversation
Add the ability to view and edit active_hours on user profiles. PoracleNG's profile scheduler uses these rules to automatically switch profiles at configured times throughout the day. Backend: - Thread active_hours through the proxy pipeline (model, deserialization, create/update/duplicate controller payloads) - Server-side validation (day 1-7, hours 0-23, mins 0-59, max 28 entries) - InternalsVisibleTo for validation unit tests Frontend: - ActiveHoursChipComponent: compact amber schedule pills on profile cards - ActiveHoursEditorDialogComponent: day picker, time picker, rules list, mini weekly preview grid - LocationWarningComponent: warns when active hours are set but profile has 0,0 coordinates (causes UTC fallback timezone bug) - Integrated into ProfileOverviewComponent (the actual /profiles route) - Utility functions for grouping, formatting, and parsing active hours - Handles PoracleNG string-typed hours/mins with Number() coercion Cleanup: - Remove unused ProfileListComponent (never routed) Tests: - 17 backend validation tests (ActiveHoursValidationTests) - Extended ProfileControllerTests and ProfileServiceTests - Frontend specs for all new components and utilities Closes #158
- CHANGELOG: add PR #159 entry under [Unreleased] - CLAUDE.md: add active hours to solution structure, patterns, file locations, testing, and common issues sections - profiles.md: major expansion with schedule editor guide, examples, validation rules, and location warning explanation - Architecture docs: update backend, frontend, proxy, and database docs - Troubleshooting: add 3 new entries for active hours issues - README/index: add feature mention - testing.md: document new test files - reference.md: note active hours requires PoracleNG API
- Replace `as unknown as string` double-cast with runtime typeof check - Add 2 test cases for string-to-number coercion in parseActiveHours
Contributor
Author
Code Review: PR #159Overall: ✅ APPROVED
Findings Summary1 Critical (Fixed): Double type-cast 4 Minor/Informational:
Architecture Highlights
Test Coverage
Post-Merge Recommendations
Full review report: |
- Remove redundant parseActiveHoursField wrapper in profile-overview - Add client-side range validation in editor dialog addEntries() - Add whitespace trimming to ValidateActiveHours - Accept string-typed day field for consistency with hours/mins - Add 10 new backend validation tests: negative numbers, floats, booleans, extremely large numbers, whitespace, string-typed day - Add duplicate-with-active-hours controller test - Add negative-coordinates location-warning test - Fix ESLint sort-classes warning
Contributor
Author
Code Review: Round 2 — All Issues Resolved ✅Issues Fixed in 8cd594f
Final Test Results
Verdict: ✅ APPROVED — No remaining issuesAll findings from round 1 have been addressed. The PR is ready to merge. |
- Merge incoming profile fields with existing values in Update endpoint to prevent blanking name when only updating active_hours (and vice versa) - Remove duplicate [2.2.0] header in CHANGELOG.md - Move active-hours test spec next to its source file
Contributor
Author
Code Review: Round 3 (Fresh Full Review) — ✅ APPROVEDIssues Found and Fixed in e13e934
Remaining Minor Notes (Not Blocking)
Positive Findings
Final Test Results
Verdict: ✅ APPROVED — Ready to merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #158
active_hourson user profiles — PoracleNG's profile scheduler uses these rules to automatically switch profiles at configured timesactive_hoursthrough the existing proxy pipeline (backend model, deserialization, create/update/duplicate payloads)New components
Cleanup
ProfileListComponent(was never routed —/profilesloadsProfileOverviewComponent)Test plan