Skip to content

feat: Add setting to enforce comments on timesheets#126

Draft
akash2017sky wants to merge 2 commits intomainfrom
fix/66-timesheets-comments
Draft

feat: Add setting to enforce comments on timesheets#126
akash2017sky wants to merge 2 commits intomainfrom
fix/66-timesheets-comments

Conversation

@akash2017sky
Copy link
Contributor

@akash2017sky akash2017sky commented Feb 4, 2026

Summary

  • Adds a "Require Comments on Time Entries" toggle in Settings that enforces notes/comments when logging time
  • When enabled, the TimeEntryModal validates that notes are filled before saving and labels the field as "required"
  • Timesheet submission is blocked if any entries are missing comments, with a clear error message

Screenshots

image image

Closes #66

Test plan

  • Toggle "Require Comments on Time Entries" ON in Settings
  • Try saving a time entry without notes — should show an error toast
  • Try submitting a timesheet with entries missing notes — should show an error with count
  • Toggle the setting OFF — notes should revert to optional behavior
  • Verify the setting persists across page reloads

Copy link
Contributor

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

Adds a new user setting to require notes/comments on time entries, and enforces it in both the time entry modal and timesheet submission flow.

Changes:

  • Adds requireTimesheetComments to UserSettings and initializes it in the settings store defaults.
  • Adds a Settings toggle to enable/disable requiring comments on time entries.
  • Enforces the setting by validating notes on save (modal) and blocking timesheet submission when any entry is missing notes.

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
src/types/index.ts Extends UserSettings with requireTimesheetComments.
src/hooks/useSettingsStore.ts Adds default value for the new setting in the persisted settings store.
src/components/timesheet/WeeklyTimesheet.tsx Blocks submission when the setting is enabled and entries are missing notes.
src/components/timesheet/TimeEntryModal.tsx Validates notes presence when the setting is enabled and updates UI labeling/required flag.
src/components/settings/SettingsPanel.tsx Adds a UI toggle wired to useSettingsStore to control the setting.

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

@EdiWeeks
Copy link
Contributor

EdiWeeks commented Feb 6, 2026

@akash2017sky please take a look above!

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@EdiWeeks
Copy link
Contributor

Tested, Copilot review comments addressed. @BenGWeeks please merge

@BenGWeeks
Copy link
Contributor

Architecturally this is storing in UserSettings, what we want is a company wide setting, so we need to consider where that should be set and who can update it.

@BenGWeeks BenGWeeks marked this pull request as draft February 12, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Add configuration to enforce comments on timesheets

4 participants