Skip to content

feat: v3.7.0 — session editing (dashboard [e] overlay + flowclock edit CLI)#24

Merged
aedneth merged 2 commits into
mainfrom
feat/v3.7.0-session-editing
Jun 12, 2026
Merged

feat: v3.7.0 — session editing (dashboard [e] overlay + flowclock edit CLI)#24
aedneth merged 2 commits into
mainfrom
feat/v3.7.0-session-editing

Conversation

@aedneth

@aedneth aedneth commented Jun 12, 2026

Copy link
Copy Markdown
Owner

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 (recomputeSessionupdateSession):

  • Dashboard — on the Sessions view (3), press e to 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.
  • CLIflowclock edit <id> --focus <dur> --break <dur> --goal <text> --name <text> [--json]. Unique id-prefix match; --break 0 clears breaks; empty string clears a field. Advertised in flowclock manifest --json for agents.

Recompute semantics (confirmed with user)

  • Breaks are NOT auto-scaled on a focus edit. Reducing focus trims the surplus from the last focus segment (the tail, where runaway time accumulates), cascading back only if needed — recorded breaks keep exact duration, category, order.
  • Break total is edited independently/optionally — unchanged keeps breaks byte-for-byte; 0 removes them; a new positive total scales existing breaks proportionally (categories preserved) or appends one rest break.
  • end = start + focus + break, exact to the second; legacy pauses cleared (canonical v3).

Files

  • New: src/lib/session-edit.ts (pure recompute), src/commands/edit.ts (CLI), src/tui/editform.ts (overlay), tests session-edit (14) + editform (31).
  • Modified: session.ts (updateSession), app.ts ([e] overlay wiring), cli.ts, manifest.ts, format.ts (compactDuration), help.ts, version bump.

Verification

  • 655 tests green (build · lint · typecheck clean).
  • End-to-end smoke (the "fell asleep" case): log 6h runaway → 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

aedneth and others added 2 commits June 12, 2026 17:49
…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>
@aedneth aedneth merged commit 2c35d94 into main Jun 12, 2026
6 checks passed
@aedneth aedneth deleted the feat/v3.7.0-session-editing branch June 12, 2026 23:59
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