Skip to content

Brainstorm new features for the project - #4

Merged
dariuszparys merged 5 commits into
mainfrom
claude/brainstorm-feature-ideas-011CUze5rarfTrihbHUfKp5e
Nov 17, 2025
Merged

dariuszparys merged 5 commits into
mainfrom
claude/brainstorm-feature-ideas-011CUze5rarfTrihbHUfKp5e

Conversation

@dariuszparys

@dariuszparys dariuszparys commented Nov 11, 2025 •

Copy link
Copy Markdown
Owner

Summary

Adds directory size display to the interactive fuzzy finder, showing human-readable sizes (e.g., "1.2G", "45.5M") alongside the modification time for each directory. This helps users quickly identify large directories taking up disk space without needing to run separate du commands.

The score metric has been removed from the display as it's an internal ranking value that doesn't provide actionable information to users. It's still used internally for sorting results.

User Impact: The selector now displays 1.2G, 5d ago instead of 5d ago (previously) or 1.2G, 5d ago, 15.3 (briefly).

Changes

  • Add size: u64 field to TryDir model to store directory sizes
  • Implement calculate_dir_size() in util.rs for recursive directory size calculation
  • Move format_human_size() from selector.rs to util.rs for reusability across delete confirmation and display
  • Update TUI render to show size, time format in selector (e.g., "1.2G, 5d ago")
  • Calculate directory sizes during entry loading in load_all()
  • Remove score value from selector display (still used internally for ranking)

Screenshots / TUI Capture (optional)

Include images/GIF or terminal recordings for UI changes.

How to Test

Provide exact commands and expected results, for example:

cargo build
cargo test --all --locked
cargo clippy --all-targets -- -D warnings
cargo run -- cd demo

Checklist

  • Tests added/updated where useful
  • cargo test --all --locked passes locally
  • cargo clippy --all-targets -- -D warnings is clean
  • cargo fmt --all produces no diff
  • Docs updated (README/AGENTS.md) if CLI or behavior changed
  • Linked issues and noted breaking changes

Breaking Changes

None


Note

Displays human-readable directory sizes in the selector with lazy cached computation, and hardens the shell init wrapper to use cmd_status and temp-file output capture (with tests).

  • TUI/Selector:
    • Show right-side meta as size, time (remove score from display) in tui::render.
    • Add TryDir.size: Option<u64> and lazy size computation for visible items with a size_cache in selector.
  • Util:
    • Add calculate_dir_size() and format_human_size(); reuse in delete confirmation and UI.
  • Shell Init Wrapper:
    • Fish: capture $status into cmd_status before eval.
    • POSIX: capture output via temp file and set cmd_status=$?; eval only if non-empty and success.
  • Tests:
    • Add regression test ensuring init script uses cmd_status (not status) and references it correctly.

Written by Cursor Bugbot for commit 51e12b2. This will update automatically on new commits. Configure here.

claude and others added 3 commits November 11, 2025 12:07
Add directory size display to the interactive fuzzy finder, showing sizes
alongside time and score metadata. This helps users quickly identify large
directories taking up disk space.

Changes:
- Add `size: u64` field to TryDir model
- Implement `calculate_dir_size()` in util.rs for recursive size calculation
- Move `format_human_size()` to util.rs for reusability
- Update TUI render to display size as "245.5M, 3d ago, 12.5"
- Calculate sizes during directory loading in selector

Example display: "2025-11-08-experiment  1.2G, 5d ago, 15.3"
Display only size and time metadata in the selector UI. The score is an
internal ranking metric and doesn't provide useful information to users.

Display format is now: "1.2G, 5d ago" instead of "1.2G, 5d ago, 15.3"
This change modifies the init script to correctly utilize cmd_status for capturing command execution status, addressing issues with the read-only status variable in zsh. A regression test has been added to ensure the correct usage of cmd_status in future updates.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread src/selector.rs Resolved
Comment thread src/main.rs Resolved
This commit modifies the TryDir model to change the size field from u64 to Option<u64>, allowing for lazy size calculation. The TrySelector now caches sizes in a HashMap and calculates them only for visible items during rendering, improving performance. The TUI rendering logic has been updated to handle the new size representation, ensuring a seamless user experience.
This commit removes unnecessary whitespace in the main.rs and selector.rs files, enhancing code readability. Additionally, it refines the TUI rendering logic in tui.rs to improve clarity and maintainability, ensuring consistent formatting for size representation.
@dariuszparys
dariuszparys merged commit 00028ec into main Nov 17, 2025
2 checks passed
@dariuszparys
dariuszparys deleted the claude/brainstorm-feature-ideas-011CUze5rarfTrihbHUfKp5e branch November 17, 2025 06:09

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Ghost Directory Sizes Haunt New Paths

When a directory is deleted, all_tries is reset to None to force a reload, but size_cache is not cleared. This causes stale cached sizes to persist for deleted directory paths. If a new directory is later created at the same path, it will incorrectly display the old cached size until the cache entry is manually recalculated.

src/selector.rs#L213-L214

try-rs/src/selector.rs

Lines 213 to 214 in 51e12b2

if self.confirm_and_delete(&mut err, t)? {
self.all_tries = None;

Fix in Cursor Fix in Web


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