Commit Graph

34 Commits

Author SHA1 Message Date
feae9fa1a4 feat(model): implement Elm architecture
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m2s
Now the `App` contains a state which is a user-defined `struct` which
is passed to the `handle` and `contents` callbacks for `Container`'s and
`Element`'s. Built-in `Element`'s shall not access the `App.Model` and
should therefore never cause any side-effects.

User-defined events shall be used to act as *messages* to cause
potential side-effects for the model. This is the reason why only
the `handle` callback has a non-const pointer to the `App.Model`. The
`contents` callback can only access the `App.Model` read-only to use for
generating the *view* (in context of the elm architecture).
2025-10-26 15:58:07 +01:00
832fc45c3e chor: use new Writer interface for terminal's Writer; fix test cases
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 3m38s
2025-10-01 10:59:29 +02:00
d0453d08b8 fix: render cursor correctly in case the same character remains the cursor position
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 47s
2025-06-11 20:32:35 +02:00
aa4adf20f9 refactor: zigify imports and correct minor mistakes 2025-05-20 18:23:44 +02:00
50adf32f14 add(style): cursor style to indicate a cursor position
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 25s
2025-04-20 20:54:30 +02:00
dddc09b4ce mod(container/element): remove origin: Point argument from Element.content function
All checks were successful
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
ec22e68e8c ref(event): remove .resize and replace with recursize method calls
Some checks failed
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
591b990087 ref(event): split Size into two Points (one for the size and one for the anchor / origin)
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 39s
2025-03-04 00:04:56 +01:00
91ac6241f4 doc: correct TODO, NOTE and FIX comment statements
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 48s
2025-03-03 21:49:11 +01:00
4145ff497b fix(elements/scrollable): nested container rendering
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 2m45s
2025-03-02 22:27:26 +01:00
33262c9638 add(testing): new namespace containing testing capabilities for zterm
Some checks failed
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
26d31a38de ref(container): use only one size for each container 2025-02-15 10:49:48 +01:00
4cda202873 fix(renderer): integer overflows 2025-02-14 20:57:48 +01:00
bbe6f4741e WIP: use viewport to allow sizes of scroll to extend further than renderable screen 2025-02-12 22:33:03 +01:00
11531e9d4a mod: remove min_size argument from App.start 2025-02-06 22:19:27 +01:00
8586a05508 mod: fix rendering resizing; layout placement of child elements for vertical and horizontal directions
Work in progress for separator configuration of border properties
2025-02-06 20:10:22 +01:00
2bfacc0e98 WIP: container rendering for borders + container element rendering 2025-02-03 19:55:33 +01:00
1293cb065d WIP: add Container type with corresponding Properties configuration
The configuration of the `Container` types is very much inspired by
[clay](https://github.com/nicbarker/clay).
2025-02-01 01:05:56 +01:00
bdbe05c996 mod(structure): update project structure
Remove examples, add description for design goals in README.md and
apply re-names and naming changes accordingly for the project structure.
Implement a flat hierachry, as the library shall remain pretty simple.
2025-01-30 23:02:34 +01:00
3decc541a9 mod(renderer): initial version of double buffer intermediate renderer
This branch will implement the necessary changes for the widgets and
their implementations to use the new renderer correctly.
2025-01-30 20:53:01 +01:00
f4a01f227e fix: renderer default size value and example usage
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 41s
2025-01-14 17:17:24 +01:00
2efbb5feb1 mod(renderer): store absolut screen size for view change to report current screen size accordingly
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m21s
2025-01-14 17:08:19 +01:00
bbb360e417 fix(renderer): avoid inter overflow when rendering multiline strings
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 2m10s
2024-12-03 17:43:06 +01:00
0cc0ed10d2 cleanup of obsolete comments and dead code
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 35s
This removes the App.Renderer.Buffered, which was not improving on the
direct renderer, which has a simpler implementation and was keept for
this regard.
2024-11-13 19:14:13 +01:00
bc1bc757d4 add(layout/Marging): relative margins for Elements
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 32s
2024-11-13 18:09:54 +01:00
270ca9b1be mod(renderer): dynamic clear of size for widgets to improve render performance
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 35s
2024-11-13 15:07:26 +01:00
07e4819ecd feat(renderer): render cells instead of raw u8 array contents
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 39s
2024-11-12 19:14:19 +01:00
510bf7d885 fix(typos)
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 33s
2024-11-11 17:03:04 +01:00
ed5873de63 feat(Renderer): update interface functions to start supporting buffered rendering
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 30s
2024-11-11 17:01:59 +01:00
d2d655c829 mod: change interface for rendering of Layouts and Widgets to use a non-const pointer to the renderer instead
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 38s
2024-11-11 13:47:01 +01:00
67a535db6d feat(render): implement direct rendering
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 38s
2024-11-10 19:08:38 +01:00
8ae9129403 fix(widget): respect size for RawText and Spacer Widgets
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 36s
2024-11-10 16:02:49 +01:00
b314ff7813 mod: replace Layout.content with Layout.render
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 30s
The App.Renderer is used for the new `Layout.render` method. Each layout
renders itself now with corresponding renderers which might only update
parts of the screen, etc.
2024-11-10 14:34:28 +01:00
6d389bcd4b initial commit
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 30s
2024-11-09 21:24:42 +01:00