-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add recent folders overlay (Cmd+O) #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Issue: Need a modal overlay to quickly navigate to recently used directories, with frequency-based ordering (most visited first) and persistence across restarts. Solution: Implemented a new Cmd+O overlay that tracks directory visits and displays them sorted by frequency. The overlay uses arrow key navigation and Cmd+1-9 hotkeys for quick selection. Added line-clearing (Ctrl+U) before sending cd commands to avoid appending to partial input. Extracted the animated "jiggly line" rendering into a shared module used by both worktree and recent folders overlays. Updated pill group to include all three overlays (Help, Recent Folders, Worktree) with proper positioning and mutual exclusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new "Recent Folders" overlay (Cmd+O) that allows users to quickly navigate to frequently visited directories. The overlay displays directories sorted by visit count and persists this data across app restarts in persistence.toml.
Changes:
- Added Recent Folders overlay with keyboard navigation and frequency-based ordering
- Extracted shared animated line rendering into a reusable component
- Enhanced persistence system to track directory visit counts in a TOML table format
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ui/types.zig | Added ChangeDirAction type for directory change commands |
| src/ui/mod.zig | Registered new recent_folders_overlay module |
| src/ui/components/worktree_overlay.zig | Refactored to use shared flowing_line module |
| src/ui/components/recent_folders_overlay.zig | New overlay component with arrow key navigation and Cmd+1-9 hotkeys |
| src/ui/components/pill_group.zig | Added mutual exclusion logic for three overlays |
| src/ui/components/help_overlay.zig | Added Cmd+O shortcut to help text |
| src/ui/components/flowing_line.zig | Extracted reusable animated line rendering |
| src/config.zig | Added visit count tracking and persistence format with migration |
| src/app/worktree.zig | Added Ctrl+U line clearing before directory commands |
| src/app/runtime.zig | Integrated recent folders component and visit tracking |
| docs/configuration.md | Documented new persistence format |
| README.md | Added recent folders feature to documentation |
Comments suppressed due to low confidence (1)
src/config.zig:1
- The modulo 10 operation means the 10th entry (index 9) will display as '⌘0', but entries beyond index 9 will wrap around. This could be confusing if max_folders were increased. Consider adding a comment explaining this behavior or clamping display to only the first 9 entries.
const std = @import("std");
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc1156b5a1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Fix use-after-free: compare cwd pointer identity instead of content after updateCwd (which frees old memory) - Remove double-counting: let updateCwd loop handle appendRecentFolder consistently for all cwd changes - Fix fragile pointer comparison: use nullable variable for toast alloc - Fix missing DPI scaling for line_height in ensureCache
Summary
Changes
New Components
src/ui/components/recent_folders_overlay.zig) - Modal overlay with arrow key navigation and Cmd+1-9 hotkeyssrc/ui/components/flowing_line.zig) - Extracted animated "jiggly line" rendering shared by worktree and recent folders overlaysFeatures
persistence.tomlas[recent_folders]tablePersistence Format
Old persistence formats (array-based) are automatically migrated.
Test plan