Skip to content

fix(sessions): one project name, one row [#36] - #37

Merged
PeGa merged 1 commit into
mainfrom
fix/duplicate-sessions
Sep 1, 2026
Merged

fix(sessions): one project name, one row [#36]#37
PeGa merged 1 commit into
mainfrom
fix/duplicate-sessions

Conversation

@PeGa

@PeGa PeGa commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Closes #36.

focus off, past add and past modify now check whether a session already carries the project name before writing. If one does:

A session with the same name exists, append to original note? (y/N):

y — durations sum into the original row, $EDITOR opens pre-loaded with its note, the row becomes duration-only, and the timestamps that drops are appended to the note:

Original start time: 2026-06-20 10:00
Original stop time: 2026-06-20 11:00
New start time: 2026-06-20 12:00
New stop time: 2026-06-20 13:00

A second fold onto the same row appends only the New pair — no original timestamps are left to preserve.

n — nothing is written. off leaves the clock running, add adds nothing, modify leaves the row unchanged.

past modify renaming onto an occupied name folds and deletes the edited row. past modify <id> --notes changes neither name nor timing, so it never asks.

New services/merge.sh holds the shared prompt/fold; get_session_by_project and fold_session_into are the new adapter calls; notes_merge_trail in core/text.sh builds the timestamp trail.

Not covered: focus-checkin writes from cron with nobody to prompt, so it can still create a same-named row.

audit clean, state-matrix 129/129, time-portability 20/20.

focus off, past add and past modify each check for a session already
carrying the project name and offer to fold into it rather than writing a
second entry. Accepting sums the durations, opens the note pre-loaded for
editing, turns the row duration-only and writes the dropped timestamps to
the end of the note. Declining writes nothing.
@PeGa
PeGa merged commit eef9b42 into main Sep 1, 2026
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.

Focus on allowed duplicate entries

1 participant