Skip to content

Refactor/improve day budget#8

Merged
Flyrell merged 7 commits intomainfrom
refactor/improve-day-budget
Mar 15, 2026
Merged

Refactor/improve day budget#8
Flyrell merged 7 commits intomainfrom
refactor/improve-day-budget

Conversation

@Flyrell
Copy link
Owner

@Flyrell Flyrell commented Mar 15, 2026

No description provided.

Flyrell and others added 7 commits March 15, 2026 19:47
…for log deduction

Manual logs now carve their exact time ranges out of overlapping checkout
segments (reusing the idle-gap splitting logic) instead of uniformly
scaling all checkout minutes. Duration-only logs are placed at the first
available schedule slot via FindAvailableSlot() rather than at now-minutes.

- Add deductLogOverlaps() in deduct.go (reuses idle gap splitting)
- Add FindAvailableSlot() in placement.go for duration-only log placement
- Remove deductScheduleOverrun() — no longer needed
- Always use segment-based path in BuildReport/BuildDetailedReport/BuildExportData
- Update log.go to use findDurationSlot with fallback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show HH:MM-HH:MM time range for each entry in the detail panel,
prepended before duration and message, so users can see exactly
when each tracked segment occurred.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use hyphen instead of en-dash for time range separator, fix padRight
width to 11 to match actual display width, and guard against zero-value
Start by falling back to duration-only display. Update tests to assert
hyphenated ranges, add NotEmpty guards and time range checks to
SelectedMarker test, add ZeroStart test, and fix TotalMinutes
computation in helper.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Support interdependent from/to/duration flag combinations in edit
command (any two of three now works). Add from/to fields to report
edit and add overlays with automatic recomputation. Fall back to
9:00 start time for duration-only log entries when no schedule slot
is available.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…or to <= from

Deduplicate from/to/duration recomputation logic between editOverlay and
addOverlay into a shared timeFields struct. Add a defensive guard in
addOverlay.buildEntry() that rejects to <= from, preventing negative
Minutes values. Includes TestAddOverlay_BuildEntryToBeforeFrom test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update README.md and web docs to reflect that any two of --duration,
--from, and --to can be combined in the edit command. Replace hardcoded
hour 9 with defaultStartHour constant in log fallback placement.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…stent

Previously, specifying --duration, --from, and --to together was rejected
outright. Now all three are accepted as long as they are consistent
(to - from = duration), giving users explicit control without ambiguity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Flyrell Flyrell merged commit 851524f into main Mar 15, 2026
2 checks passed
@Flyrell Flyrell deleted the refactor/improve-day-budget branch March 15, 2026 21:39
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