Commit 2be82aa
Fix: Add double-click support for persistent note tabs (#127)
* Fix: Add double-click support for persistent note tabs
- Implements double-click detection (300ms threshold) in tree view
- Single-click: Opens notes in preview mode (italicized tabs)
- Double-click: Opens notes in persistent mode (normal tabs)
- Matches standard VS Code file explorer behavior
Fixes issue where double-clicking notes had no effect and all notes
opened in preview mode only.
* Refactor: Improve double-click detection with IIFE closure
Code review improvements:
- Encapsulate state variables (lastClickedFile, lastClickTime) in IIFE closure
- Change 'let' to 'const' for openNote disposable to prevent reassignment
- Improves maintainability by avoiding scope pollution
- Keeps state tightly coupled with command handler
This refactoring maintains the same functionality while improving code quality.
---------
Co-authored-by: Claude <[email protected]>1 parent e8398fa commit 2be82aa
1 file changed
+25
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
827 | 827 | | |
828 | 828 | | |
829 | 829 | | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
835 | 855 | | |
836 | 856 | | |
837 | 857 | | |
| |||
0 commit comments