Finder-style overwrite protection + auto-refreshing picker#26
Merged
neilberkman merged 10 commits intomainfrom Jan 11, 2026
Merged
Finder-style overwrite protection + auto-refreshing picker#26neilberkman merged 10 commits intomainfrom
neilberkman merged 10 commits intomainfrom
Conversation
|
Hello, any idea when this PR might get released? |
When pasting files, pasty now uses macOS Finder's duplicate naming convention instead of silently overwriting existing files. Naming format follows Finder exactly: - photo.png → photo 2.png → photo 3.png - README → README 2 → README 3 - file.tar.gz → file.tar 2.gz (space before number, only last extension) Applies to all paste operations: - Text content pasting - Image data pasting - File reference copying Fixes #25
Users can now use --force (-f) to overwrite existing files instead of automatically creating duplicates with Finder-style naming. Default behavior (safe): Creates duplicates using Finder naming pasty photo.png # creates photo 2.png if photo.png exists With --force (override): Overwrites existing files pasty --force photo.png # overwrites photo.png Changes: - Added Force field to PasteOptions struct - Updated all paste functions to respect force flag - Added -f/--force flag to pasty command - Added tests for force flag behavior Relates to #25
Added brief mentions of Finder-style duplicate naming and --force flag.
Users can now press 'r' while in the interactive picker to refresh the file list. Useful when downloading files while the picker is open. - Added refreshFunc callback to pickerModel - Press 'r' to re-scan directories (recent downloads mode) or re-run search (spotlight mode) - Preserves cursor position when possible after refresh - Updated help text to show refresh key
The picker now watches Downloads/Desktop directories for new files and automatically refreshes the list when files are added. No more pressing 'r'! - Added fsnotify dependency for cross-platform FS events - Picker monitors watched directories in background - Auto-refreshes when Create events detected - Works for recent downloads mode (watches directories) - Spotlight mode doesn't watch (re-search isn't instant) - Manual 'r' key still works as fallback When you download a file while the picker is open, it appears automatically within ~1 second.
Auto-monitoring already refreshes the list automatically when files are added, so the manual 'r' key is unnecessary complexity. Simpler is better.
When the file list auto-refreshes, keep the cursor on the same file by name instead of by index. This prevents accidentally selecting a newly appeared file if it appears where the cursor was positioned. Example: User on 'report.pdf' at position 3. New file 'download.zip' appears at top. Cursor stays on 'report.pdf' (now at position 4) instead of moving to 'download.zip' at position 3. Prevents accidental selection when files appear during download.
New files that appear during auto-refresh are now highlighted in bold yellow for 3 seconds, making them immediately visible to users.
.tar.gz, .tar.bz2, .tar.xz, .tar.zst now handled correctly: - archive.tar.gz → archive 2.tar.gz (not archive.tar 2.gz) Added splitExtension() helper to detect multi-part extensions.
f5c7f53 to
426a85e
Compare
Owner
Author
@ktowen just released! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pasty: Finder-style overwrite protection
Pasty now uses macOS Finder's duplicate naming instead of silently overwriting files.
photo.png→photo 2.png→photo 3.pngREADME→README 2→README 3file.tar.gz→file.tar 2.gzAdd
--force/-fto override and allow overwriting when desired.Clippy picker: Auto-refresh
The interactive picker now watches Downloads/Desktop directories and automatically refreshes when new files appear.
Fixes #25