Skip to content

Change chronology view: a time-ordered bar of agent file changes in the attached view#149

Open
bakedbean wants to merge 53 commits into
mainfrom
change-chronology-view
Open

Change chronology view: a time-ordered bar of agent file changes in the attached view#149
bakedbean wants to merge 53 commits into
mainfrom
change-chronology-view

Conversation

@bakedbean
Copy link
Copy Markdown
Owner

Summary

Adds a toggleable vertical Change Chronology bar to wsx's attached view: a newest-first, time-ordered series of the individual file changes the agent made — one entry per edit (not a commit list) — to help you keep your sense of where code lives and why under agentic editing.

  • Data source: rebuilt read-only from the agent's on-disk session JSONL logs (no new DB table). The active session is followed live; historical sessions are scanned once and cached per file by (size, mtime).
  • Each entry: time · file · one-line "what" summary. Click to expand a short inline diff peek; click the expanded entry to open your editor at the changed file:line.
  • Layout: docked left or right, toggleable; width is a % of the attach area clamped to a configurable min/max (auto-hides when the agent pane would get too narrow).
  • Config: chronology_config JSON, resolved globally (wsx config set) and per-repo (repo-settings modal), mirroring the existing detail_bar_config pattern.
  • Editor open: open_in_editor_at adds {file}/{line} placeholders with goto fallbacks (code --goto file:line, vim/nvim/emacs +line file).

Keybindings (attached, under the Ctrl-x leader)

  • Ctrl-x c — toggle the bar
  • Ctrl-x C — swap side (left/right)
  • wheel to scroll; click to expand; click again to open at the line

Scope

Implemented end-to-end for Claude sessions. Codex/Pi/Hermes feeds are a deliberate, documented follow-up — see "Phase 8 scope correction" in the plan: none of those parsers currently expose file paths/change text, and Hermes is a SQLite store (not files), so each needs format-specific work against real session samples. Non-Claude agents show an empty bar (em-dash placeholder), never a crash.

Design & plan

  • Spec: docs/superpowers/specs/2026-06-05-change-chronology-view-design.md
  • Plan: docs/superpowers/plans/2026-06-05-change-chronology-view.md

Built task-by-task (TDD) with per-task spec + code-quality review and a final whole-feature review.

Test Plan

  • cargo test --lib — 1098 passing, 0 failing
  • cargo build — zero warnings
  • cargo clippy --lib — no warnings in feature files
  • cargo fmt --check — clean
  • Manual: attach to a Claude workspace, confirm the bar shows recent edits newest-first; Ctrl-x c toggles; Ctrl-x C swaps side; wheel scrolls; click expands a diff peek; second click opens the editor at the right line
  • Manual: wsx config set chronology_config '{"side":"left","width":{"min_cols":30}}' (global) and a per-repo override via the repo-settings modal both take effect live
  • Manual: narrow the terminal until the bar auto-hides and confirm the agent reclaims full width

bakedbean added 30 commits June 5, 2026 14:35
Extract spawn_parts from spawn_resolved's tail so the detach-spawn
sequence lives in one place. Route both spawn_resolved and
open_in_editor_at through it, eliminating the duplicate implementation
introduced in c446025. Add a test proving {file}/{line} substitute
when they appear in separate argv tokens.
Add `ChronologyConfig` / `ChronologyOverride` / `WidthSpec` / `Side`
types in `src/config/chronology.rs` with per-field merge, `sanitize()`
clamping, and `resolved_width()`.  Wire the `repos.chronology_config`
TEXT column via schema migration v13, a new `set_repo_chronology_config`
setter, and an updated SELECT in `repos()` (indices 0-12).  Sweep all
`Repo { .. }` struct literals to add `chronology_config: None`.
…modal

Adds a ChronologyConfig variant to RepoSettingField (after DetailBarConfig)
and wires it through every site the detail-bar config uses: the ALL array,
label(), the editor-seed getter (reads repo.chronology_config), the modal
row list, and apply_repo_setting. The apply arm validates the edited JSON as
ChronologyOverride (the partial per-repo override type, mirroring how the
detail-bar arm validates DetailBarOverride rather than the full config) and
persists via store.set_repo_chronology_config, passing None when empty.

Also adds a config test proving the per-repo override flows through resolve()
when the global config is unset (side override -> Side::Left, other fields
stay at global defaults).
The chronology bar's scroll offset and expanded-entry index persisted across
focused-workspace switches, so they could point at an entry belonging to an
unrelated workspace. Adds a chronology_last_workspace sentinel to App and a
reset_chronology_state_on_workspace_change helper that zeroes the scroll and
clears the expanded index when the focused workspace id changes, called in the
attached renderer just before those fields are read. Mirrors the existing
detail-bar reset_detail_scroll_on_workspace_change pattern.
…impls)

- Remove the redundant trailing `return;` at the end of the chronology-click
  if/else-if chain in app/input.rs: the chain is the last statement in the
  mouse-down arm, so the early return was a no-op (control flow unchanged).
- Replace the manual `impl Default for Side` with `#[derive(Default)]` plus
  `#[default]` on the Right variant. Side::Right stays the default and the
  serde `rename_all = "lowercase"` is preserved.
bakedbean added 23 commits June 5, 2026 16:59
Replace resolve_editor_at_argv's first-token-only check with a scan of
all argv tokens, so window-wrapper configs like `alacritty -e nvim` or
`wezterm start -- code` detect the inner editor and retain the line number.
Adds GotoStyle enum + known_editor_goto helper; extends known editors to
include zed (Goto) and nano (PlusLine). 4 new tests + 6 pre-existing pass.
…orks

Adds a `path` parameter to `resolve_editor_at_argv` and substitutes
`{path}` (the worktree) across all tokens before the `{file}`/`{line}`
logic, so a command like `xdg-terminal-exec --dir={path} nvim` works
for the chronology bar's open-at-line action as well as the dir-open
action. Updates all 12 existing call sites and adds 2 new tests.
README updated to document `{path}` substitution for this action.
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