Skip to content

feat: auto-refresh when jj operations complete#194

Open
gariti wants to merge 1 commit into
Cretezy:mainfrom
gariti:feat/auto-refresh
Open

feat: auto-refresh when jj operations complete#194
gariti wants to merge 1 commit into
Cretezy:mainfrom
gariti:feat/auto-refresh

Conversation

@gariti

@gariti gariti commented Jan 11, 2026

Copy link
Copy Markdown

Summary

  • Add file system watching to automatically refresh the UI when external jj operations modify the repository
  • Enables real-time updates when working with multiple terminals or when LLMs make changes
  • Fixes the watch path (uses .jj/repo/op_heads/heads instead of .jj/working_copy)
  • Adds 250ms debounce for rapid events (works well with LLM workflows)

Implementation

  • New event.rs module with EventSource that combines user input and file watching
  • Uses notify crate for cross-platform file watching
  • Uses --ignore-working-copy flag during refresh to avoid conflicts with external operations
  • Watcher is disabled during our own jj operations to prevent feedback loops

Related

Test plan

  • cargo build succeeds
  • cargo test passes (24/25 tests - 1 pre-existing failure on main)
  • Manual testing: Open lazyjj, run jj new in another terminal, verify UI refreshes

Generated with Claude Code

Add file system watching to automatically refresh the UI when external
jj operations modify the repository. This enables real-time updates
when working with multiple terminals or when LLMs make changes.

Implementation:
- Watch .jj/repo/op_heads/heads (only changes when jj ops complete)
- Use notify crate for cross-platform file watching
- Debounce rapid events (250ms) for LLM workflows
- Use --ignore-working-copy during refresh to avoid conflicts
- Disable watcher during our own operations

This addresses the use case of monitoring jj repos while AI assistants
or other tools make changes in separate terminals.

Closes Cretezy#130

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Auto refresh when .jj is touched

1 participant