Skip to content

feat(time-tracking): lock Monday to Friday and leave the weekend open - #229

Merged
ponbac merged 1 commit into
masterfrom
t3/weekday-locking
Nov 7, 2026
Merged

ponbac merged 1 commit into
masterfrom
t3/weekday-locking

Conversation

@ponbac

@ponbac ponbac commented Nov 7, 2026

Copy link
Copy Markdown
Owner

What and why

The sign-off panel could lock a whole week (Mon–Sun), a month, or a week cut at a month end. It couldn't lock a work week alone, so locking Monday to Friday also locked Saturday and Sunday, even when they hadn't happened yet.

Week mode now has a Mon–Fri choice next to the month-end splits. Picking it changes the title and button to "Week 45, Mon–Fri" and locks only those five days. Unlock and Undo work on the same days.

How

The panel already supported locking part of a week (the month-end splits). Mon–Fri is one more part. A pure weekParts lists what a week can be locked as: Mon–Fri first, then any month-end split. When a month ends on a Friday, the split matching Mon–Fri is dropped, so it isn't offered twice.

A failed lock used to clear what you'd picked and return to the due period. That period covers the whole week, so a retry would have locked the weekend. The panel now keeps the selection, and a retry locks the same days. A lock across a month end can fail halfway, and a retry finishes the job, because locking is idempotent.

Unchanged on purpose

The reminder logic doesn't change. With Mon–Fri locked and the weekend open, the week stays "due" and becomes overdue on Monday until Saturday and Sunday are locked. That matches #228 and what Kleer reports for a week with an open weekend.

Checks

  • SQLX_OFFLINE=true just check-all: Rust check, clippy, tsc, eslint, bun tests and omarchy plugin tests all pass. After the last review tweak, tsc, eslint and the bun tests ran again and pass (342 tests).
  • New unit tests for workweekRange (Sunday anchor, week crossing a month end) and weekParts (month ending on a Friday).
  • Manually in the running app, against Kleer's test API with the local backend:
    • Locked Mon–Fri of week 45: Nov 2–6 became approved and Nov 7–8 stayed open. The panel then showed "Week 45 is due, 7–8 Nov".
    • "Unlock week 45, Mon–Fri" reopened those days.
    • A lock request aborted in the browser showed the error toast and kept "Week 45, Mon–Fri" selected.
    • Week 44 shows the chips Mon–Fri, 26–31 Oct and 1 Nov. Week 31 shows only Mon–Fri and 1–2 Aug.

Reviewed with review-loop: 1 round with GPT-6.1 Sol. Verdict: approved, no findings. A separate engineering-principles pass raised 3 nits; all were applied.

🤖 Generated with Claude Code

The sign-off panel could only lock a whole week, a month, or a week cut at a month end, so locking a work week also locked Saturday and Sunday. Week mode now offers a Mon–Fri choice. A failed lock keeps the chosen days selected, so a retry doesn't widen to the weekend.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ponbac
ponbac marked this pull request as ready for review November 7, 2026 14:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T14:13:54.176832Z 399ad3f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ponbac
ponbac merged commit a6df23e into master Nov 7, 2026
3 checks passed
@ponbac
ponbac deleted the t3/weekday-locking branch November 7, 2026 14:16
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