beniya 0.8.0 โ†’ 0.9.1

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: d90ab1b62a7576283298109004873e5add5aafc1ddf15d545c426ee9103a09ba
4
- data.tar.gz: 425added333fc0722338e830f362a16d0e2e30c5f5228d7c84f837cdb0dc15d2
3
+ metadata.gz: 3ed952c2b36c035a5a7ae8aa48a0dd9660474662f4ae4e3dc655e77b328b92ba
4
+ data.tar.gz: 4a5c3a7574b283a46cc5a91cde33ef1638d9be8c92d6a44b9dddf907a3c0bbd4
5
5
  SHA512:
6
- metadata.gz: 56569d00c298f6ad30a22e216189013d9aad0a3a4fa9e6f850e037e09d5fec22ab47062209eef1f2f7b4c51ea6569bd818109ef2340416c2768401883e6e327c
7
- data.tar.gz: d671303c256de4bf66383dd59b9bf8a20f7d2e0c0d480c20024245539dd9caaffe8ad4f8f2cd807220391c67ccf0a546d46cf4635629d5b4c8ffbc9739000d01
6
+ metadata.gz: 3bc682b199597c239ba1a71ab9254f271232ac74a5d4f07eb6ba4ba53b505ca714bfc5efb5e7f9ab9e058527f5c5f724e4c30b4357a1ca057b200227bac30262
7
+ data.tar.gz: 4b6804dc73b11b8c31ceee249c587d2c2f2306e720d16629b0456a0594f4960e3dda87414df325fb714b32daf3b23e92eb6335e1e127b30b4d4c46a9fffc57cb
@@ -0,0 +1,279 @@
1
+ # CHANGELOG - beniya v0.9.0
2
+
3
+ **Release Date**: 2024-12-13
4
+
5
+ ## ๐Ÿš€ New Features
6
+
7
+ ### Command Mode Input Floating Window
8
+
9
+ - **Floating Window for Command Input**: Command mode input now displays in a modern floating window
10
+ - Moved from bottom line to centered floating window
11
+ - Consistent with other UI elements (bookmarks, results)
12
+ - Blue border for clear visual identification
13
+ - Always-visible keyboard shortcuts help text
14
+
15
+ - **Integrated Completion Suggestions**: Tab completion suggestions display directly in the input window
16
+ - Real-time suggestion list updates as you type
17
+ - Clear visual separation between input and suggestions
18
+ - No need to guess available commands
19
+
20
+ - **Enhanced Visual Feedback**:
21
+ - Input prompt with cursor indicator
22
+ - Automatic window sizing based on content
23
+ - Clean, uncluttered interface
24
+ - Professional appearance matching beniya's design language
25
+
26
+ ### CommandModeUI Enhancements
27
+
28
+ - **New Method** (`show_input_prompt`): Displays command input in floating window
29
+ - `show_input_prompt(input, suggestions)`: Shows input prompt with optional completion suggestions
30
+ - Automatic integration with TerminalUI
31
+ - Consistent color scheme (blue border, white content)
32
+
33
+ ## ๐ŸŽจ UI/UX Improvements
34
+
35
+ ### Modern Command Input Experience
36
+
37
+ Before (v0.8.0):
38
+ ```
39
+ [File listing...]
40
+ [Footer...]
41
+ :helloโ–ˆ โ† Input at bottom of screen
42
+ ```
43
+
44
+ After (v0.9.0):
45
+ ```
46
+ [File listing centered behind floating window...]
47
+
48
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
49
+ โ”‚ ใ‚ณใƒžใƒณใƒ‰ใƒขใƒผใƒ‰ โ”‚ (Blue)
50
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
51
+ โ”‚ โ”‚
52
+ โ”‚ hello_ โ”‚
53
+ โ”‚ โ”‚
54
+ โ”‚ ่ฃœๅฎŒๅ€™่ฃœ: โ”‚
55
+ โ”‚ hello โ”‚
56
+ โ”‚ help โ”‚
57
+ โ”‚ health โ”‚
58
+ โ”‚ โ”‚
59
+ โ”‚ Tab: ่ฃœๅฎŒ | Enter: ๅฎŸ่กŒ | ESC: ใ‚ญใƒฃใƒณใ‚ปใƒซ โ”‚
60
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
61
+ ```
62
+
63
+ ### Key Improvements
64
+
65
+ - **Centered Display**: Input window appears in screen center for better focus
66
+ - **Contextual Help**: Keyboard shortcuts always visible
67
+ - **Live Suggestions**: Completion suggestions update in real-time
68
+ - **Consistent Design**: Matches bookmark and result windows
69
+ - **No Screen Clutter**: Floating window doesn't interfere with file listing
70
+
71
+ ## ๐Ÿ”ง Technical Improvements
72
+
73
+ ### Architecture
74
+
75
+ - **Removed Legacy Methods**:
76
+ - Removed `draw_command_input`: Bottom-line input rendering (obsolete)
77
+ - Removed `draw_command_result`: Bottom-line result display (obsolete)
78
+ - Cleaner codebase with focused responsibilities
79
+
80
+ - **TextUtils Enhancement**:
81
+ - Added Unicode ranges for box drawing characters (\u2500-\u257F)
82
+ - Added Unicode ranges for block elements (\u2580-\u259F)
83
+ - Improved width calculation for special characters
84
+
85
+ ### Integration
86
+
87
+ - **Automatic Display**: Command mode floating window shows automatically when activated
88
+ - **Suggestion Integration**: Autocomplete suggestions fetched and displayed seamlessly
89
+ - **Screen Refresh**: Proper screen redraw after command execution
90
+
91
+ ## ๐Ÿ› Bug Fixes
92
+
93
+ ### Display Width Issues
94
+
95
+ - **Fixed Cursor Symbol Display**: Changed from โ–ˆ (full-width block) to _ (half-width underscore)
96
+ - Resolved right border misalignment in command input window
97
+ - Full-width block characters (โ–ˆ) have ambiguous width in different terminals
98
+ - Underscore (_) ensures consistent width across all terminal emulators
99
+
100
+ - **Improved Character Width Detection**:
101
+ - Added support for box drawing characters in TextUtils
102
+ - Added support for block elements in TextUtils
103
+ - More accurate display width calculation
104
+
105
+ - **Removed Colon Prefix**: Removed redundant `:` from input display
106
+ - Window title already indicates "ใ‚ณใƒžใƒณใƒ‰ใƒขใƒผใƒ‰"
107
+ - Cleaner, less cluttered appearance
108
+
109
+ ## ๐Ÿงช Testing
110
+
111
+ ### Test-Driven Development
112
+
113
+ - **TDD Approach**: All features developed following strict TDD methodology
114
+ 1. Wrote comprehensive tests first (4 new tests)
115
+ 2. Verified tests failed as expected
116
+ 3. Implemented features to pass tests
117
+ 4. Committed tests before implementation
118
+
119
+ ### New Tests Added
120
+
121
+ - **Command Input Floating Window Tests** (`test/test_command_mode_ui.rb`):
122
+ - `test_show_input_prompt_basic`: Basic input prompt display
123
+ - `test_show_input_prompt_empty_input`: Empty input handling
124
+ - `test_show_input_prompt_with_suggestions`: Suggestions display
125
+ - `test_show_input_prompt_color`: Border color verification
126
+
127
+ ### Test Coverage
128
+
129
+ - **20 tests, 60 assertions**: Comprehensive coverage of CommandModeUI
130
+ - **261 total tests, 1137 assertions**: Full test suite
131
+ - **All tests passing**: 100% success rate
132
+
133
+ ## ๐Ÿ“ฆ Dependencies
134
+
135
+ ### No New Dependencies
136
+
137
+ - Uses existing Ruby standard library
138
+ - Leverages existing beniya components:
139
+ - `DialogRenderer`: For floating window rendering
140
+ - `CommandMode`: For command execution
141
+ - `TextUtils`: For text width calculations
142
+
143
+ ## ๐Ÿ”„ Compatibility
144
+
145
+ ### Backward Compatibility
146
+
147
+ - **No Breaking Changes**: All existing features work as before
148
+ - **Enhanced UI**: Command mode now has better UX without changing functionality
149
+ - **Existing Keybindings Preserved**: `:` still activates command mode
150
+
151
+ ### Platform Support
152
+
153
+ - **macOS**: Full support โœ…
154
+ - **Linux**: Full support โœ…
155
+ - **Windows**: Full support โœ…
156
+
157
+ ## โšก Performance
158
+
159
+ ### Optimizations
160
+
161
+ - **No Performance Impact**: Floating window rendering is fast and efficient
162
+ - **Cached Calculations**: Window dimensions calculated once per render
163
+ - **Minimal Overhead**: Features only active when command mode is engaged
164
+
165
+ ## ๐Ÿ“ Usage Examples
166
+
167
+ ### Using the New Command Input
168
+
169
+ ```bash
170
+ # Launch beniya
171
+ beniya
172
+
173
+ # Activate command mode
174
+ Press ':'
175
+
176
+ # Floating window appears in center:
177
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
178
+ โ”‚ ใ‚ณใƒžใƒณใƒ‰ใƒขใƒผใƒ‰ โ”‚
179
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
180
+ โ”‚ โ”‚
181
+ โ”‚ _ โ”‚
182
+ โ”‚ โ”‚
183
+ โ”‚ Tab: ่ฃœๅฎŒ | Enter: ๅฎŸ่กŒ | ESC: ใ‚ญใƒฃใƒณใ‚ปใƒซ โ”‚
184
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
185
+
186
+ # Type partial command
187
+ Type "he"
188
+
189
+ # Window updates with suggestions:
190
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
191
+ โ”‚ ใ‚ณใƒžใƒณใƒ‰ใƒขใƒผใƒ‰ โ”‚
192
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
193
+ โ”‚ โ”‚
194
+ โ”‚ he_ โ”‚
195
+ โ”‚ โ”‚
196
+ โ”‚ ่ฃœๅฎŒๅ€™่ฃœ: โ”‚
197
+ โ”‚ hello โ”‚
198
+ โ”‚ help โ”‚
199
+ โ”‚ health โ”‚
200
+ โ”‚ โ”‚
201
+ โ”‚ Tab: ่ฃœๅฎŒ | Enter: ๅฎŸ่กŒ | ESC: ใ‚ญใƒฃใƒณใ‚ปใƒซ โ”‚
202
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
203
+
204
+ # Press Tab to complete
205
+ # Press Enter to execute
206
+ # Press ESC to cancel
207
+ ```
208
+
209
+ ### Visual Improvements
210
+
211
+ **Before (v0.8.0)**: Input at bottom of screen, suggestions not visible
212
+ **After (v0.9.0)**: Input in centered floating window, suggestions always visible
213
+
214
+ ## ๐Ÿ”ฎ Future Plans
215
+
216
+ ### Planned Enhancements
217
+
218
+ - **Command History**: Navigate through previously executed commands with โ†‘/โ†“ arrows
219
+ - **Command Arguments**: Support for commands with parameters
220
+ - **Auto-complete Menu**: Visual menu showing all available completions
221
+ - **Command Aliases**: User-defined shortcuts for frequently used commands
222
+ - **Inline Help**: Show command descriptions during completion
223
+
224
+ ## ๐Ÿ™ Acknowledgments
225
+
226
+ Main contributions in this version:
227
+
228
+ - **Test-Driven Development**: Strict TDD methodology ensuring code quality
229
+ - **Consistent UI/UX**: Unified floating window design across all features
230
+ - **User Experience Focus**: Improved command discoverability and feedback
231
+ - **Cross-platform Compatibility**: Cursor symbol fix for all terminal emulators
232
+
233
+ ## ๐Ÿ“‹ Detailed Changes
234
+
235
+ ### Files Modified
236
+
237
+ - `lib/beniya/command_mode_ui.rb`:
238
+ - Added `show_input_prompt` method
239
+ - Removed obsolete display code
240
+ - `lib/beniya/terminal_ui.rb`:
241
+ - Integrated floating window for command input
242
+ - Removed `draw_command_input` method
243
+ - Removed `draw_command_result` method
244
+ - `lib/beniya/text_utils.rb`:
245
+ - Enhanced character width detection
246
+ - Added box drawing and block element ranges
247
+ - `test/test_command_mode_ui.rb`:
248
+ - Added 4 new tests for input prompt display
249
+
250
+ ### Files Created
251
+
252
+ - None (all changes to existing files)
253
+
254
+ ### Lines of Code
255
+
256
+ - **Added**: ~50 lines (implementation)
257
+ - **Modified**: ~10 lines
258
+ - **Removed**: ~30 lines (obsolete methods)
259
+ - **Net Change**: ~30 lines added
260
+
261
+ ### Commit History
262
+
263
+ ```
264
+ 478971b fix: ใ‚ซใƒผใ‚ฝใƒซ่จ˜ๅทใ‚’โ–ˆใ‹ใ‚‰_ใซๅค‰ๆ›ดใ—ใฆ่กจ็คบๅดฉใ‚Œใ‚’ไฟฎๆญฃ
265
+ d09831f fix: ็ฝซ็ทšๆ–‡ๅญ—ใจใƒ–ใƒญใƒƒใ‚ฏ่ฆ็ด ใฎ่กจ็คบๅน…ใ‚’ไฟฎๆญฃ
266
+ 2ba2785 refactor: ใ‚ณใƒžใƒณใƒ‰ใƒขใƒผใƒ‰ๅ…ฅๅŠ›ใ‹ใ‚‰ใ‚ณใƒญใƒณใ‚’ๅ‰Š้™ค
267
+ f89693a feat: ใ‚ณใƒžใƒณใƒ‰ๅ…ฅๅŠ›ใ‚’ใƒ•ใƒญใƒผใƒ†ใ‚ฃใƒณใ‚ฐใ‚ฆใ‚ฃใƒณใƒ‰ใ‚ฆใซๅค‰ๆ›ด
268
+ 3ab01af test: ใ‚ณใƒžใƒณใƒ‰ๅ…ฅๅŠ›ใƒ•ใƒญใƒผใƒ†ใ‚ฃใƒณใ‚ฐใ‚ฆใ‚ฃใƒณใƒ‰ใ‚ฆใฎใƒ†ใ‚นใƒˆใ‚’่ฟฝๅŠ 
269
+ ```
270
+
271
+ ## ๐ŸŽฏ Summary
272
+
273
+ Version 0.9.0 brings a significant UI/UX improvement to command mode by introducing a modern floating window interface for command input. This change provides better visual feedback, integrates completion suggestions directly into the input window, and maintains consistency with other beniya features. All changes were developed using TDD methodology and are fully tested with 100% test pass rate.
274
+
275
+ ---
276
+
277
+ **Note**: This version focuses on UI/UX polish and consistency. The command mode functionality remains the same, but the user experience is significantly enhanced with the new floating window interface.
278
+
279
+ **GitHub Issues**: [https://github.com/masisz/beniya/issues](https://github.com/masisz/beniya/issues)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # beniya
2
2
 
3
+ > **ๆณจๆ„**: ใ“ใฎใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใฏ[rufio](https://github.com/masisz/rufio)ใซ็งป่กŒใ—ใพใ—ใŸใ€‚ไปŠๅพŒใฎ้–‹็™บใƒปใƒกใƒณใƒ†ใƒŠใƒณใ‚นใฏrufioใง่กŒใ‚ใ‚Œใพใ™ใ€‚beniyaใฏไฟๅฎˆใƒขใƒผใƒ‰ใจใชใ‚Šใ€ๆ–ฐๆฉŸ่ƒฝใฎ่ฟฝๅŠ ใฏ่กŒใ‚ใ‚Œใพใ›ใ‚“ใ€‚
4
+
3
5
  Ruby่ฃฝใฎใ‚ฟใƒผใƒŸใƒŠใƒซใƒ™ใƒผใ‚นใƒ•ใ‚กใ‚คใƒซใƒžใƒใƒผใ‚ธใƒฃใƒผ
4
6
 
5
7
  **ๆ—ฅๆœฌ่ชž** | [English](./README_EN.md)
data/README_EN.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # beniya
2
2
 
3
+ > **Notice**: This project has been migrated to [rufio](https://github.com/masisz/rufio). Future development and maintenance will be done in rufio. beniya is now in maintenance mode and no new features will be added.
4
+
3
5
  A terminal-based file manager written in Ruby
4
6
 
5
7
  [ๆ—ฅๆœฌ่ชž็‰ˆ](./README.md) | **English**
data/beniya.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ['masisz.1567@gmail.com']
10
10
 
11
11
  spec.summary = 'Ruby file manager'
12
- spec.description = 'A terminal-based file manager inspired by Yazi, written in Ruby with plugin support'
12
+ spec.description = '[DEPRECATED] This project has been migrated to rufio (https://github.com/masisz/rufio). A terminal-based file manager inspired by Yazi, written in Ruby with plugin support'
13
13
  spec.homepage = 'https://github.com/masisz/beniya'
14
14
  spec.license = 'MIT'
15
15
  spec.required_ruby_version = '>= 2.7.0'
@@ -19,6 +19,22 @@ Gem::Specification.new do |spec|
19
19
  spec.metadata['source_code_uri'] = 'https://github.com/masisz/beniya'
20
20
  spec.metadata['changelog_uri'] = 'https://github.com/masisz/beniya/blob/main/CHANGELOG.md'
21
21
 
22
+ spec.post_install_message = <<~MSG
23
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
24
+ โ”‚ โ”‚
25
+ โ”‚ โš ๏ธ DEPRECATED: beniya has been migrated to rufio โ”‚
26
+ โ”‚ โ”‚
27
+ โ”‚ This project is now in maintenance mode. โ”‚
28
+ โ”‚ Please use rufio for new features and active development. โ”‚
29
+ โ”‚ โ”‚
30
+ โ”‚ Install rufio: โ”‚
31
+ โ”‚ gem install rufio โ”‚
32
+ โ”‚ โ”‚
33
+ โ”‚ More info: https://github.com/masisz/rufio โ”‚
34
+ โ”‚ โ”‚
35
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
36
+ MSG
37
+
22
38
  spec.files = Dir.chdir(__dir__) do
23
39
  `git ls-files -z`.split("\x0").reject do |f|
24
40
  (File.expand_path(f) == __FILE__) ||
@@ -40,6 +40,52 @@ module Beniya
40
40
  find_common_prefix(suggestions)
41
41
  end
42
42
 
43
+ # ใ‚ณใƒžใƒณใƒ‰ๅ…ฅๅŠ›ใƒ—ใƒญใƒณใƒ—ใƒˆใ‚’ใƒ•ใƒญใƒผใƒ†ใ‚ฃใƒณใ‚ฐใ‚ฆใ‚ฃใƒณใƒ‰ใ‚ฆใง่กจ็คบ
44
+ # @param input [String] ็พๅœจใฎๅ…ฅๅŠ›ๆ–‡ๅญ—ๅˆ—
45
+ # @param suggestions [Array<String>] ่ฃœๅฎŒๅ€™่ฃœ๏ผˆใ‚ชใƒ—ใ‚ทใƒงใƒณ๏ผ‰
46
+ def show_input_prompt(input, suggestions = [])
47
+ # ใ‚ฟใ‚คใƒˆใƒซ
48
+ title = "ใ‚ณใƒžใƒณใƒ‰ใƒขใƒผใƒ‰"
49
+
50
+ # ใ‚ณใƒณใƒ†ใƒณใƒ„่กŒใ‚’ๆง‹็ฏ‰
51
+ content_lines = [""]
52
+ content_lines << "#{input}_" # ใ‚ซใƒผใ‚ฝใƒซใ‚’_ใง่กจ็พ
53
+ content_lines << ""
54
+
55
+ # ่ฃœๅฎŒๅ€™่ฃœใŒใ‚ใ‚‹ๅ ดๅˆใฏ่กจ็คบ
56
+ unless suggestions.empty?
57
+ content_lines << "่ฃœๅฎŒๅ€™่ฃœ:"
58
+ suggestions.each do |suggestion|
59
+ content_lines << " #{suggestion}"
60
+ end
61
+ content_lines << ""
62
+ end
63
+
64
+ content_lines << "Tab: ่ฃœๅฎŒ | Enter: ๅฎŸ่กŒ | ESC: ใ‚ญใƒฃใƒณใ‚ปใƒซ"
65
+
66
+ # ใ‚ฆใ‚ฃใƒณใƒ‰ใ‚ฆใฎ่‰ฒ่จญๅฎš๏ผˆ้’๏ผ‰
67
+ border_color = "\e[34m" # Blue
68
+ title_color = "\e[1;34m" # Bold blue
69
+ content_color = "\e[37m" # White
70
+
71
+ # ใ‚ฆใ‚ฃใƒณใƒ‰ใ‚ฆใ‚ตใ‚คใ‚บใ‚’่จˆ็ฎ—
72
+ width, height = @dialog_renderer.calculate_dimensions(content_lines, {
73
+ title: title,
74
+ min_width: 50,
75
+ max_width: 80
76
+ })
77
+
78
+ # ไธญๅคฎไฝ็ฝฎใ‚’่จˆ็ฎ—
79
+ x, y = @dialog_renderer.calculate_center(width, height)
80
+
81
+ # ใƒ•ใƒญใƒผใƒ†ใ‚ฃใƒณใ‚ฐใ‚ฆใ‚ฃใƒณใƒ‰ใ‚ฆใ‚’ๆ็”ป
82
+ @dialog_renderer.draw_floating_window(x, y, width, height, title, content_lines, {
83
+ border_color: border_color,
84
+ title_color: title_color,
85
+ content_color: content_color
86
+ })
87
+ end
88
+
43
89
  # ใ‚ณใƒžใƒณใƒ‰ๅฎŸ่กŒ็ตๆžœใ‚’ใƒ•ใƒญใƒผใƒ†ใ‚ฃใƒณใ‚ฐใ‚ฆใ‚ฃใƒณใƒ‰ใ‚ฆใง่กจ็คบ
44
90
  # @param result [String, nil] ใ‚ณใƒžใƒณใƒ‰ๅฎŸ่กŒ็ตๆžœ
45
91
  def show_result(result)
@@ -0,0 +1,105 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+
5
+ module Beniya
6
+ # Manages the deprecation notice for the transition from beniya to rufio
7
+ class DeprecationNotice
8
+ NOTICE_FILE = File.join(Dir.home, '.beniya', '.deprecation_notice_shown')
9
+
10
+ def initialize
11
+ ensure_config_directory
12
+ end
13
+
14
+ # Check if the notice should be shown
15
+ # @return [Boolean] true if the notice should be shown
16
+ def should_show?
17
+ !File.exist?(NOTICE_FILE)
18
+ end
19
+
20
+ # Mark the notice as shown
21
+ def mark_as_shown
22
+ FileUtils.touch(NOTICE_FILE)
23
+ end
24
+
25
+ # Get the notice title
26
+ # @return [String] The notice title
27
+ def title
28
+ ConfigLoader.message('deprecation.title')
29
+ rescue StandardError
30
+ '้‡่ฆใชใŠ็Ÿฅใ‚‰ใ› / Important Notice'
31
+ end
32
+
33
+ # Get the notice content lines
34
+ # @return [Array<String>] The notice content lines
35
+ def content
36
+ if ConfigLoader.language == 'ja'
37
+ japanese_content
38
+ else
39
+ english_content
40
+ end
41
+ rescue StandardError
42
+ # Fallback content if ConfigLoader fails
43
+ fallback_content
44
+ end
45
+
46
+ private
47
+
48
+ def ensure_config_directory
49
+ config_dir = File.join(Dir.home, '.beniya')
50
+ FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
51
+ end
52
+
53
+ def japanese_content
54
+ [
55
+ '',
56
+ 'beniyaใฏrufioใซๆ”นๅใ•ใ‚Œใพใ—ใŸใ€‚',
57
+ '',
58
+ 'ไปŠๅพŒใฎ้–‹็™บใจใ‚ตใƒใƒผใƒˆใฏrufioใง็ถ™็ถšใ•ใ‚Œใพใ™ใ€‚',
59
+ 'beniyaใฏ้žๆŽจๅฅจใจใชใ‚Šใ€ๅฐ†ๆฅ็š„ใซๅ‰Š้™คใ•ใ‚Œใ‚‹ไบˆๅฎšใงใ™ใ€‚',
60
+ '',
61
+ '็งป่กŒๆ–นๆณ•:',
62
+ ' 1. gem uninstall beniya',
63
+ ' 2. gem install rufio',
64
+ '',
65
+ '่ฉณ็ดฐ: https://github.com/masisz/rufio',
66
+ '',
67
+ 'ไปปๆ„ใฎใ‚ญใƒผใ‚’ๆŠผใ—ใฆ็ถš่กŒ...',
68
+ ''
69
+ ]
70
+ end
71
+
72
+ def english_content
73
+ [
74
+ '',
75
+ 'beniya has been renamed to rufio.',
76
+ '',
77
+ 'Future development and support will continue as rufio.',
78
+ 'beniya is now deprecated and will be removed in the future.',
79
+ '',
80
+ 'Migration steps:',
81
+ ' 1. gem uninstall beniya',
82
+ ' 2. gem install rufio',
83
+ '',
84
+ 'More info: https://github.com/masisz/rufio',
85
+ '',
86
+ 'Press any key to continue...',
87
+ ''
88
+ ]
89
+ end
90
+
91
+ def fallback_content
92
+ [
93
+ '',
94
+ 'beniya has been renamed to rufio.',
95
+ 'beniyaใฏrufioใซๆ”นๅใ•ใ‚Œใพใ—ใŸใ€‚',
96
+ '',
97
+ 'Please install rufio instead:',
98
+ ' gem install rufio',
99
+ '',
100
+ 'Press any key to continue...',
101
+ ''
102
+ ]
103
+ end
104
+ end
105
+ end
@@ -60,6 +60,9 @@ module Beniya
60
60
  @running = true
61
61
  setup_terminal
62
62
 
63
+ # Show deprecation notice if needed
64
+ show_deprecation_notice_if_needed
65
+
63
66
  begin
64
67
  main_loop
65
68
  ensure
@@ -131,12 +134,12 @@ module Beniya
131
134
  # footer
132
135
  draw_footer
133
136
 
134
- # ใ‚ณใƒžใƒณใƒ‰ๅฎŸ่กŒ็ตๆžœใ‚’่กจ็คบ
135
- draw_command_result
136
-
137
- # ใ‚ณใƒžใƒณใƒ‰ใƒขใƒผใƒ‰ใŒใ‚ขใ‚ฏใƒ†ใ‚ฃใƒ–ใชๅ ดๅˆใฏใ‚ณใƒžใƒณใƒ‰ๅ…ฅๅŠ›ๆฌ„ใ‚’่กจ็คบ
137
+ # ใ‚ณใƒžใƒณใƒ‰ใƒขใƒผใƒ‰ใŒใ‚ขใ‚ฏใƒ†ใ‚ฃใƒ–ใชๅ ดๅˆใฏใ‚ณใƒžใƒณใƒ‰ๅ…ฅๅŠ›ใ‚ฆใ‚ฃใƒณใƒ‰ใ‚ฆใ‚’่กจ็คบ
138
138
  if @command_mode_active
139
- draw_command_input
139
+ # ่ฃœๅฎŒๅ€™่ฃœใ‚’ๅ–ๅพ—
140
+ suggestions = @command_mode_ui.autocomplete(@command_input)
141
+ # ใƒ•ใƒญใƒผใƒ†ใ‚ฃใƒณใ‚ฐใ‚ฆใ‚ฃใƒณใƒ‰ใ‚ฆใง่กจ็คบ
142
+ @command_mode_ui.show_input_prompt(@command_input, suggestions)
140
143
  else
141
144
  # move cursor to invisible position
142
145
  print "\e[#{@screen_height};#{@screen_width}H"
@@ -626,33 +629,46 @@ module Beniya
626
629
  draw_screen
627
630
  end
628
631
 
629
- # ใ‚ณใƒžใƒณใƒ‰ๅ…ฅๅŠ›ๆฌ„ใ‚’ๆ็”ป
630
- def draw_command_input
631
- # ็”ป้ขๆœ€ไธ‹้ƒจใซๆ็”ป
632
- print "\e[#{@screen_height};1H"
633
- print "\e[2K" # ่กŒใ‚’ใ‚ฏใƒชใ‚ข
634
-
635
- # ใ‚ณใƒžใƒณใƒ‰ใƒ—ใƒญใƒณใƒ—ใƒˆใจๅ…ฅๅŠ›ใ‚’่กจ็คบ
636
- prompt = ":"
637
- print "#{prompt}#{@command_input}"
638
-
639
- # ใ‚ซใƒผใ‚ฝใƒซใ‚’่กจ็คบ
640
- print "\e[?25h"
641
- end
642
-
643
- # ใ‚ณใƒžใƒณใƒ‰ๅฎŸ่กŒ็ตๆžœใ‚’ๆ็”ป
644
- def draw_command_result
645
- return unless @command_result && @command_result_time
646
-
647
- # 3็ง’้–“ใ ใ‘่กจ็คบ
648
- if Time.now - @command_result_time < 3
649
- print "\e[#{@screen_height - 1};1H"
650
- print "\e[2K" # ่กŒใ‚’ใ‚ฏใƒชใ‚ข
651
- print @command_result
652
- else
653
- @command_result = nil
654
- @command_result_time = nil
655
- end
632
+ # Show deprecation notice if it hasn't been shown yet
633
+ def show_deprecation_notice_if_needed
634
+ notice = DeprecationNotice.new
635
+ return unless notice.should_show?
636
+
637
+ # Calculate window dimensions
638
+ width = [@screen_width - 10, 70].min
639
+ height = 18
640
+ x = (@screen_width - width) / 2
641
+ y = (@screen_height - height) / 2
642
+
643
+ # Display the notice window
644
+ @dialog_renderer.draw_floating_window(
645
+ x, y, width, height,
646
+ notice.title,
647
+ notice.content,
648
+ {
649
+ border_color: "\e[33m", # Yellow
650
+ title_color: "\e[1;33m", # Bold yellow
651
+ content_color: "\e[37m" # White
652
+ }
653
+ )
654
+
655
+ # Force flush to ensure display
656
+ $stdout.flush
657
+
658
+ # Wait for any key press (using IO.console for better compatibility)
659
+ require 'io/console'
660
+ IO.console.getch
661
+
662
+ # Mark as shown
663
+ notice.mark_as_shown
664
+
665
+ # Clear screen for main display
666
+ print "\e[2J\e[H"
667
+ rescue StandardError => e
668
+ # If notice display fails, mark it as shown to avoid repeated errors
669
+ notice.mark_as_shown if notice
670
+ # Log error to stderr for debugging
671
+ $stderr.puts "Warning: Failed to display deprecation notice: #{e.message}"
656
672
  end
657
673
  end
658
674
  end
@@ -23,8 +23,8 @@ module Beniya
23
23
  def display_width(string)
24
24
  string.each_char.map do |char|
25
25
  case char
26
- when /[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF\uFF00-\uFFEF]/
27
- FULLWIDTH_CHAR_WIDTH # Japanese characters (hiragana, katakana, kanji, full-width symbols)
26
+ when /[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF\uFF00-\uFFEF\u2500-\u257F\u2580-\u259F]/
27
+ FULLWIDTH_CHAR_WIDTH # Japanese characters (hiragana, katakana, kanji, full-width symbols, box drawing, block elements)
28
28
  when /[\u0020-\u007E]/
29
29
  HALFWIDTH_CHAR_WIDTH # ASCII characters
30
30
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Beniya
4
- VERSION = '0.8.0'
4
+ VERSION = '0.9.1'
5
5
  end
data/lib/beniya.rb CHANGED
@@ -20,6 +20,7 @@ require_relative "beniya/terminal_ui"
20
20
  require_relative "beniya/application"
21
21
  require_relative "beniya/file_opener"
22
22
  require_relative "beniya/health_checker"
23
+ require_relative "beniya/deprecation_notice"
23
24
 
24
25
  # ใƒ—ใƒฉใ‚ฐใ‚คใƒณใ‚ทใ‚นใƒ†ใƒ 
25
26
  require_relative "beniya/plugin_config"
data/test_notice.rb ADDED
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative 'lib/beniya'
5
+
6
+ puts "Testing deprecation notice..."
7
+ puts "Checking if notice should show: #{Beniya::DeprecationNotice.new.should_show?}"
8
+
9
+ # Simulate terminal UI setup
10
+ system('tput smcup') # alternate screen
11
+ system('tput civis') # cursor invisible
12
+ print "\e[2J\e[H" # clear screen
13
+
14
+ begin
15
+ notice = Beniya::DeprecationNotice.new
16
+
17
+ if notice.should_show?
18
+ puts "Notice should be shown, displaying..."
19
+
20
+ # Get screen size
21
+ require 'io/console'
22
+ screen_width, screen_height = IO.console.winsize.reverse
23
+
24
+ # Calculate window dimensions
25
+ width = [screen_width - 10, 70].min
26
+ height = 18
27
+ x = (screen_width - width) / 2
28
+ y = (screen_height - height) / 2
29
+
30
+ dialog_renderer = Beniya::DialogRenderer.new
31
+
32
+ # Display the notice window
33
+ dialog_renderer.draw_floating_window(
34
+ x, y, width, height,
35
+ notice.title,
36
+ notice.content,
37
+ {
38
+ border_color: "\e[33m", # Yellow
39
+ title_color: "\e[1;33m", # Bold yellow
40
+ content_color: "\e[37m" # White
41
+ }
42
+ )
43
+
44
+ # Wait for any key press
45
+ puts "\n\n[DEBUG] Waiting for key press..."
46
+ $stdin.getch
47
+
48
+ # Mark as shown
49
+ notice.mark_as_shown
50
+ puts "\n[DEBUG] Notice marked as shown"
51
+ else
52
+ puts "Notice already shown, skipping"
53
+ end
54
+ ensure
55
+ system('tput rmcup') # normal screen
56
+ system('tput cnorm') # cursor normal
57
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beniya
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - masisz
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-12-06 00:00:00.000000000 Z
10
+ date: 2025-12-20 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: io-console
@@ -107,8 +107,8 @@ dependencies:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
109
  version: '1.21'
110
- description: A terminal-based file manager inspired by Yazi, written in Ruby with
111
- plugin support
110
+ description: "[DEPRECATED] This project has been migrated to rufio (https://github.com/masisz/rufio).
111
+ A terminal-based file manager inspired by Yazi, written in Ruby with plugin support"
112
112
  email:
113
113
  - masisz.1567@gmail.com
114
114
  executables:
@@ -122,6 +122,7 @@ files:
122
122
  - CHANGELOG_v0.6.0.md
123
123
  - CHANGELOG_v0.7.0.md
124
124
  - CHANGELOG_v0.8.0.md
125
+ - CHANGELOG_v0.9.0.md
125
126
  - README.md
126
127
  - README_EN.md
127
128
  - Rakefile
@@ -139,6 +140,7 @@ files:
139
140
  - lib/beniya/command_mode_ui.rb
140
141
  - lib/beniya/config.rb
141
142
  - lib/beniya/config_loader.rb
143
+ - lib/beniya/deprecation_notice.rb
142
144
  - lib/beniya/dialog_renderer.rb
143
145
  - lib/beniya/directory_listing.rb
144
146
  - lib/beniya/file_opener.rb
@@ -160,6 +162,7 @@ files:
160
162
  - publish_gem.zsh
161
163
  - test_delete/test1.txt
162
164
  - test_delete/test2.txt
165
+ - test_notice.rb
163
166
  homepage: https://github.com/masisz/beniya
164
167
  licenses:
165
168
  - MIT
@@ -168,6 +171,20 @@ metadata:
168
171
  homepage_uri: https://github.com/masisz/beniya
169
172
  source_code_uri: https://github.com/masisz/beniya
170
173
  changelog_uri: https://github.com/masisz/beniya/blob/main/CHANGELOG.md
174
+ post_install_message: |
175
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
176
+ โ”‚ โ”‚
177
+ โ”‚ โš ๏ธ DEPRECATED: beniya has been migrated to rufio โ”‚
178
+ โ”‚ โ”‚
179
+ โ”‚ This project is now in maintenance mode. โ”‚
180
+ โ”‚ Please use rufio for new features and active development. โ”‚
181
+ โ”‚ โ”‚
182
+ โ”‚ Install rufio: โ”‚
183
+ โ”‚ gem install rufio โ”‚
184
+ โ”‚ โ”‚
185
+ โ”‚ More info: https://github.com/masisz/rufio โ”‚
186
+ โ”‚ โ”‚
187
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
171
188
  rdoc_options: []
172
189
  require_paths:
173
190
  - lib