fix: Connect Settings Panel preferences to persistent store#30
Draft
fix: Connect Settings Panel preferences to persistent store#30
Conversation
- Add onChange handlers for Weekly Hours Target input - Add onChange handler for Timesheet Reminders toggle - Connect inputs to useSettingsStore which persists to localStorage - Use weeklyHoursTarget from settings store in Team page calculations Closes #10
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the Settings Panel preferences to properly persist to localStorage by connecting the UI controls to the useSettingsStore, addressing issue #10.
- Added onChange handlers for the Weekly Hours Target input and Timesheet Reminders toggle to save changes to the persistent settings store
- Connected the weeklyHoursTarget from the settings store to the Team page calculations
- Added input validation with min/max attributes and safe parsing for the hours target input
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/components/settings/SettingsPanel.tsx | Connects Weekly Hours Target input and Timesheet Reminders toggle to useSettingsStore with onChange handlers and adds input validation |
| src/components/team/TeamList.tsx | Uses weeklyHoursTarget from settings store for team member calculations and adds division-by-zero protection |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jan 6, 2026
- SettingsPanel: Enforce min/max (0-168) in onChange handler, not just HTML - SettingsPanel: Add aria-label attributes for accessibility - SettingsPanel: Use parseFloat to support decimal hours (e.g., 37.5) - TeamList: Use useMemo to derive members instead of refetching API - useSettingsStore: Change default weeklyHoursTarget to 37.5 (7.5 × 5) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
Further work neededThis PR needs to be updated to fetch weekly hours target from Business Central Resources API instead of using local settings. See: knowall-ai/thyme-bc-extension#4 Once the Resources API is implemented in the BC extension, this PR will be updated to:
|
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.
Closes #10