termdash v0.14.0 Release Notes

  • ๐Ÿ’ฅ Breaking API changes

    • The widgetapi.Widget.Keyboard and widgetapi.Widget.Mouse methods now accepts a second argument which provides widgets with additional metadata. All widgets implemented outside of the termdash repository will need to be updated similarly to the Barchart example below. Change the original method signatures: ```go func (*BarChart) Keyboard(k *terminalapi.Keyboard) error { ... }

    func (*BarChart) Mouse(m *terminalapi.Mouse) error { ... }

    
      By adding the new `*widgetapi.EventMeta` argument as follows:
      ```go
      func (*BarChart) Keyboard(k *terminalapi.Keyboard, meta *widgetapi.EventMeta) error { ... }
    
      func (*BarChart) Mouse(m *terminalapi.Mouse, meta *widgetapi.EventMeta) error { ... }
    

    ๐Ÿ›  Fixed

    • termdash no longer crashes when tcell is used and the terminal window downsizes while content is being drawn.

    โž• Added

    Text input form functionality with keyboard navigation

    • โž• added a new formdemo that demonstrates a text input form with keyboard navigation.

    Infrastructure changes

    • ๐Ÿ”ง container now allows users to configure keyboard keys that move focus to the next or the previous container.
    • ๐Ÿšš containers can request to be skipped when focus is moved using keyboard keys.
    • containers can register into separate focus groups and specific keyboard keys can be configured to move the focus within each focus group.
    • widgets can now request keyboard events exclusively when focused.
    • ๐Ÿ‘‰ users can now set a container as focused using the new container.Focused option.

    โšก๏ธ Updates to the button widget

    • the button widget allows users to specify multiple trigger keys.
    • ๐Ÿ‘ the button widget now supports different keys for the global and focused scope.
    • the button widget can now be drawn without the shadow or the press animation.
    • the button widget can now be drawn without horizontal padding around its text.
    • the button widget now allows specifying cell options for each cell of the displayed text. Separate cell options can be specified for each of button's main states (up, focused and up, down).
    • the button widget allows specifying separate fill color values for each of its main states (up, focused and up, down).
    • โšก๏ธ the button widget now has a method SetCallback that allows updating the callback function on an existing button instance.

    โšก๏ธ Updates to the textinput widget

    • ๐Ÿ”ง the textinput widget can now be configured to request keyboard events exclusively when focused.
    • 0๏ธโƒฃ the textinput widget can now be initialized with a default text in the input box.