Skip to content

Add in-place auto-refresh, --fetch, and a repository path argument - #168

Open
occcat wants to merge 3 commits into
lusingander:masterfrom
occcat:pr/auto-refresh
Open

Add in-place auto-refresh, --fetch, and a repository path argument#168
occcat wants to merge 3 commits into
lusingander:masterfrom
occcat:pr/auto-refresh

Conversation

@occcat

@occcat occcat commented Sep 4, 2026

Copy link
Copy Markdown

Summary

This adds automatic refresh while keeping the existing R reload path usable as a dashboard: no full-screen clear, skip work when git refs have not changed, and restore an in-progress / search instead of dropping ticks.

Related: #159 (same problem, different trade-offs), #94 / #131 (manual refresh), #146 (clearing / flicker).

Behavior

  • -r, --auto-refresh [SECONDS] — poll for local ref changes. Bare flag defaults to 2s. 0 disables. Also core.option.auto_refresh.
  • --fetchgit fetch --all --quiet on a dedicated watch thread before each tick (non-interactive, failures ignored). Implies auto-refresh at 30s unless -r is set. Also core.option.fetch.
  • [PATH] — open a repository other than the current directory.
  • Refresh no longer calls terminal.clear() / deletes every Kitty image first. Graph image IDs are reused; stale IDs are deleted after the new frame.
  • Cheap fingerprint of HEAD / refs / packed-refs skips a full git log when nothing changed.
  • In-progress / search (query + cursor + live matches) is restored across reloads, so auto-refresh does not steal the prompt.

Compared with #159

#159 is still open and currently conflicts with master. This PR overlaps on auto-refresh + fetch, but:

#159 this PR
CLI --watch (min 5s, default 30s) -r / --auto-refresh (default 2s) + --fetch
Unchanged repo always full reload fingerprint skip
Flicker existing R path (terminal.clear) skip clear, reuse image IDs
Search while typing skip the tick restore Searching state
Watch vs keys dedicated watch thread same
Path argument no yes

Happy to rename -r / --auto-refresh to --watch if you prefer to stay aligned with #159.

Test plan

  • cargo test — 78 tests
  • cargo build --release
  • --help shows -r, --fetch, and [PATH]
  • Manual: serie -r 1 + commit in another terminal — new commit appears without a full-screen flash
  • Manual: serie --fetch against a remote — fetch errors do not kill the TUI
  • Manual: serie /path/to/repo from another cwd
  • Manual: type in / search while a tick fires — prompt and cursor remain
  • Manual: suspend user command (e.g. vim) — watch thread pauses and resumes

Thoxvi added 3 commits September 4, 2026 21:10
Reload git refs on an interval without clearing the terminal or
deleting graph images first. Reuse Kitty image IDs across refreshes
and drop only stale images after the new frame is drawn.
Serie previously only opened the current directory, so a trailing
path was rejected as an unexpected argument.
Run git fetch --all on a dedicated watch thread before auto-refresh
ticks, without blocking key input. Persist / search query and cursor
across reloads instead of dropping ticks while the user is typing.
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