Changelog
Next
Removed
- #165
Dropped support for Python
3.11.
Added
- #123 Add styling for content area background color.
Fixed
- #125
Mouse wheel scroll events are now captured correctly
(they were previously reported as mouse presses).
The
check-inputCLI subcommand is also fixed (was broken by #86).
0.0.9
Released 2024-02-27
Fixed
- #121
A change in effect reconciliation introduced in
0.0.8caused a regression in the behavior ofuse_effect, where if thesetupfunctionreturned (i.e., stopped itself), Counterweight would crash when trying to cancel the effect. This now works again.
0.0.8
Released 2024-02-17
Changed
- #110
Calling a
use_statesetter with avalueequal to the current value of the state no longer emits aSetStateevent, to avoid triggering unnecessary render cycles. - #111 Border healing is now more efficient, especially when there are many non-border characters in the UI.
- #112
Major, backwards-incompatible changes to how Counterweight handles mouse interactions.
The
on_mouse_downandon_mouse_upevent handlers have been removed; use the new combinedon_mouseevent handler instead, which receives all mouse events (MouseMoved,MouseDown, andMouseUp). Theon_hoverstyle attribute on elements has been removed; use the newuse_mouse,use_rects, anduse_hoveredhooks instead, and calculate the desired style in your component. The goal of these changes is to provide more flexibility and control over mouse interactions to application authors while minimizing the work that Counterweight needs to do while rendering, at the cost of more complex application code for simple cases like detecting hover state.
0.0.7
Released 2024-02-02
Changed
- #105
ScreenshotandSuspendhandlers can now beasyncfunctions.
0.0.6
Released 2024-01-28
Added
- #92
Added an
insetattribute toAbsolutethat chooses which corner of the parent's context box to use as the origin for the absolute positioning. - #98
Added a
zattribute toFlexthat controls the stacking order of elements.
Changed
Removed
- #96
Chunks can no longer be created withCellPaints directly.
0.0.5
Released 2024-01-06
Added
- #86
Added a
Suspendcontrol which suspends the Counterweight application while a user-supplied callback function runs. Counterweight will stop controlling the terminal while the callback runs, and will resume when the callback returns. This can be used to run a subprocess that also wants control of the terminal (e.g., a text editor). - #88
#90
Implemented
AbsoluteandFixedpositioning, which allow for precise placement of elements outside the normal layout flow.
0.0.4
Released 2023-12-31
Fixed
- #83
Fixed virtual terminal escape code parsing for mouse tracking when the moues coordinates are large (>94 or so).
Mouse tracking should now work for any terminal size.
Various
Keymembers that aren't currently parseable have been removed to avoid confusion.
0.0.3
Released 2023-12-30
Changed
- #71
Controls are now a union over different
@dataclasses (instead of anEnum) to allow for more flexibility. TheScreenshotcontrol now takes a callback function which will be called with the SVG screenshot as an XML tree. - #81
The minimum Python version has been raised to
3.11.2due to a bug in CPython3.11.1
0.0.2
Released 2023-12-26
Added
- #65
Added ability to take an SVG "screenshot" by returning
Control.Screenshotfrom an event handler. The screenshot will be saved to the current working directory asscreenshot.svg; more options will be added in the future. - #66 Added "border healing": when border elements for certain border types are adjacent to each other and appear as if they should "join up", but don't because they belong to different elements, they will now be joined up.
Changed
- Various namespaces moved around to make more sense (especially in documentation) and separate concerns better as part of #68.
0.0.1
Released 2023-12-19