Skip to content

Releases: swhitt/clackrb

v0.5.0

28 Mar 01:23

Choose a tag to compare

Breaking

  • @cursor renamed to @option_index in option-based prompts (affects subclasses)
  • Signal handlers moved into Clack.setup! (called automatically on first prompt)

Changed

  • Extracted SelectionManager module shared by Multiselect, AutocompleteMultiselect, GroupMultiselect
  • SIGWINCH handler is now async-signal-safe
  • Multiselect raises ArgumentError on initial_value: (must use initial_values:)

Added

  • Clack.setup! / Clack.setup? for explicit signal handler installation
  • KeyQueue in Clack::Testing for deterministic key simulation
  • New specs for SelectionManager, OptionsHelper, Prompt internals, CI mode
  • README rewritten with badges, before/after comparison, reorganized sections

https://rubygems.org/gems/clack/versions/0.5.0

v0.4.6

22 Mar 18:02

Choose a tag to compare

Fixed

  • Settings.printable? now accepts combining characters and multi-codepoint grapheme clusters (accented letters, emoji)
  • Signal handlers use write_nonblock instead of print for async safety
  • S_STEP_ERROR ASCII fallback changed from x to ! (was identical to S_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_frame template into Core::Prompt with final_display hook (11 prompt classes simplified)
  • Date prompt: consolidated duplicated segment logic into update_segment

v0.4.5

22 Feb 14:27

Choose a tag to compare

Fixed

  • Autocomplete and AutocompleteMultiselect now route all printable characters to the search field first, fixing vim aliases (j/k/h/l) hijacking text input
  • AutocompleteMultiselect no longer intercepts a/i keys as shortcuts — they conflicted with typing in the search field
  • AutocompleteMultiselect#toggle_current now respects :disabled options, matching Multiselect behavior

Changed

  • AutocompleteMultiselect internals aligned with Multiselect: @selected naming, submit override pattern, keyboard_hints method, build_frame validation rendering, initial_values: [] default

Added

  • examples/showcase.rb — full-featured demo with branching, autocomplete, date, range, group multiselect, tasks
  • examples/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

21 Feb 20:33

Choose a tag to compare

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 respects FORCE_COLOR environment variable, consistent with Colors module
  • Spinner#message returns self for method chaining

Changed

  • Task and TaskResult now use Data.define instead of Struct.new (Ruby 3.2+ idiom)

v0.4.3

21 Feb 17:11

Choose a tag to compare

Fixed

  • Multiselect variants now ignore initial_values that don't match any option (prevents phantom values in return)
  • SIGWINCH handler now uses .dup for safe array iteration inside signal trap
  • GroupMultiselect propagates :hint into flat items so hints actually render

Changed

  • AutocompleteMultiselect final frame now shows selected labels instead of "N items selected", matching Multiselect behavior
  • Removed dead @mutex from Testing module
  • Removed unused raw: parameter from TaskLog and TaskLogGroup message methods

v0.4.2

21 Feb 17:11

Choose a tag to compare

Fixed

  • GroupMultiselect now preserves :hint on options (was silently dropped during normalization)
  • GroupMultiselect renders hints on active options, matching Select behavior
  • Spinner no longer raises when finished in timer mode before the animation thread starts
  • YARD docs: corrected selectable_groups default from true to false

Changed

  • Range prompt now accepts initial_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

23 Jan 16:32

Choose a tag to compare

Added

  • Warning validation: Validators can return Clack::Warning.new(message) for soft failures that allow user confirmation
  • Built-in warning validators: Validators.file_exists_warning and Validators.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

v0.1.1

10 Jan 14:09
81cd5f1

Choose a tag to compare

What's Changed

  • Terminal safety and input handling fixes by @swhitt in #7
  • Release 0.1.1 by @swhitt in #8

Full Changelog: v0.1.0...v0.1.1