feat: v3.7.0 — session editing (dashboard [e] overlay + flowclock edit CLI)#24
Merged
Conversation
…t CLI) Edit a logged session's essential values without hand-editing sessions.json. The start timestamp is immutable; end + break timeline recompute automatically. Two surfaces over one pure engine (recomputeSession / updateSession): - Dashboard: Sessions view (3) → [e] opens an Edit overlay (Goal/Name/Focus/ Break) with a read-only Start line and a live End→ preview. Mirrors the new-session form. [Tab]/[Enter] save/[Esc] cancel. - CLI: flowclock edit <id> --focus --break --goal --name [--json]; id-prefix match, --break 0 clears breaks, empty string clears a field. Advertised in the agent manifest. Recompute semantics (confirmed with user): - Breaks are NOT auto-scaled on a focus edit. Reducing focus (the "fell asleep, timer kept running" case) trims the surplus from the LAST focus segment, cascading back only if needed; recorded breaks keep duration/category/order. - Break total edited independently/optionally: unchanged keeps breaks byte-for-byte; 0 removes them; a new total scales existing breaks (categories preserved) or appends one rest break. - end = start + focus + break, exact to the second. Legacy pauses cleared. 655 tests green (build/lint/typecheck clean). New: session-edit (14), editform (31), updateSession + edit CLI + dashboard edit-overlay coverage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The published package ships no build tooling — esbuild/tsup/vite are devDependencies and never installed by consumers (`npm ls esbuild --omit=dev` is empty; `npm audit --omit=dev` reports 0 vulnerabilities). Two freshly published esbuild advisories (dev-server file read on Windows; Deno-module RCE) are build-time only and cannot reach the published artifact, yet were failing CI and would block the tag-triggered release. Scope both the CI and release audit gates to production dependencies so the gate guards exactly what users install, without blocking releases on transitive dev-tool advisories. Full-tree `npm audit` remains available locally. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Edit a logged session's essential values without hand-editing
sessions.json. The start timestamp is immutable; the end timestamp and break timeline recompute automatically. Motivated by the real "fell asleep with the timer running" case — correcting inflated focus time to keep records honest — generalized into a first-class, flexible feature.Two surfaces over one pure engine (
recomputeSession→updateSession):eto open an Edit session overlay (mirrors the new-session form). Fields: Goal · Name · Focus · Break, a read-only Start line, and a live-computed End → preview.[Tab]next ·[Enter]save ·[Esc]cancel.flowclock edit <id> --focus <dur> --break <dur> --goal <text> --name <text> [--json]. Unique id-prefix match;--break 0clears breaks; empty string clears a field. Advertised inflowclock manifest --jsonfor agents.Recompute semantics (confirmed with user)
0removes them; a new positive total scales existing breaks proportionally (categories preserved) or appends onerestbreak.end = start + focus + break, exact to the second; legacypausescleared (canonical v3).Files
src/lib/session-edit.ts(pure recompute),src/commands/edit.ts(CLI),src/tui/editform.ts(overlay), testssession-edit(14) +editform(31).session.ts(updateSession),app.ts([e]overlay wiring),cli.ts,manifest.ts,format.ts(compactDuration),help.ts, version bump.Verification
edit --focus 90m --break 15m→ start immutable,focus=5400,breakS=900,end=04:45:00(= start+focus+break exactly),breaks=[rest 900], goal preserved.Schema unchanged (v3). Fully back-compatible — no existing flows touched.
🤖 Generated with Claude Code