Skip to content

fix: resolve correctness, panic, and UX issues from review - #16

Merged
reckerp merged 1 commit into
mainfrom
fix/review-findings
Jun 29, 2026
Merged

fix: resolve correctness, panic, and UX issues from review#16
reckerp merged 1 commit into
mainfrom
fix/review-findings

Conversation

@reckerp

@reckerp reckerp commented Jun 29, 2026

Copy link
Copy Markdown
Owner

A batch of fixes surfaced by a full codebase review. One reported item — the
--amend --date=now rewrite — was deliberately left as-is (intended behavior).

HIGH

  • ai.rs pipe deadlock — stdin is now written on a separate thread while wait_with_output drains stdout/stderr concurrently. Previously commit --ai with a large staged diff could hang forever once the agent's output pipe buffers filled.

MEDIUM

  • commit --amend --ai now diffs the index against HEAD's parent (new get_amend_diff()), so it generates a message from the commit being amended instead of failing with "nothing to commit".
  • repo_setup copy_files parser stops at a ] only when it's outside a quoted value — a ] inside a path no longer silently drops later entries.
  • repo_setup config round-trip — newlines/tabs/CR are escaped in TOML strings (and \r is decoded), so saved configs parse back correctly.
  • File picker & setup file picker now scroll; the cursor could previously move below the fold and off-screen.
  • log_viewer routes scroll adjustment through the guarded shared helper, fixing an underflow panic on very short terminals.
  • worktree add/remove/rebase/branch-delete pass -- before path/ref positionals to prevent argument injection. (Verified checkout must not get --, so it's untouched.)

LOW

  • stash branch extraction locates "on " via ASCII byte-windows on the original string — no more mid-char panic/wrong slice on non-ASCII branch names.
  • pr troubleshoot surfaces a non-zero exit from the interactive agent.
  • branch/workspace pickers no longer type unhandled Ctrl-combos into the search box.
  • recent-commits revwalk is sorted by time (newest first).
  • now_secs falls back to epoch instead of panicking on a pre-1970 clock.
  • gx setup emits aliases in a stable, sorted order.
  • setup script stderr falls back to a duplicated stderr fd when /dev/stderr is unavailable.
  • branch picker fetches branch info off-thread, so it no longer freezes on each selection change.

Also dedupes adjust_scroll into ui::adjust_scroll and syncs Cargo.lock to 0.3.0.

Testing

  • cargo build, cargo clippy --all-targets, and cargo test all pass (127 tests, including 6 new ones covering the array parser, escaping round-trip, and the stash non-ASCII case).

Note: the repo isn't rustfmt-clean to begin with; only the new code here is formatted, leaving pre-existing diffs untouched to keep this PR focused.

Batch of fixes from a codebase review (one intended behavior, the
amend --date=now rewrite, was deliberately left as-is).

HIGH
- ai: write agent stdin on a separate thread to avoid a pipe deadlock
  on large prompts (commit --ai with a big staged diff could hang
  forever once the output pipe buffers filled).

MEDIUM
- commit: --amend --ai now diffs against HEAD's parent instead of the
  index, so it generates a message from the commit being amended
  instead of failing with "nothing to commit".
- repo_setup: stop the copy_files array parser at a ']' only when it
  is outside a quoted value (a ']' in a path no longer drops entries).
- repo_setup: escape newlines/tabs/CR in TOML strings (and decode \r)
  so saved configs round-trip.
- ui: add scrolling to the file picker and setup file picker; the
  cursor could previously move below the fold and off-screen.
- ui/log_viewer: route scroll adjustment through the guarded shared
  helper, fixing an underflow panic on very short terminals.
- git: pass `--` before path/ref positionals in worktree add/remove,
  rebase, and branch delete to prevent argument injection.

LOW
- git/stash: locate "on " in stash messages via ASCII byte windows on
  the original string (lowercasing first could slice mid-char/panic on
  non-ASCII branch names).
- pr: surface a non-zero exit from the interactive troubleshoot agent.
- ui: don't type unhandled Ctrl-combos into the branch/workspace search.
- git/branch: sort the recent-commits revwalk by time (newest first).
- git/time: now_secs falls back to epoch instead of panicking on a
  pre-1970 clock.
- setup: emit shell aliases in a stable, sorted order.
- repo_setup: fall back to a duplicated stderr fd when /dev/stderr is
  unavailable instead of aborting the setup script.
- ui/branch_picker: fetch branch info off-thread so the picker no
  longer freezes on each selection change.

Also dedupes adjust_scroll into ui::adjust_scroll and syncs Cargo.lock
to 0.3.0.
@reckerp
reckerp merged commit c565a49 into main Jun 29, 2026
6 checks passed
@reckerp
reckerp deleted the fix/review-findings branch June 29, 2026 17:43
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