Skip to content

Fork-aware PR/review discovery, guided setup, and worklog UX#7

Merged
ashishxcode merged 6 commits into
mainfrom
feat/reviews-onboarding-ux
May 26, 2026
Merged

Fork-aware PR/review discovery, guided setup, and worklog UX#7
ashishxcode merged 6 commits into
mainfrom
feat/reviews-onboarding-ux

Conversation

@ashishxcode
Copy link
Copy Markdown
Owner

Summary

A batch of correctness fixes and DX/UX improvements to commit-chronicle, split into logical, independently-building commits.

Fixes (correctness)

  • Fork-aware GitHub discovery — query every remote, not just origin. In a fork workflow you push to your fork but open PRs / submit reviews against the upstream parent; those were previously invisible.
  • Relative --since anchoring--since today (and yesterday, N days ago) now anchor to local midnight, so they no longer silently miss work committed earlier in the day.
  • Date qualifiers — authored PRs filter by created:; PR-commits and reviews use a lower-bound updated: so in-range items updated again later aren't dropped.
  • Noise removal — merge commits and git-stash entries (index on …, WIP on …) are filtered out of the worklog.

Reviews

  • Reviewed PRs now show your verdict (approved / changes requested / commented) plus the PR state. Any review state counts — a "changes requested" review is included like an approval.

Onboarding / DX

  • Guided first-run setup when no repos are configured: scan common roots, show repo counts, pick one, optionally save it, and report gh auth. Re-runnable via --setup.
  • Actionable messages for no-repos / nothing-found / gh missing.
  • --copy now copies the whole worklog and skips the picker + editor (one-shot "scan and copy").

Output / UX

  • Markdown grouped by date → kind (Commits / Pull requests / Reviews) with a cleaner header and summary line.
  • Scanning spinner shows a completed-phase checklist, the active phase (reviews visible while running), and elapsed time + running total.

Security

  • Sanitize commit/PR text (model.CleanText) to strip terminal escape sequences before display.
  • Add govulncheck to CI; add SECURITY.md.

Commits

  1. feat(model) — review verdict field + text sanitizer
  2. fix(collect) — fork-aware discovery, date handling, richer reviews, noise filtering
  3. feat(render,tui) — grouped markdown, review verdict, livelier spinner
  4. feat(app) — guided setup, better messages, --copy skips picker
  5. chore(security) — govulncheck CI, SECURITY.md, cspell
  6. docs(readme) — quick start, reviews, fork behavior, security

Testing

  • go build ./..., go vet ./..., gofmt, and go test ./... all pass.
  • Each commit verified to build independently (bisect-safe).
  • New unit tests: date qualifiers, slug parsing, noise filter, CleanText, config helpers, review verdict rendering.

- Item.ReviewState carries the user's verdict on a reviewed PR
  (APPROVED / CHANGES_REQUESTED / COMMENTED / …).
- CleanText strips ANSI/OSC escape sequences and control characters
  from externally-sourced text (commit subjects, PR titles) so a crafted
  message cannot inject terminal escapes into the picker, preview, or a
  worklog printed to the terminal.
…iews

GitHub discovery now queries every remote (not just origin), so PRs and
reviews opened against an upstream parent in a fork workflow are found.

- repoSlugs(): collect distinct owner/repo across all remotes, origin first
- createdQualifier / updatedSinceQualifier: date authored PRs by created:,
  and PR-commits/reviews by a lower-bound updated: so in-range items that
  were updated again later aren't dropped
- reviewDayInRange returns the review verdict; any review state counts
- anchorMidnight pins relative --since words (today, yesterday, N days
  ago) to local midnight so "--since today" no longer misses earlier work
- isNoiseSubject drops merge commits and git-stash entries
- sanitize commit/PR titles via model.CleanText
- announce each scan phase before it runs (count 0) so the UI can show the
  active phase, then report its result count

Adds tests for the date qualifiers, slug parsing, and noise filtering.
…r spinner

- Markdown is grouped by date then by kind (Commits / Pull requests /
  Reviews), with a cleaner header and one-line summary.
- Review entries show the verdict (approved / changes requested / …) and
  the PR's state, with a distinct icon per verdict.
- Scanning spinner shows a completed-phase checklist, the phase currently
  running, and elapsed time + running total — so it never looks frozen,
  and the reviews phase is visible while it runs.

Adds render tests for the verdict mapping and review line.
…picker

- First run with no repos launches a guided setup: scan common roots,
  show repo counts, pick one, optionally save it, and report gh auth.
  Re-runnable any time via --setup.
- config gains ErrNoRepos, ScanCommonRoots, CountRepos, SaveRoot.
- Clearer guidance when no repos are configured, nothing is found in
  range, or gh is missing/unauthenticated.
- --copy now copies the whole worklog and skips the picker and editor,
  for a one-shot "scan and copy" flow.

Adds config tests for CountRepos and SaveRoot.
- CI runs govulncheck on every push to catch known vulnerabilities in the
  module and its dependencies.
- SECURITY.md documents the threat model (no shell interpolation, no
  credential handling, text sanitization) and how to report issues.
- Stop .gitignore's *.md rule from hiding SECURITY.md.
- cspell.json whitelists project-specific terms.
- Quick start covering the guided first-run setup and --setup.
- Pull requests & reviews section: reviews are on by default, fork-aware
  discovery, and how to enable via gh.
- Security summary linking SECURITY.md.
- Note --copy skips the picker.
@ashishxcode ashishxcode merged commit 8afd57d into main May 26, 2026
3 of 5 checks passed
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