Skip to content

feat: activity timeline from git history#9

Draft
gustavoguichard wants to merge 1 commit into
mainfrom
feature/activity-changelog
Draft

feat: activity timeline from git history#9
gustavoguichard wants to merge 1 commit into
mainfrom
feature/activity-changelog

Conversation

@gustavoguichard
Copy link
Copy Markdown
Contributor

Summary

  • Adds itsvertical activity <file> CLI command and a matching web view that reconstruct a per-author event feed for .vertical files from git history. Output is filtered to the events users care about (task completed, layer closed, slice named, etc.) — sorting-only and notesHtml-only changes are intentionally not emitted.
  • Diff is semantic, not textual: cli/activity.ts walks git log --follow, parses the before/after JSON at each commit, and diffs entities by id.
  • Unhappy path is wired end-to-end: GET /api/activity returns { available: false, reason } when the file isn't in a git repo, the CLI exits 1 with the same reason, and the navbar Activity button is hidden in the browser.

What's in here

  • CLI: new activity command with --json, --author, --since, --until, --limit. Pretty TTY output: title banner, per-event blocks (HH:MM ▸ Author + bulleted emoji changes), ✅ Task Completion Log table, 👥 Contributor Summary table, and Total active window footer. Respects NO_COLOR.
  • Server: new GET /api/activity endpoint on the local CLI server.
  • Web: new Activity view fetched from the API, with an author filter, sticky day headers, vertical timeline rail, and stats counters. The button is added to the navbar via a small availability provider that probes the endpoint on mount.
  • Docs: README, CLAUDE.md, and the vertical agent skill.
  • Tests: 12 unit tests for the diff engine in cli/activity.test.ts.

Trying it out

CLI:

pnpm run build
node cli/dist/index.js activity roadmap.vertical
node cli/dist/index.js activity roadmap.vertical --author "Guga" --json

Web:

node cli/dist/index.js dev roadmap.vertical
# visit http://localhost:3456 and click the 🕒 Activity button in the navbar

Unhappy path:

mkdir /tmp/no-git && cp roadmap.vertical /tmp/no-git/test.vertical
node cli/dist/index.js activity /tmp/no-git/test.vertical          # exits 1
node cli/dist/index.js dev /tmp/no-git/test.vertical               # Activity button hidden

Decisions worth a second look

  • Event kinds — see app/file/activity-types.ts. I treated task-added with done:true as task-completed (with an "added as already done" suffix) instead of emitting both an added and completed event. Worth confirming.
  • Schema-only commits — the rich-text-editor commit that touched only notesHtml produces zero events. That collapses your Total active window from 17:04→22:05 to 17:04→19:09. If you want those commits to show up, that's a tiny change in diffStates.
  • Command name — landed on activity over changelog per the earlier discussion (activity matches the Google-Docs reference and avoids the "release notes" connotation). Aliases would be cheap to add.
  • Web button visibility — currently hidden when unavailable. Alternative would be disabled-with-tooltip; happy to switch.

Test plan

  • pnpm run test — 158 tests pass (12 new in cli/activity.test.ts)
  • pnpm run tsc clean
  • pnpm run lint clean
  • pnpm run build succeeds
  • CLI: itsvertical activity roadmap.vertical renders the timeline + tables
  • CLI: --json, --author, --since, --until, --limit flags behave as documented
  • CLI: running against a file outside any git repo exits 1 with a clear message
  • Web: Activity button appears in the navbar; clicking renders the feed
  • Web: author filter updates stats and time range
  • Web: Activity button is hidden when the file isn't in a git repo

🤖 Generated with Claude Code

Adds a per-commit activity feed for .vertical files. The CLI exposes
`itsvertical activity <file>` with --json, --author, --since, --until,
and --limit. The browser UI gains an Activity view (toggleable from the
navbar) that fetches GET /api/activity. When the file isn't in a git
repo, the API returns { available: false, reason }, the CLI exits 1
with a clear error, and the navbar button is hidden.

The diff engine in cli/activity.ts walks git log --follow and diffs
adjacent commits semantically (project, slices, layers, tasks),
ignoring sorting-only and notesHtml-only changes. Event kinds cover
project/slice/layer/task lifecycle.

- cli/activity.ts: diff engine (+ 12 unit tests)
- cli/show-activity.ts: colorized terminal renderer with title banner,
  per-event blocks, completion log table, contributor summary, and
  total active window footer
- /api/activity endpoint added to cli/server.ts
- app/components/activity-view.tsx: web feed with author filter,
  loading/error/unavailable states, sticky day headers
- app/components/activity-availability.tsx: probes the API on mount so
  the navbar can hide the Activity button when unavailable
- Docs: README, CLAUDE.md, and the vertical skill
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