rufio 0.11.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19b8250183857c347874fd648f1b41883d99e4fe396a31fc9822aae07d89887e
4
- data.tar.gz: 6f4b898c0cc273bdc43e98d3f73f28d4ce29cd09a2ad55f69fe3b356ed150bca
3
+ metadata.gz: 2273fb7a1731d8d60e7a617d9055bdff0f7f5cd92f85eaa36d91dd266cf01773
4
+ data.tar.gz: e599d21775fd19631fca769972977f3a98771afae998b2523e16cf84d2b30d12
5
5
  SHA512:
6
- metadata.gz: 4c8ead01be0c96c710880a4685a249d240fb161264750043c65149b04a0b58e7fa90b0d86900fd08bdfe863be8231c0f67add98c3eae49bf32811d97c947d024
7
- data.tar.gz: f466e43c95e80537eb2d6b20d9310916b7bdf9e0794b3b86526d0acead6a918cb9f1dbf77b2c2bde39988d8941435914b771fb14299efdd0c6b1c6e6e2ddb969
6
+ metadata.gz: 7c66f9c83af723f5a993bfdec6e68b801320394e0912d94431986747e36f86cceea8afc0fa63fc345f2f1a045c1eb8753fb9e1cc238762a49e4f4d5f162f8cb4
7
+ data.tar.gz: 36c12657770e86c3f36054a735761db1e0207bbf70b2a89588b988f33fffc42ed2c00e00ace7595a7f9cc93ed95c3ad1097bbafb732db14d488727417b859345
@@ -0,0 +1,166 @@
1
+ # Changelog v0.20.0 - Project Mode Enhancement & UI Unification
2
+
3
+ ## [0.20.0] - 2025-12-28
4
+
5
+ ### 🎨 Enhanced - Project Mode UI Overhaul
6
+
7
+ Complete UI unification between normal mode and project mode, with improved bookmark management and script execution capabilities.
8
+
9
+ ### Added
10
+
11
+ #### Script Directory Support
12
+ - **Auto-created scripts directory**: `~/.config/rufio/scripts`
13
+ - Automatically created on first run
14
+ - Configurable via `config.rb`
15
+ - Default location: `~/.config/rufio/scripts`
16
+ - **Ruby script execution**: Execute custom Ruby scripts from project mode
17
+ - List all `.rb` files in scripts directory
18
+ - Execute scripts with `:` command mode
19
+ - Sample `hello.rb` script included on initialization
20
+ - **`ProjectCommand#list_scripts`**: Returns list of available Ruby scripts
21
+ - **`ProjectCommand#execute_script`**: Executes selected script in project context
22
+
23
+ #### Bookmark Rename Feature
24
+ - **`r` key in project mode**: Rename bookmark with dialog
25
+ - **`Bookmark#rename(old_name, new_name)`**: Rename bookmark method
26
+ - Automatic name trimming (leading/trailing spaces)
27
+ - Duplicate name validation
28
+ - Same name check
29
+ - **Rename dialog**: Yellow-bordered input dialog
30
+ - Shows old name in title
31
+ - Input validation
32
+ - No result message (cleaner UX)
33
+
34
+ #### File Operations Enhancement
35
+ - **`r` key in normal mode**: Rename file/directory
36
+ - **`d` key in normal mode**: Delete file/directory with confirmation
37
+ - **`a` key**: Create file with dialog input (green border)
38
+ - **`A` key**: Create directory with dialog input (blue border)
39
+ - **`FileOperations#rename`**: Rename files and directories
40
+ - Path separator validation
41
+ - Empty name check
42
+ - Existence validation
43
+ - Conflict detection
44
+
45
+ #### Bookmark Management
46
+ - **`b` key in normal mode**: Direct bookmark addition
47
+ - Shows directory name in title
48
+ - Input dialog for bookmark name
49
+ - Duplicate path detection
50
+ - Green dialog for create operation
51
+ - **`r` key in project mode**: Rename bookmark at cursor
52
+ - **`d` key in project mode**: Delete bookmark at cursor
53
+ - **Unified operation dialogs**:
54
+ - Green: Create operations (file, directory, bookmark)
55
+ - Blue: Directory creation
56
+ - Yellow: Rename operations
57
+ - Red: Delete operations
58
+
59
+ ### Changed
60
+
61
+ #### UI/UX Unification
62
+ - **Project mode selection UI** matches normal mode exactly
63
+ - Selection mark: `✓ ` (checkmark) instead of `*`
64
+ - Selected bookmark: Green background, black text (`\e[42m\e[30m`)
65
+ - Cursor position: Highlighted with selected color from config
66
+ - **Separator display**: Added `│` separator between left and right panes in project mode
67
+ - **Footer display**: Unified with normal mode
68
+ - Simple reverse video style (`\e[7m`)
69
+ - Compact help text: `SPACE:select l:logs ::cmd r:rename d:delete ESC:exit j/k:move`
70
+ - Log mode footer: `ESC:exit log j/k:move`
71
+ - **Right pane layout**: Matches normal mode with separator and content spacing
72
+
73
+ #### Bookmark Operations
74
+ - **Removed bookmark menu**: `b` key now directly adds bookmark
75
+ - **Cursor-based operations**: Rename/delete operate on cursor position
76
+ - No selection dialog needed
77
+ - Faster workflow (one less step)
78
+ - **Single selection model**: Simplified from multiple selection
79
+ - `SPACE` key selects bookmark as project
80
+ - Selected bookmark shown with checkmark
81
+ - Improved command mode compatibility
82
+
83
+ #### Dialog Consistency
84
+ - **All operations use dialogs**: No status line messages
85
+ - **Color coding by operation type**:
86
+ - Create: Green border
87
+ - Directory: Blue border
88
+ - Rename: Yellow border
89
+ - Delete: Red border
90
+ - **No result messages**: Cleaner UX after operations complete
91
+ - **Input dialogs**: Consistent `show_input_dialog` interface
92
+
93
+ ### Technical Changes
94
+
95
+ #### Code Organization
96
+ - **`KeybindHandler#is_bookmark_selected?`**: Removed (simplified selection model)
97
+ - **`KeybindHandler#toggle_bookmark_selection`**: Replaced with `select_bookmark_in_project_mode`
98
+ - **`KeybindHandler#select_bookmark_in_project_mode`**: Single selection for project mode
99
+ - **`KeybindHandler#add_bookmark`**: Direct bookmark addition without menu
100
+ - **`KeybindHandler#rename_bookmark_in_project_mode`**: Cursor-based rename
101
+ - **`KeybindHandler#delete_bookmark_in_project_mode`**: Cursor-based delete
102
+ - **`TerminalUI#draw_bookmark_list`**: Updated to match normal mode UI
103
+ - **`TerminalUI#draw_bookmark_detail`**: Added separator display
104
+ - **`TerminalUI#draw_log_preview`**: Added separator display
105
+ - **`ProjectMode#clear_selection`**: Clear selected project
106
+
107
+ #### Configuration
108
+ - **`ConfigLoader.scripts_dir`**: New configuration option
109
+ - **`ConfigLoader.default_scripts_dir`**: Default scripts directory path
110
+
111
+ ### Removed
112
+
113
+ - **Bookmark menu**: Removed multi-option bookmark menu
114
+ - `b` → `[A]dd` / `[L]ist` / `[R]emove` menu replaced with direct add
115
+ - Individual operations now mapped to dedicated keys
116
+ - **Multiple selection in project mode**: Simplified to single selection
117
+ - Removed `SelectionManager` integration for bookmarks
118
+ - Better command mode compatibility
119
+ - **Result message dialogs**: Removed after rename/delete operations
120
+ - Cleaner user experience
121
+ - Operations complete silently on success
122
+
123
+ ### Key Bindings Summary
124
+
125
+ #### Normal Mode
126
+ - `b`: Add bookmark (direct, no menu)
127
+ - `r`: Rename file/directory
128
+ - `d`: Delete file/directory (with confirmation)
129
+ - `a`: Create file
130
+ - `A`: Create directory
131
+
132
+ #### Project Mode
133
+ - `SPACE`: Select bookmark as project
134
+ - `r`: Rename bookmark at cursor
135
+ - `d`: Delete bookmark at cursor
136
+ - `l`: View logs
137
+ - `:`: Command mode
138
+ - `ESC`: Exit project mode
139
+
140
+ ### UI Color Scheme
141
+
142
+ - **Selection mark**: `✓ ` (green background, black text)
143
+ - **Cursor highlight**: Config-defined selected color
144
+ - **Create dialogs**: Green border (`\e[32m`)
145
+ - **Directory dialogs**: Blue border (`\e[34m`)
146
+ - **Rename dialogs**: Yellow border (`\e[33m`)
147
+ - **Delete dialogs**: Red border (`\e[31m`)
148
+ - **Footer**: Reverse video (`\e[7m`)
149
+
150
+ ### Bug Fixes
151
+
152
+ - **Fixed private method error**: `is_bookmark_selected?` visibility issue resolved
153
+ - **Fixed command mode in project mode**: Single selection model prevents conflicts
154
+ - **Fixed separator display**: Added missing `│` separator in project mode
155
+ - **Fixed footer positioning**: Unified footer line calculation
156
+
157
+ ### Migration Notes
158
+
159
+ - **Breaking change**: `b` key no longer shows menu, directly adds bookmark
160
+ - **Behavior change**: Bookmark operations are now cursor-based in project mode
161
+ - **UI change**: Selection marks changed from `*` to `✓ `
162
+ - Scripts directory will be auto-created at `~/.config/rufio/scripts` on first use
163
+
164
+ ---
165
+
166
+ **Full Changelog**: [v0.19.0...v0.20.0](https://github.com/masisz/rufio/compare/v0.19.0...v0.20.0)
@@ -0,0 +1,175 @@
1
+ # Changelog v0.21.0 - Copy Feature & Code Refactoring
2
+
3
+ ## [0.21.0] - 2025-12-28
4
+
5
+ ### 🎨 Enhanced - File Operations & Code Quality
6
+
7
+ Complete implementation of copy functionality with floating dialog UI, cross-directory selection improvements, and major code refactoring for better maintainability.
8
+
9
+ ### Added
10
+
11
+ #### Copy Feature
12
+ - **`c` key**: Copy selected files to current directory
13
+ - Uses floating confirmation dialog (green border)
14
+ - Shows source and destination paths
15
+ - Supports cross-directory operations
16
+ - Silent completion (no result dialog)
17
+ - **`SelectionManager#source_directory`**: Track directory where files were selected
18
+ - Enables selecting files in one directory and copying/moving to another
19
+ - Automatically set on first selection
20
+ - Cleared when all selections are removed
21
+ - **Copy confirmation dialog**: Green-bordered floating window
22
+ - Displays source and destination paths with smart truncation
23
+ - Consistent with move/delete confirmation UI
24
+ - `[Y]es` / `[N]o` / `ESC` to cancel
25
+
26
+ #### Multiple Selection Delete
27
+ - **Enhanced `x` key**: Delete multiple selected files
28
+ - Checks for selected items first
29
+ - Falls back to single file deletion if no selection
30
+ - Uses floating confirmation dialog showing source path
31
+ - Red border for warning (dangerous operation)
32
+
33
+ #### UI Improvements
34
+ - **Cross-directory selection display**: Selection marks only show in source directory
35
+ - `is_selected?` method checks current directory matches source directory
36
+ - Prevents confusion when navigating to different directories
37
+ - Selection internally maintained for operations
38
+
39
+ ### Changed
40
+
41
+ #### File Operations
42
+ - **Move operation** (`m` key): Uses source directory from SelectionManager
43
+ - Select files → navigate to destination → press `m` to move
44
+ - Blue-bordered confirmation dialog with paths
45
+ - Silent completion
46
+ - **Delete operation** (`x` key):
47
+ - Multiple selection support added
48
+ - Shows source path in confirmation
49
+ - Red-bordered warning dialog
50
+ - **All file operations** now use consistent floating dialog pattern:
51
+ - Red: Delete (dangerous)
52
+ - Blue: Move (informational)
53
+ - Green: Copy (safe)
54
+
55
+ #### Code Quality
56
+ - **terminal_ui.rb refactored**: Reduced from 1139 to 1048 lines (-91 lines)
57
+ - Removed duplicate text utility methods
58
+ - Uses `TextUtils` module for all text operations
59
+ - Better separation of concerns
60
+ - **TextUtils module enhanced**: Added `wrap_preview_lines` method
61
+ - Centralized text display width calculation
62
+ - Multi-byte character support (Japanese, etc.)
63
+ - Consistent truncation and wrapping logic
64
+ - **Method call updates**: All `display_width`, `truncate_to_width` calls use `TextUtils.` prefix
65
+ - Proper module method invocation
66
+ - Fixed runtime errors from refactoring
67
+
68
+ #### Keybind Handler
69
+ - **Removed duplicate method definition**: `show_delete_confirmation`
70
+ - Fixed warning about method redefinition
71
+ - Single source of truth for delete confirmation
72
+ - **Unified confirmation methods**:
73
+ - `show_move_confirmation(count, source_path, dest_path)`
74
+ - `show_copy_confirmation(count, source_path, dest_path)`
75
+ - `show_delete_confirmation(count, source_path)`
76
+
77
+ ### Technical Changes
78
+
79
+ #### SelectionManager Enhancement
80
+ - **`@source_directory` tracking**: Remember where files were selected
81
+ - **`toggle_selection` updated**: Accepts `current_directory` parameter
82
+ - Sets source directory on first selection
83
+ - Maintains source directory for subsequent selections
84
+ - Clears source when all items deselected
85
+ - **Cross-directory operation support**:
86
+ - Select in `/path/A`
87
+ - Navigate to `/path/B`
88
+ - Execute move/copy/delete from original location
89
+
90
+ #### TextUtils Module
91
+ - **New method**: `wrap_preview_lines(lines, max_width)`
92
+ - Intelligent line wrapping for preview pane
93
+ - Preserves empty lines
94
+ - Character-by-character width calculation
95
+ - **Improved display width calculation**: Handles full-width and half-width characters
96
+ - **Smart truncation**: Adds ellipsis when space permits
97
+
98
+ #### KeybindHandler Updates
99
+ - **`move_selected_to_current`**: Uses `@selection_manager.source_directory`
100
+ - **`copy_selected_to_current`**: New method following same pattern as move
101
+ - **`delete_current_file_with_confirmation`**: Checks for selected items first
102
+ - **`is_selected?(entry_name)`**: Validates current directory matches source
103
+ - **Path display helper**: `shorten_path(path, max_length)` for dialog display
104
+
105
+ ### Bug Fixes
106
+
107
+ - **Fixed undefined method error**: `display_width` in terminal_ui.rb
108
+ - Changed to `TextUtils.display_width`
109
+ - Fixed all text utility method calls
110
+ - **Fixed method redefinition warning**: Removed duplicate `show_delete_confirmation`
111
+ - **Fixed cross-directory selection display**: Selection marks only show in source directory
112
+ - Prevents showing same filename selected in different directories
113
+ - Internal selection state maintained correctly
114
+
115
+ ### Documentation
116
+
117
+ - **README.md updated**: Added copy operation documentation
118
+ - Updated File Operations table with Copy row
119
+ - Updated Operation Workflow with `c` key
120
+ - Added copy to File Operations section
121
+ - **README_EN.md updated**: Same updates for English documentation
122
+
123
+ ### Key Bindings Summary
124
+
125
+ #### File Selection & Operations
126
+ - `SPACE`: Select/deselect files and directories
127
+ - `m`: Move selected items to current directory (blue dialog)
128
+ - `c`: Copy selected items to current directory (green dialog)
129
+ - `x`: Delete selected items (red dialog)
130
+
131
+ #### Operation Workflow
132
+ ```
133
+ 1. SPACE → Select files/directories (multiple selection possible)
134
+ 2. Choose operation key:
135
+ - m → Move to current directory
136
+ - c → Copy to current directory
137
+ - x → Delete
138
+ 3. Floating Dialog → Confirm with Y/N, ESC to cancel
139
+ ```
140
+
141
+ #### Cross-Directory Operations
142
+ ```
143
+ 1. Navigate to source directory
144
+ 2. SPACE → Select files
145
+ 3. Navigate to destination directory (selection marks hidden)
146
+ 4. m/c → Move or copy from source to current
147
+ OR navigate back to source
148
+ 5. x → Delete selected files
149
+ ```
150
+
151
+ ### UI Color Scheme
152
+
153
+ - **Copy dialog**: Green border (`\e[32m`) - safe operation
154
+ - **Move dialog**: Blue border (`\e[34m`) - informational
155
+ - **Delete dialog**: Red border (`\e[31m`) - warning/danger
156
+ - **Selection mark**: `✓` with green background (`\e[42m\e[30m`)
157
+ - **Selection visibility**: Only in source directory
158
+
159
+ ### Code Metrics
160
+
161
+ - **Lines of code reduction**: terminal_ui.rb: 1139 → 1048 lines (-8%)
162
+ - **Test coverage**: 309 runs, 1407 assertions, 0 failures
163
+ - **Warnings fixed**: Method redefinition warning eliminated
164
+ - **Module organization**: Better separation with TextUtils module
165
+
166
+ ### Migration Notes
167
+
168
+ - **No breaking changes**: All existing functionality preserved
169
+ - **New feature**: `c` key for copy operation
170
+ - **Behavior improvement**: Selection display now directory-aware
171
+ - **Code quality**: Internal refactoring with no user-facing changes
172
+
173
+ ---
174
+
175
+ **Full Changelog**: [v0.20.0...v0.21.0](https://github.com/masisz/rufio/compare/v0.20.0...v0.21.0)
data/README.md CHANGED
@@ -16,7 +16,6 @@ rufioは、Yaziにインスパイアされたターミナル上で動作する
16
16
  - **コマンドモード**: Tab補完とフローティングウィンドウを備えた強力なコマンドシステム
17
17
  - **ファイルプレビュー**: テキストファイルの内容をその場で確認
18
18
  - **ファイル選択・操作**: 複数ファイルの選択、移動、コピー、削除が可能
19
- - **ベースディレクトリ操作**: 起動ディレクトリへの一括ファイル移動・コピー
20
19
  - **リアルタイムフィルター**: sキーでファイル名の絞り込み表示
21
20
  - **高度な検索機能**: fzfとrgaを使った強力な検索
22
21
  - **マルチプラットフォーム**: macOS、Linux、Windowsで動作
@@ -76,17 +75,19 @@ rufio --help # ヘルプメッセージを表示
76
75
  | ---- | -------------------------------------------------- |
77
76
  | `o` | 選択中のファイルを外部エディタで開く |
78
77
  | `e` | 現在のディレクトリをファイルエクスプローラーで開く |
79
- | `r` | ディレクトリ内容を更新 |
80
- | `a` | 新しいファイルを作成 |
81
- | `A` | 新しいディレクトリを作成 |
78
+ | `R` | ディレクトリ内容を更新 |
79
+ | `r` | ファイル・ディレクトリ名をリネーム |
80
+ | `d` | ファイル・ディレクトリを削除(確認ダイアログ付き) |
81
+ | `a` | 新しいファイルを作成(ダイアログ入力) |
82
+ | `A` | 新しいディレクトリを作成(ダイアログ入力) |
82
83
 
83
84
  #### ファイル選択・操作
84
85
 
85
86
  | キー | 機能 |
86
87
  | ------- | ---------------------------------------------------- |
87
88
  | `Space` | ファイル・ディレクトリを選択・選択解除(複数選択可) |
88
- | `m` | 選択したアイテムをベースディレクトリに移動 |
89
- | `p` | 選択したアイテムをベースディレクトリにコピー |
89
+ | `m` | 選択したアイテムをカレントディレクトリに移動 |
90
+ | `c` | 選択したアイテムをカレントディレクトリにコピー |
90
91
  | `x` | 選択したアイテムを削除 |
91
92
 
92
93
  #### リアルタイムフィルター機能
@@ -108,10 +109,11 @@ rufio --help # ヘルプメッセージを表示
108
109
 
109
110
  #### ブックマーク機能
110
111
 
111
- | キー | 機能 |
112
- | --------- | ---------------------------- |
113
- | `b` | ブックマークメニューを表示 |
114
- | `1`-`9` | 対応する番号のブックマークに移動 |
112
+ | キー | 機能 |
113
+ | --------- | ------------------------------------ |
114
+ | `b` | 現在のディレクトリをブックマークに追加 |
115
+ | `p` | プロジェクトモードに入る |
116
+ | `1`-`9` | 対応する番号のブックマークに移動 |
115
117
 
116
118
  #### zoxide連携機能
117
119
 
@@ -141,17 +143,14 @@ rufio --help # ヘルプメッセージを表示
141
143
  - **選択・選択解除**: `Space`キーでファイルやディレクトリを選択・選択解除
142
144
  - **複数選択**: 複数のファイルやディレクトリを同時に選択可能
143
145
  - **視覚的表示**: 選択されたアイテムは✓マークと緑色の背景で表示
144
- - **選択状態の表示**: 画面上部2行目に選択中のアイテム数が表示
145
146
 
146
- #### ベースディレクトリ操作
147
-
148
- rufio起動時のディレクトリが**ベースディレクトリ**として設定され、選択したファイルの移動・コピー先となります。
147
+ #### ファイル操作
149
148
 
150
- | 操作 | キー | 機能 |
151
- | -------- | ---- | ---------------------------------------- |
152
- | **移動** | `m` | 選択したアイテムをベースディレクトリに移動 |
153
- | **コピー** | `p` | 選択したアイテムをベースディレクトリにコピー |
154
- | **削除** | `x` | 選択したアイテムを削除 |
149
+ | 操作 | キー | 機能 |
150
+ | ---------- | ---- | ---------------------------------------- |
151
+ | **移動** | `m` | 選択したアイテムをカレントディレクトリに移動 |
152
+ | **コピー** | `c` | 選択したアイテムをカレントディレクトリにコピー |
153
+ | **削除** | `x` | 選択したアイテムを削除 |
155
154
 
156
155
  #### 削除操作の詳細
157
156
 
@@ -168,11 +167,11 @@ rufio起動時のディレクトリが**ベースディレクトリ**として
168
167
  ```
169
168
  1. Space → ファイル・ディレクトリを選択(複数選択可)
170
169
  2. 操作キーを選択:
171
- - m → ベースディレクトリに移動
172
- - pベースディレクトリにコピー
170
+ - m → カレントディレクトリに移動
171
+ - cカレントディレクトリにコピー
173
172
  - x → 削除
174
173
  3. フローティングダイアログ → Y/Nで確認、ESCでキャンセル
175
- 4. 結果表示フローティングウィンドウで操作結果を確認
174
+ 4. 操作完了選択解除、画面更新
176
175
  ```
177
176
 
178
177
  #### 安全機能
@@ -223,16 +222,30 @@ rufio起動時のディレクトリが**ベースディレクトリ**として
223
222
 
224
223
  ### ブックマーク機能の詳細
225
224
 
226
- #### ブックマーク操作 (`b`)
227
-
228
- - **ブックマーク追加**: `[A]` - 現在のディレクトリをブックマークに追加
229
- - **ブックマーク一覧**: `[L]` - 登録済みブックマークの一覧表示
230
- - **ブックマーク削除**: `[R]` - ブックマークを削除
231
- - **番号ジャンプ**: `1-9` - 対応する番号のブックマークに直接移動
225
+ #### ブックマーク操作
226
+
227
+ **通常モード:**
228
+ - **`b`キー**: 現在のディレクトリをブックマークに追加
229
+ - ディレクトリ名がタイトルに表示される
230
+ - ブックマーク名を入力して追加
231
+ - 重複パスは自動検出
232
+ - 緑色のダイアログで表示(作成操作)
233
+
234
+ **プロジェクトモード (`p`キー):**
235
+ - **`SPACE`キー**: ブックマークをプロジェクトとして選択
236
+ - 選択されたブックマークは✓マークと緑背景で表示
237
+ - **`r`キー**: カーソル位置のブックマークをリネーム
238
+ - 黄色のダイアログで入力
239
+ - 前後のスペースは自動削除
240
+ - **`d`キー**: カーソル位置のブックマークを削除
241
+ - 赤色の確認ダイアログ表示
242
+ - **`l`キー**: ログモードに入る
243
+ - **`:`キー**: コマンドモード起動
244
+ - **`ESC`キー**: プロジェクトモードを終了
232
245
 
233
246
  #### 高速ナビゲーション (`1`-`9`)
234
247
 
235
- - ブックマークメニューを経由せず、数字キーでブックマークに直接ジャンプ
248
+ - 数字キーでブックマークに直接ジャンプ
236
249
  - 最大9個のブックマークをサポート
237
250
  - ブックマーク情報は画面上部に表示
238
251
 
@@ -240,8 +253,43 @@ rufio起動時のディレクトリが**ベースディレクトリ**として
240
253
 
241
254
  - ブックマーク情報は `~/.config/rufio/bookmarks.json` に自動保存
242
255
  - rufio再起動後もブックマーク情報が保持される
256
+ - 名前の前後のスペースは自動削除されて保存される
243
257
  - JSONファイルを直接編集することも可能
244
258
 
259
+ ### プロジェクトモード機能の詳細
260
+
261
+ #### プロジェクトモード (`p`)
262
+
263
+ プロジェクトモードでは、ブックマークしたディレクトリをプロジェクトとして管理できます。
264
+
265
+ #### スクリプト実行機能
266
+
267
+ - **スクリプトディレクトリ**: `~/.config/rufio/scripts`
268
+ - 初回起動時に自動作成
269
+ - `config.rb`でカスタマイズ可能
270
+ - サンプルスクリプト `hello.rb` が含まれる
271
+ - **スクリプト実行**: `:`キーでコマンドモード起動
272
+ - `.rb`ファイルを一覧表示
273
+ - 選択したスクリプトを実行
274
+ - プロジェクトコンテキストで実行
275
+
276
+ #### UI表示
277
+
278
+ プロジェクトモードのUIは通常モードと統一されています:
279
+
280
+ - **選択マーク**: ✓(チェックマーク)で選択を表示
281
+ - **選択済みブックマーク**: 緑背景、黒文字で表示
282
+ - **カーソル位置**: 設定ファイルの選択色でハイライト
283
+ - **セパレータ**: 左右画面の間に`│`を表示
284
+ - **フッター**: 反転表示でキーバインドを表示
285
+
286
+ #### 操作色の統一
287
+
288
+ - **緑色ダイアログ**: 作成操作(ファイル、ディレクトリ、ブックマーク)
289
+ - **青色ダイアログ**: ディレクトリ作成
290
+ - **黄色ダイアログ**: リネーム操作
291
+ - **赤色ダイアログ**: 削除操作
292
+
245
293
  ### zoxide連携機能の詳細
246
294
 
247
295
  #### zoxide履歴移動 (`z`)
data/README_EN.md CHANGED
@@ -14,8 +14,7 @@ rufio is a terminal-based file manager inspired by Yazi. It's implemented in Rub
14
14
  - **Intuitive Operation**: Vim-like key bindings
15
15
  - **Plugin System**: Extensible plugin architecture
16
16
  - **File Preview**: View text file contents on the fly
17
- - **File Selection & Operations**: Select multiple files, move, copy, and delete
18
- - **Base Directory Operations**: Batch file operations to startup directory
17
+ - **File Selection & Operations**: Select multiple files, move, and delete
19
18
  - **Real-time Filter**: Filter files by name using s key
20
19
  - **Advanced Search**: Powerful search using fzf and rga
21
20
  - **Multi-platform**: Runs on macOS, Linux, and Windows
@@ -85,8 +84,8 @@ rufio --help # Show help message
85
84
  | Key | Function |
86
85
  | ------- | ------------------------------------------- |
87
86
  | `Space` | Select/deselect files and directories |
88
- | `m` | Move selected items to base directory |
89
- | `p` | Copy selected items to base directory |
87
+ | `m` | Move selected items to current directory |
88
+ | `c` | Copy selected items to current directory |
90
89
  | `x` | Delete selected items |
91
90
 
92
91
  #### Real-time Filter
@@ -132,16 +131,13 @@ rufio --help # Show help message
132
131
  - **Select/Deselect**: Use `Space` key to select or deselect files and directories
133
132
  - **Multiple Selection**: Select multiple files and directories simultaneously
134
133
  - **Visual Display**: Selected items are marked with ✓ and highlighted in green
135
- - **Selection Counter**: The number of selected items is shown on the second line of the screen
136
134
 
137
- #### Base Directory Operations
138
-
139
- The directory where rufio starts becomes the **base directory**, which serves as the destination for move and copy operations.
135
+ #### File Operations
140
136
 
141
137
  | Operation | Key | Function |
142
138
  | --------- | --- | --------------------------------------- |
143
- | **Move** | `m` | Move selected items to base directory |
144
- | **Copy** | `p` | Copy selected items to base directory |
139
+ | **Move** | `m` | Move selected items to current directory |
140
+ | **Copy** | `c` | Copy selected items to current directory |
145
141
  | **Delete** | `x` | Delete selected items |
146
142
 
147
143
  #### Delete Operation Details
@@ -159,8 +155,8 @@ The directory where rufio starts becomes the **base directory**, which serves as
159
155
  ```
160
156
  1. Space → Select files/directories (multiple selection possible)
161
157
  2. Choose operation key:
162
- - m → Move to base directory
163
- - p → Copy to base directory
158
+ - m → Move to current directory
159
+ - c → Copy to current directory
164
160
  - x → Delete
165
161
  3. Floating Dialog → Confirm with Y/N, ESC to cancel
166
162
  4. Result Display → Review operation results in floating window
@@ -15,7 +15,6 @@ module Rufio
15
15
  # 各コンポーネントを初期化
16
16
  directory_listing = DirectoryListing.new(@start_directory)
17
17
  keybind_handler = KeybindHandler.new
18
- keybind_handler.set_base_directory(@start_directory)
19
18
  file_preview = FilePreview.new
20
19
  terminal_ui = TerminalUI.new
21
20
 
@@ -15,12 +15,14 @@ module Rufio
15
15
  end
16
16
 
17
17
  def add(path, name)
18
+ trimmed_name = name.strip
19
+ return false if trimmed_name.empty?
18
20
  return false if @bookmarks.length >= MAX_BOOKMARKS
19
- return false if exists_by_name?(name)
21
+ return false if exists_by_name?(trimmed_name)
20
22
  return false if exists_by_path?(path)
21
23
  return false unless Dir.exist?(path)
22
24
 
23
- @bookmarks << { path: File.expand_path(path), name: name }
25
+ @bookmarks << { path: File.expand_path(path), name: trimmed_name }
24
26
  save
25
27
  true
26
28
  end
@@ -28,7 +30,7 @@ module Rufio
28
30
  def remove(name)
29
31
  initial_length = @bookmarks.length
30
32
  @bookmarks.reject! { |bookmark| bookmark[:name] == name }
31
-
33
+
32
34
  if @bookmarks.length < initial_length
33
35
  save
34
36
  true
@@ -37,6 +39,20 @@ module Rufio
37
39
  end
38
40
  end
39
41
 
42
+ def rename(old_name, new_name)
43
+ trimmed_new_name = new_name.strip
44
+ return false if trimmed_new_name.empty?
45
+ return false if old_name == trimmed_new_name
46
+ return false if exists_by_name?(trimmed_new_name)
47
+
48
+ bookmark = @bookmarks.find { |b| b[:name] == old_name }
49
+ return false unless bookmark
50
+
51
+ bookmark[:name] = trimmed_new_name
52
+ save
53
+ true
54
+ end
55
+
40
56
  def get_path(name)
41
57
  bookmark = @bookmarks.find { |b| b[:name] == name }
42
58
  bookmark&.[](:path)