Releases: swhitt/clackrb
Releases · swhitt/clackrb
v0.5.0
Breaking
@cursorrenamed to@option_indexin option-based prompts (affects subclasses)- Signal handlers moved into
Clack.setup!(called automatically on first prompt)
Changed
- Extracted
SelectionManagermodule shared by Multiselect, AutocompleteMultiselect, GroupMultiselect - SIGWINCH handler is now async-signal-safe
MultiselectraisesArgumentErroroninitial_value:(must useinitial_values:)
Added
Clack.setup!/Clack.setup?for explicit signal handler installationKeyQueueinClack::Testingfor deterministic key simulation- New specs for SelectionManager, OptionsHelper, Prompt internals, CI mode
- README rewritten with badges, before/after comparison, reorganized sections
v0.4.6
Fixed
Settings.printable?now accepts combining characters and multi-codepoint grapheme clusters (accented letters, emoji)- Signal handlers use
write_nonblockinstead ofprintfor async safety S_STEP_ERRORASCII fallback changed fromxto!(was identical toS_STEP_CANCEL)- CI mode validation warnings now print to stderr instead of stdout
Changed
- Colors, Cursor, and Symbols ANSI detection unified through
Environment.colors_supported? - Extracted
build_final_frametemplate intoCore::Promptwithfinal_displayhook (11 prompt classes simplified) - Date prompt: consolidated duplicated segment logic into
update_segment
v0.4.5
Fixed
AutocompleteandAutocompleteMultiselectnow route all printable characters to the search field first, fixing vim aliases (j/k/h/l) hijacking text inputAutocompleteMultiselectno longer interceptsa/ikeys as shortcuts — they conflicted with typing in the search fieldAutocompleteMultiselect#toggle_currentnow respects:disabledoptions, matchingMultiselectbehavior
Changed
AutocompleteMultiselectinternals aligned withMultiselect:@selectednaming,submitoverride pattern,keyboard_hintsmethod,build_framevalidation rendering,initial_values: []default
Added
examples/showcase.rb— full-featured demo with branching, autocomplete, date, range, group multiselect, tasksexamples/migration_from_tty_prompt.rb— side-by-side migration guide from tty-prompt- README: "Why Clack?" with zero-dependencies callout, quick reference table, TL;DR tagline, vim key notes on autocomplete sections
v0.4.4
Fixed
- INT handler is now exception-safe (catches IOError/SystemCallError when output is unavailable)
Added
- SIGTERM handler restores cursor on graceful kill, matching INT handler behavior
Cursor.enabled?now respectsFORCE_COLORenvironment variable, consistent with Colors moduleSpinner#messagereturnsselffor method chaining
Changed
TaskandTaskResultnow useData.defineinstead ofStruct.new(Ruby 3.2+ idiom)
v0.4.3
Fixed
- Multiselect variants now ignore
initial_valuesthat don't match any option (prevents phantom values in return) - SIGWINCH handler now uses
.dupfor safe array iteration inside signal trap GroupMultiselectpropagates:hintinto flat items so hints actually render
Changed
AutocompleteMultiselectfinal frame now shows selected labels instead of "N items selected", matchingMultiselectbehavior- Removed dead
@mutexfromTestingmodule - Removed unused
raw:parameter fromTaskLogandTaskLogGroupmessage methods
v0.4.2
Fixed
GroupMultiselectnow preserves:hinton options (was silently dropped during normalization)GroupMultiselectrenders hints on active options, matchingSelectbehaviorSpinnerno longer raises when finished in timer mode before the animation thread starts- YARD docs: corrected
selectable_groupsdefault fromtruetofalse
Changed
Rangeprompt now acceptsinitial_value:for consistency with all other prompts (default:still works)- README: corrected Range example to use
initial_value:and tab completion description
v0.1.4 - Warning Validation
Added
- Warning validation: Validators can return
Clack::Warning.new(message)for soft failures that allow user confirmation - Built-in warning validators:
Validators.file_exists_warningandValidators.as_warning(validator) - Test coverage for warning state machine and multiselect keyboard shortcuts
Changed
- Simplified Multiselect implementation by using base class warning/error handling (37 lines → 12 lines)
- Unified validation message rendering across all prompt types