Skip to content

Conversation

@paris3200
Copy link
Owner

@paris3200 paris3200 commented Jul 7, 2025

Summary

This PR enhances the rename functionality with a new fzf-lua preview interface that shows users which files will be affected during a rename operation.

New Features

  • File Preview Interface: Uses fzf-lua to show a scrollable list of files that will be updated when renaming notes with links
  • Configuration Option: New ui.show_rename_preview setting (default: true) allows users to disable the preview if desired
  • Backward Compatibility: Maintains existing API with optional opts parameter for tests and programmatic usage

User Experience Improvements

  • Users can now see exactly which files contain links to the note being renamed
  • Built-in file previewer allows browsing through affected files before confirming
  • Clear prompts and instructions guide users through the process
  • Option to revert to simple confirmation dialog for faster workflows

Technical Details

  • Refactored rename_note() function to extract rename logic into helper function _perform_rename()
  • Added comprehensive test coverage including config option testing
  • Updated all documentation (README, help files) with new functionality
  • Fixed linting issues and removed debug statements

Testing

  • ✅ All existing tests pass
  • ✅ New test for show_rename_preview configuration option
  • ✅ Linting passes cleanly
  • ✅ Maintains backward compatibility

- Add fzf-lua preview interface showing files that will be updated during rename
- New ui.show_rename_preview config option (default: true) to control behavior
- Maintain backward compatibility with skip_ui option for tests
- Update all documentation (README, help files) with new functionality
- Add comprehensive test coverage for config option
- Clean up debug statements and fix linting issues

Users can now see exactly which files will be affected before confirming
a rename operation, with the ability to preview file contents and disable
the feature if desired.
@paris3200 paris3200 changed the base branch from main to develop July 7, 2025 14:16
paris3200 added 2 commits July 7, 2025 10:35
- Remove confusing second confirmation after preview selection
- Update prompt to clearly indicate Enter executes rename, Esc cancels
- Preview interface now serves as the confirmation step
- Improves user experience by reducing friction
Previously when renaming the currently open file, both old and new file
buffers would remain open, causing confusion. Now properly handles the
buffer transition by updating the current buffer's filename and reloading
it, while gracefully handling any buffer name conflicts.

Also includes luacheck configuration improvements for better code formatting
and increased line length limits for improved readability.
@paris3200 paris3200 merged commit 2471dd5 into develop Jul 7, 2025
4 checks passed
@paris3200 paris3200 deleted the feature/rename-show-affected-files branch July 7, 2025 15:10
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