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 +4 -4
- data/CHANGELOG_v0.9.0.md +279 -0
- data/README.md +2 -0
- data/README_EN.md +2 -0
- data/beniya.gemspec +17 -1
- data/lib/beniya/command_mode_ui.rb +46 -0
- data/lib/beniya/deprecation_notice.rb +105 -0
- data/lib/beniya/terminal_ui.rb +48 -32
- data/lib/beniya/text_utils.rb +2 -2
- data/lib/beniya/version.rb +1 -1
- data/lib/beniya.rb +1 -0
- data/test_notice.rb +57 -0
- metadata +21 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3ed952c2b36c035a5a7ae8aa48a0dd9660474662f4ae4e3dc655e77b328b92ba
|
|
4
|
+
data.tar.gz: 4a5c3a7574b283a46cc5a91cde33ef1638d9be8c92d6a44b9dddf907a3c0bbd4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3bc682b199597c239ba1a71ab9254f271232ac74a5d4f07eb6ba4ba53b505ca714bfc5efb5e7f9ab9e058527f5c5f724e4c30b4357a1ca057b200227bac30262
|
|
7
|
+
data.tar.gz: 4b6804dc73b11b8c31ceee249c587d2c2f2306e720d16629b0456a0594f4960e3dda87414df325fb714b32daf3b23e92eb6335e1e127b30b4d4c46a9fffc57cb
|
data/CHANGELOG_v0.9.0.md
ADDED
|
@@ -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
|
data/lib/beniya/terminal_ui.rb
CHANGED
|
@@ -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
|
-
|
|
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
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
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
|
data/lib/beniya/text_utils.rb
CHANGED
|
@@ -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
|
data/lib/beniya/version.rb
CHANGED
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.
|
|
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-
|
|
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:
|
|
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
|