Commit Graph
100 Commits
Author SHA1 Message Date
yves-biener 66b3a77805 feat(container): negative layout padding
Zig Project Action / Lint, Spell-check and test zig project (push) Has been cancelled
Negative paddings use the current size to calculate the padding from
the opposite orientation. For a given dimension (horizontal or vertical)
if the size is `30` a padding of `5` would be equivalent to a padding
of `-25`. This enables to describe the size of the container using
the padding property of the `Layout` and gives users more freedom to
describe different layouts.
2025-07-11 22:33:32 +02:00
yves-biener b401b5ece8 lint(container): style
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m41s
2025-07-07 23:08:06 +02:00
yves-biener 9f33c902ee mod(container): cleanup and highlight points for improvement
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m42s
2025-07-06 00:42:00 +02:00
yves-biener 9f29ac6a77 feat(element/progress): Progress bar implementation as an Element
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 2m42s
2025-07-05 18:29:49 +02:00
yves-biener f775a6ab2d formatting
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 13s
2025-06-30 22:53:05 +02:00
yves-biener a39cee7ccb feat(element/button): add builtin Element implementation for buttons 2025-06-30 22:52:27 +02:00
yves-biener 7875db0aea feat(element/input): make accept event agnostic to u8 and u21 slices
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 50s
There are now comptime checks in place an the corresponding triggered
event will be automatically converted to the correct type to support
simple ascii strings (`[]u8`) or utf-8 strings (`[]u21`).
2025-06-30 22:03:59 +02:00
yves-biener 7595e3b5bb feat(element/input): text input element implementation
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 14s
Moved implementation from example/input as a standalone `Element`
implementation, which is directly used by the example instead.

The provided argument is the `App.Event`'s event that should be
triggered on acceptance for the contents of the Input `Element`.
Currently only `[]u21` strings are supported, but in the future also
`[]u8` strings shall be supported and automatically converted when
pushed as an `App.Event` into the app's queue.
2025-06-29 11:19:09 +02:00
yves-biener 2ba0ed85fb fix(app): remove exported Exec Element - it does not exist in this branch 2025-06-29 10:34:53 +02:00
yves-biener 439520d4fe mod(example/input): ellipse rendering with scrolling for text field contents
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 17s
2025-06-28 22:09:36 +02:00
yves-biener ded1f2c17e mod(example/input): reorder input handling cases; add alt-b/f binding implementations 2025-06-28 22:08:19 +02:00
yves-biener 92ae8c9681 feat(example/input): readline shortcuts; better navigation;
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 58s
This will be the basis for a Textfield `Element` implementation to make
it easier to add user inputs into the container structures.
2025-06-28 13:04:00 +02:00
yves-biener 743cdca174 mod: bump zg dependency version
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 26s
As the dependency is still using version 0.14.0, it still causes an
error during testing. Corresponding examples are still working as
expected.
2025-06-24 20:48:32 +02:00
yves-biener 7d8e902ce2 chor: bump zig version and fix corresponding errors 2025-06-24 20:47:47 +02:00
yves-biener ed0010c8af lint: correct reported typos (including a rename)
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 26s
2025-06-24 20:35:28 +02:00
yves-biener a8e138deb7 action: bump zig installation version
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 15s
2025-06-24 20:27:07 +02:00
yves-biener d0453d08b8 fix: render cursor correctly in case the same character remains the cursor position
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 47s
2025-06-11 20:32:35 +02:00
yves-biener 825fb63bc8 ref: rename gpa usages to the aliased DebugAllocator 2025-06-11 20:31:41 +02:00
yves-biener 76f708d9d7 add(continous): example which provides a fixed render schedule
The other examples did rendering based on events, which this renderer
does not. This makes these applications potentially not that efficient,
but allows for consistent frame times that make animations, etc.
possible. This example serves to show that you can use `zterm` for both
types of render scheduling and even change between them without much
efford.
2025-05-30 23:02:56 +02:00
yves-biener 0d2644f476 mod(input): handle remaining key codes remove unused ones 2025-05-30 23:01:48 +02:00
yves-biener 9a818117d7 feat(panic): panic handler to recover termios when crashing 2025-05-30 23:00:45 +02:00
yves-biener 5ba5b2b372 feat(element/alignment): alignment Element implementation
You can now align a `Container` using the Alignment `Element` similar to
how you make a `Container` scrollable. For usage details please see the
example and the corresponding tests.
2025-05-28 14:42:02 +02:00
yves-biener 3cb0d11e71 add: necessary assert statement; rem: unnecessary render resize in testing 2025-05-28 14:40:25 +02:00
yves-biener 4cc749facc feat(app): read input options correctly 2025-05-28 14:39:27 +02:00
yves-biener c6d8eec287 feat(debug): render debug support 2025-05-26 15:43:47 +02:00
yves-biener 2572b57697 refactor: remove unnecessary comptime keyword 2025-05-26 15:15:30 +02:00
yves-biener 80a36a9947 refactor: zigify imports and usages 2025-05-26 14:23:18 +02:00
yves-biener 4cde0640c8 fix(element/scrollable): adjust anchor for scrollable element during resize 2025-05-22 23:39:05 +02:00
yves-biener e9a9c2b680 feat(app): signal WINCH for .resize system event
This allows the application to automatically re-draw and resize if the
application receives the signal by the terminal emulator.
2025-05-21 22:49:08 +02:00
yves-biener ba25e6056c feat(element/scrollable): scrollbar rendering
Configuration to enable scrollbar rendering for scrollable `Element`s.
Currently only the fg `Color` of the scrollbar can be configured while
the background uses the same fg `Color` but adds the emphasis `.dim` to
make it obvious what the is the actual scrollbar. In the future it might
be necessary to provide the user with more options to configure the
representation of the scrollbar.

