Skip to content

Conversation

@forketyfork
Copy link
Owner

@forketyfork forketyfork commented Jan 29, 2026

Summary

  • Add new Cmd+O overlay for quickly navigating to recently visited directories
  • Directories are sorted by visit frequency (most visited first)
  • Visit counts persist across app restarts

Changes

New Components

  • Recent Folders Overlay (src/ui/components/recent_folders_overlay.zig) - Modal overlay with arrow key navigation and Cmd+1-9 hotkeys
  • Flowing Line (src/ui/components/flowing_line.zig) - Extracted animated "jiggly line" rendering shared by worktree and recent folders overlays

Features

  • Frequency-based ordering: Folders are sorted by visit count, not recency
  • Persistence: Visit counts stored in persistence.toml as [recent_folders] table
  • Line clearing: Sends Ctrl+U before cd commands to clear any partial input
  • Pill group integration: All three overlays (Help ⌘?, Recent ⌘O, Worktree ⌘T) positioned correctly with mutual exclusion

Persistence Format

[recent_folders]
"/Users/me/projects/app" = 15
"/Users/me/projects/lib" = 8
"/Users/me" = 3

Old persistence formats (array-based) are automatically migrated.

Test plan

  • Press Cmd+O to open recent folders overlay
  • Verify arrow key navigation and selection highlight
  • Press Enter or Cmd+1-9 to cd into folder
  • Type partial command, then use overlay - verify line is cleared
  • cd to folders manually, verify they appear in list sorted by frequency
  • Restart app, verify folders and counts persist
  • Verify all three pills (⌘?, ⌘O, ⌘T) display correctly without overlap
  • Verify opening one overlay closes others

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.
@forketyfork forketyfork requested a review from Copilot January 29, 2026 14:12
Copy link

Copilot AI left a 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.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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
@forketyfork forketyfork merged commit 081ea4c into main Jan 29, 2026
4 checks passed
@forketyfork forketyfork deleted the feat/recent-folders-overlay branch January 29, 2026 15:42
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.

2 participants