claude-plugin-viban 1.0.22 → 1.0.23
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.
- package/bin/viban +15 -11
- package/docs/CLAUDE.md +28 -0
- package/package.json +1 -1
package/bin/viban
CHANGED
|
@@ -356,18 +356,24 @@ get_term_height() {
|
|
|
356
356
|
fi
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
# Get display width of string
|
|
360
|
-
#
|
|
359
|
+
# Get display width of string using Unicode East Asian Width property
|
|
360
|
+
# F(Fullwidth) and W(Wide) = 2 columns, others = 1 column
|
|
361
361
|
str_width() {
|
|
362
362
|
local str="$1"
|
|
363
363
|
local char_count=${#str}
|
|
364
|
-
# Get byte count in C locale (UTF-8): CJK chars use 3 bytes each
|
|
365
364
|
local byte_count
|
|
366
365
|
LC_ALL=C byte_count=${#str}
|
|
367
|
-
|
|
368
|
-
#
|
|
369
|
-
|
|
370
|
-
|
|
366
|
+
|
|
367
|
+
# If all ASCII, simple calculation (fast path)
|
|
368
|
+
[[ $byte_count -eq $char_count ]] && { echo $char_count; return; }
|
|
369
|
+
|
|
370
|
+
# Use Python for accurate Unicode width calculation
|
|
371
|
+
# Note: <<< adds trailing newline, so we strip it with rstrip()
|
|
372
|
+
python3 -c "
|
|
373
|
+
import unicodedata, sys
|
|
374
|
+
s = sys.stdin.read().rstrip('\n')
|
|
375
|
+
print(sum(2 if unicodedata.east_asian_width(c) in 'FW' else 1 for c in s))
|
|
376
|
+
" <<< "$str"
|
|
371
377
|
}
|
|
372
378
|
|
|
373
379
|
# Truncate string to max display width (optimized)
|
|
@@ -502,8 +508,6 @@ build_column_lines() {
|
|
|
502
508
|
local short=$(truncate_str "$title" $title_w)
|
|
503
509
|
local title_content=" ${spinner_prefix}#$id $short"
|
|
504
510
|
local title_content_w=$(str_width "$title_content")
|
|
505
|
-
# Braille spinner chars are 3 bytes but display width 1, str_width overcounts by 1
|
|
506
|
-
[[ -n "$spinner_prefix" ]] && title_content_w=$((title_content_w - 1))
|
|
507
511
|
local title_pad=$((card_inner - title_content_w))
|
|
508
512
|
(( title_pad < 0 )) && title_pad=0
|
|
509
513
|
|
|
@@ -970,12 +974,12 @@ TEMPLATE
|
|
|
970
974
|
parse_stage=1
|
|
971
975
|
;;
|
|
972
976
|
1) # Looking for type
|
|
973
|
-
[[ -z "$line" ]] && continue #
|
|
977
|
+
[[ -z "$line" ]] && continue # Skip empty lines
|
|
974
978
|
# Validate type format (bug, feat, chore, refactor)
|
|
975
979
|
if [[ "$line" =~ ^(bug|feat|chore|refactor)$ ]]; then
|
|
976
980
|
new_type="$line"
|
|
977
981
|
fi
|
|
978
|
-
parse_stage=2 #
|
|
982
|
+
parse_stage=2 # Move to stage 2 on any non-empty line
|
|
979
983
|
;;
|
|
980
984
|
2) # Looking for title
|
|
981
985
|
[[ -z "$line" ]] && continue
|
package/docs/CLAUDE.md
CHANGED
|
@@ -56,6 +56,34 @@ gh pr create --title "..." --body "..."
|
|
|
56
56
|
|
|
57
57
|
## Shell Script Rules
|
|
58
58
|
|
|
59
|
+
### Language Policy (Critical)
|
|
60
|
+
|
|
61
|
+
**All user-facing text in the TUI must be in English**
|
|
62
|
+
|
|
63
|
+
This includes:
|
|
64
|
+
- Editor templates (title, description, priority, type prompts)
|
|
65
|
+
- Status messages
|
|
66
|
+
- Error messages
|
|
67
|
+
- Help text
|
|
68
|
+
- Comments in code
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# BAD: Korean in editor template
|
|
72
|
+
cat << EOF
|
|
73
|
+
우선순위: P0/P1/P2/P3
|
|
74
|
+
EOF
|
|
75
|
+
|
|
76
|
+
# GOOD: English in editor template
|
|
77
|
+
cat << EOF
|
|
78
|
+
Priority: P0/P1/P2/P3
|
|
79
|
+
EOF
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Rationale:**
|
|
83
|
+
- Consistent language throughout the interface
|
|
84
|
+
- Easier maintenance and testing
|
|
85
|
+
- Accessible to international users
|
|
86
|
+
|
|
59
87
|
### JSON Handling (Critical)
|
|
60
88
|
|
|
61
89
|
**Use `printf '%s'` when piping shell variables to jq**
|