Tests have been added to test the scrollbar rendering and placement
accordingly.
2025-05-21 18:20:52 +02:00
yves-biener aa4adf20f9 refactor: zigify imports and correct minor mistakes 2025-05-20 18:23:44 +02:00
yves-biener 50adf32f14 add(style): cursor style to indicate a cursor position
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 25s
2025-04-20 20:54:30 +02:00
yves-biener a4293ff243 add(event): mouse event has relative position for receiving elements
Zig Project Action / Lint, Spell-check and test zig project (push) Has been cancelled
2025-04-20 20:53:46 +02:00
yves-biener 50450f3bbc fix(container): growth resize for size all size options and starting sizes (i.e. the smallest being a non grow-able one)
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m14s
2025-04-07 20:55:21 +02:00
yves-biener bce134f052 rem: unnecessary signal handler
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 2m1s
No event-based re-sizing, instead each re-render resizes by default.
2025-04-01 21:53:52 +02:00
yves-biener 962a384ecf add(Scrollable): init function with corresponding usages
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 42s
2025-03-29 21:21:23 +01:00
yves-biener 0b7d032b11 tag: 0.2.0
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m15s
2025-03-27 21:43:02 +01:00
yves-biener 7e20dd73d9 mod: add missing inline function attribute
Correct example to use the actual `zterm.Error` type accordingly.
2025-03-27 21:41:18 +01:00
yves-biener 182dec6065 release: 0.1.0
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 21s
2025-03-13 19:50:49 +01:00
yves-biener 54af974c2b mod(container): make reposition public and split from resize
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m3s
2025-03-13 19:48:31 +01:00
yves-biener dddc09b4ce mod(container/element): remove origin: Point argument from Element.content function
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m12s
Renamed `Container.contents` to `Container.content` to be in line with
the corresponding `Element` function name. This has also been done for
the properties structs used by the `Container`.
2025-03-11 07:52:35 +01:00
yves-biener adda53c5a9 add(test): container size with fixed and growable container children
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 46s
2025-03-10 22:07:34 +01:00
yves-biener 5c1d61eefd rem(element): unnecessary debug loging
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m20s
2025-03-10 21:44:18 +01:00
yves-biener 54c7e19939 fix(container): growth options to dynamically size Containers
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 29s
2025-03-06 22:31:00 +01:00
yves-biener 5457e91b37 fix(container/grow_size): respect vertical / horizontal provided dimensions 2025-03-06 22:07:39 +01:00
yves-biener 79016f39b2 fix(container/grow_size): children should never grow larger then parents
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 29s
2025-03-06 17:56:13 +01:00
yves-biener 2b9ab1e0fb fix(example/styles): provide necessary size for text display through the element
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 31s
This could also be done through the `resize` function interface of the
`Element` or the corresponding `Container` from the outside (as done in
this example - as the size is know at compile-time).
2025-03-05 23:22:06 +01:00
yves-biener 315cd8d23e fix(layout): remove upper bound of while loop
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 29s
The upper loop was incorrect and therefore removed to create correct
layouts. I should be able to calculate the bound correctly, but for
now).
2025-03-05 23:14:54 +01:00
yves-biener e3551fa624 add(sizing): grow configuration
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m14s
Currently the 'grid' and 'mixed' examples are not working yet.
2025-03-05 22:53:28 +01:00
yves-biener 9ec335cad8 fix(lint): correct spelling error
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 49s
2025-03-04 23:01:28 +01:00
yves-biener 466e00c16c fix(element/scrollable): support deriving Container size of scrollable
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 13s
2025-03-04 21:54:07 +01:00
yves-biener fc72cf4abb ref(container): split size and position calculations
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 34s
2025-03-04 19:53:28 +01:00
yves-biener 65d7546efd fix(testing): apply refactor to test implementation
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 27s
2025-03-04 14:54:51 +01:00
yves-biener ec22e68e8c ref(event): remove .resize and replace with recursize method calls
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 40s
This also means that currently the dynamic resizing through the app's
detached thread is not working, as it cannot send size updates. The
examples have been overhauled to still implement intermediate mode
applications accordingly.
2025-03-04 14:52:19 +01:00
yves-biener 43cdc46853 fix(input/mouse): correct boundary check for mouse position inside of given origin and size
Zig Project Action / Lint, Spell-check and test zig project (push) Has been cancelled
2025-03-04 14:51:26 +01:00
yves-biener 591b990087 ref(event): split Size into two Points (one for the size and one for the anchor / origin)
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 39s
2025-03-04 00:04:56 +01:00
yves-biener 91ac6241f4 doc: correct TODO, NOTE and FIX comment statements
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 48s
2025-03-03 21:49:11 +01:00
yves-biener edefc80759 mod(container/border): render horizontal borders across entire Container
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 27s
2025-03-02 23:03:00 +01:00
yves-biener 4145ff497b fix(elements/scrollable): nested container rendering
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 2m45s
2025-03-02 22:27:26 +01:00
yves-biener bec0cf2987 fix(container): check border sides configurations before trying to create borders
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 28s
2025-03-01 20:58:34 +01:00
yves-biener e2fe884925 chors: update build file configurations
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 28s
2025-03-01 17:57:28 +01:00
yves-biener caee008d50 test: streamline examples with quit texts
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 24s
Improve some examples to provide visual feedback, i.e. for the button
exmample, with fixes to make them compilable with the `Scrollable`
element changes.
2025-03-01 17:12:28 +01:00
yves-biener af443c6bbf test(elements/scrollable): remove redundance from test code
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 28s
2025-03-01 16:24:10 +01:00
yves-biener ae9cd08b15 add(error): introduce zterm.Error containing all zterm errors with their corresponding description
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 28s
2025-03-01 15:19:42 +01:00
yves-biener 91794a0197 add(build): .fingerprint property for most recent zig version
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 49s
2025-03-01 15:15:06 +01:00
yves-biener 8a7ce78aaf feat(container): introduce fixed_size property for fixed sizing of Containers
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 42s
Moved min_size property from `Container` to the `Scrollable` element,
where it is only used anyway.
2025-03-01 11:56:14 +01:00
yves-biener 35ebe31008 doc: correct example used in README
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 18s
2025-02-28 15:58:46 +01:00
yves-biener c28fcd26c1 fix(container/layout): integer overflows by casting to usize
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m5s
2025-02-28 15:55:10 +01:00
yves-biener 3b6848f845 fix(container): rendering scrollable elements with separators
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 23s
Added corresponding test cases to test the corresponding rendering of
scrollable elements.
2025-02-27 17:02:16 +01:00
yves-biener 53b69f034c mod(size): rename merge function to add; new max function
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m6s
2025-02-27 14:17:19 +01:00
yves-biener 54ce697e91 fix(lint): typo
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 47s
2025-02-26 21:54:29 +01:00
yves-biener 8f16435f30 test(container): rectangle color filling
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m4s
2025-02-26 21:04:28 +01:00
yves-biener ca14bc6106 fix(container): positioning; move separator options to layout struct
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 22s
Added corresponding test cases for padding, borders and corresponding
seperators.
2025-02-26 18:21:55 +01:00
yves-biener a293ef46da test(container): add missing zon test configurations
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 46s
2025-02-25 20:41:35 +01:00
yves-biener c66401d941 testing(container): border separator test cases
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 40s
Currently the test case with both a border and separators for two
children is failing to render the separators.
2025-02-25 20:39:18 +01:00
yves-biener ad4186e1f8 test(container): move test template for zon file creation to wiki
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 46s
2025-02-25 19:04:21 +01:00
yves-biener 8c130a40d7 test(container): correct color
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m15s
2025-02-25 18:46:06 +01:00
yves-biener 9a3bc3dbf7 fix(lint): exclude zon files located in src/test 2025-02-25 18:45:13 +01:00
yves-biener 9d5a661b4e test(container): render Cell slices test against .zon input
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m0s
2025-02-25 18:41:04 +01:00
yves-biener 4234c9ad0c rem(element): template Element moved into wiki documentation
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 45s
2025-02-25 16:55:11 +01:00
yves-biener a588e2ef21 add(test): input testing of Key.isAscii
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m42s
2025-02-25 16:52:17 +01:00
yves-biener 8519d204f3 fix(lint): correct spelling error
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m1s
2025-02-24 17:20:25 +01:00
yves-biener 33262c9638 add(testing): new namespace containing testing capabilities for zterm
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 39s
The namespace shall also be used for testing the rendering of
`Container`s and `Element`s (including the `Scrollable` element).

The testing renderer currently is a striped down version of the double
buffered render without the secondary buffer and the flushing to stdout.
The internal `Cell` slice (the *screen*) is used for equality checks.

The testing namespace shall provide a way to describe the expected
`Cell` slices that should be validated against.
2025-02-24 17:14:57 +01:00
yves-biener 5c5c59cbfc fix(style): render only necessary bytes and change default fg color to .default
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 45s
2025-02-24 17:11:22 +01:00
yves-biener c022d1d9e2 fix(lint): correct indentation and naming convention for constants
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m9s
2025-02-24 17:09:22 +01:00
yves-biener 12497e92f8 fix(lint): correct casing for constants
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 21s
2025-02-24 17:01:55 +01:00
yves-biener d10f738c75 add(test): cell conversion to ansi enhanced strings
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 45s
2025-02-24 16:54:05 +01:00
yves-biener 140f27216a doc: move contents from README to wiki
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 6m49s
2025-02-22 11:00:38 +01:00
yves-biener 04ba88c68b doc: update README
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 42s
2025-02-21 23:17:01 +01:00
yves-biener 6ccab74c94 add(examples/demo): application to showcase a more complex application
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 53s
Further improvements for example applications; Demo example is now
default build target (when not providing example configuration).
2025-02-21 22:57:14 +01:00
yves-biener c634e1affc doc: update roadmap 2025-02-21 22:29:19 +01:00
yves-biener dab486a2c1 add(examples/errors): error notifaction handling
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m33s
2025-02-21 22:25:42 +01:00
yves-biener 9b0dd3c52f doc: correct link to wiki
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 43s
2025-02-21 19:17:28 +01:00
yves-biener f45e722578 fix(linter): spelling error in README
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 57s
2025-02-21 19:15:19 +01:00
yves-biener 7b005ea4b1 add(examples/styles): text and color styling possiblities
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 39s
This also contains some minor refactoring to improve the readability
and understandability of the library (i.e. renaming of Style.Attributes
to Style.Emphasis).
2025-02-21 19:13:11 +01:00
yves-biener c0c0590bb9 add(examples/styles): color palette to showcase all available colors to render (except for .default)
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 54s
2025-02-21 16:43:03 +01:00
yves-biener 16724f6a52 add(example/elements): distinct different scrollable containers
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 46s
2025-02-21 15:58:42 +01:00
yves-biener 44e92735cf ref(examples): avoid unnecessary casts
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 43s
2025-02-21 15:15:15 +01:00
yves-biener 8cc047c1fa fix(lint): spelling error in README
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 57s
2025-02-21 14:57:30 +01:00
yves-biener 8fbc958ca1 add(examples/elements): mouse clickable button
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 39s
2025-02-21 14:50:29 +01:00