Commit Graph

71 Commits

Author SHA1 Message Date
EdJoPaTo
be05a341f4 test: basic tests to ensure render doesnt panic
should use buffer assertions in the future but this is a start
2024-05-15 13:51:54 +02:00
EdJoPaTo
e9656f82d1 test(flatten): ensure depth works 2024-05-15 13:51:54 +02:00
EdJoPaTo
537dc8021e perf(flatten): fewer clones 2024-05-15 13:49:50 +02:00
EdJoPaTo
fdd2c5436a feat!: cache last tree structure to simplify events
Things like key up/down dont require the items anymore to be used.
Instead a cached last state from last render is used.
2024-05-15 12:49:37 +02:00
EdJoPaTo
37ade72330 refactor(item): use keyword Self 2024-05-15 12:49:37 +02:00
EdJoPaTo
d7415f40c7 build(cargo): specify lints in Cargo.toml 2024-03-15 03:17:52 +01:00
EdJoPaTo
a60eb5266b refactor: simplify docs and LSP hints with names exactly as exported 2024-03-14 11:55:10 +01:00
EdJoPaTo
a2f8100fe7 refactor!: remove get_identifier_without_leaf
remove as its no longer used either internally or in mqttui for some time.
Either its quickly implemented yourself or `Vec::pop()` does the job better.
2024-02-26 20:49:21 +01:00
EdJoPaTo
ed9a54a55a feat(state)!: return true when something changed 2024-02-26 19:09:57 +01:00
EdJoPaTo
15f05be46c fix: do not move offset on unselect 2024-02-26 18:05:17 +01:00
EdJoPaTo
83dd95b87f fix(scrollbar): calculate area margin from inside and outside of border areas 2024-02-24 18:39:34 +01:00
EdJoPaTo
9a0b26f5c9 refactor(scrollbar): use variable names over unnamed pair content 2024-02-24 11:21:48 +01:00
EdJoPaTo
b31a599a37 refactor(scrollbar): experimental prefix over feature
A feature flag has quite some complexity with it and is annyoing.
Write a rustdoc comment about it and be clear about it being experimental and include it as is.
2024-02-24 11:08:30 +01:00
EdJoPaTo
98b53e448f fix(scrollbar): workaround overscroll 2024-02-24 03:09:58 +01:00
EdJoPaTo
ce3b2b530e fix(scrollbar): change margin to individual start/end 2024-02-24 03:09:58 +01:00
EdJoPaTo
86458ffc39 perf: prefer into_iter() over clone() 2024-02-24 03:09:58 +01:00
EdJoPaTo
4130a800b8 perf: get item.height() less often on render 2024-02-24 03:09:58 +01:00
EdJoPaTo
2781a2d146 refactor: deconstruct Flattened for more speakable variables 2024-02-24 03:09:58 +01:00
EdJoPaTo
4e00f07c74 fix(scrollbar): use current height rather than available height
with item height = 1 its the same but with height != 1 its not
2024-02-24 00:04:39 +01:00
EdJoPaTo
85bfecc568 fix!: remove start_corner
While is somewhat works its not used and doesnt seem that useful
2024-02-23 23:51:37 +01:00
EdJoPaTo
9e93b3ecd1 fixup! feat: support for a scrollbar 2024-02-23 23:42:41 +01:00
EdJoPaTo
92466615b1 feat: support for a scrollbar 2024-02-22 19:20:27 +01:00
EdJoPaTo
ec359d513b refactor: use multi character variable name 2024-02-22 18:38:52 +01:00
EdJoPaTo
5d750b13b0 build(lint): warn on clippy::pedantic or clippy::nursery 2024-02-22 18:32:46 +01:00
EdJoPaTo
766d4f1d58 refactor: one struct per file 2024-02-22 18:32:35 +01:00
EdJoPaTo
01726df5ed feat: scroll independently from selection 2024-02-03 02:24:44 +01:00
EdJoPaTo
4cbe932332 build: update to ratatui 0.26 2024-02-03 01:05:47 +01:00
EdJoPaTo
969b78ab06 feat: select_*() returns whether it changed 2024-01-26 05:24:17 +01:00
EdJoPaTo
632a95f853 perf(key_left): remove clones
Selection access is mutable already. Operate on it directly.
2024-01-26 05:22:20 +01:00
EdJoPaTo
d1a241266f perf!: flatten -> TreeState::flatten
This allows to use internals without cloning

BREAKING CHANGE: flatten is not directly available anymore
2024-01-15 15:50:06 +01:00
EdJoPaTo
b914819283 feat: generic identifier (#27) 2023-10-30 13:18:58 +01:00
EdJoPaTo
58a80b64a7 docs: improve doc comments 2023-10-26 16:46:50 +02:00
EdJoPaTo
9a47f5e0a9 feat: add TreeState::select_visible_index and relative 2023-10-26 00:39:14 +02:00
EdJoPaTo
89cb1dd6d9 docs: improve example code
Simplify main and use const fn.
2023-10-25 15:07:09 +02:00
EdJoPaTo
bc24ad2aa4 docs: add missing word 2023-10-25 14:59:11 +02:00
EdJoPaTo
b4d0c302b0 perf!: accept Vec explicitly
on mqttui I always cloned the vec implictly as into() cloned it.
This wasted performance.

BREAKING CHANGE: requires Vec now explicitly
2023-10-24 19:34:06 +02:00
EdJoPaTo
0d9d132a67 perf: use more const functions
This will run on compile time rather than every time on runtime.
2023-09-04 14:17:35 +02:00
EdJoPaTo
3f30effd19 feat: migrate to ratatui (#26)
Co-authored-by: Ben PHL <benphawke@gmail.com>
2023-09-04 12:44:30 +02:00
EdJoPaTo
8a53caced7 refactor(lint): improve and adapt to lints 2023-05-22 11:50:52 +02:00
EdJoPaTo
59a06ee409 perf: use empty str instead of .unwrap_or("")
dont run unwrap_or all the time and just set the default on new()
2023-05-20 02:08:34 +02:00
EdJoPaTo
838668dd53 refactor(identifier)!: return usize instead of &usize 2023-05-20 01:52:25 +02:00
EdJoPaTo
837e24ab4b perf(identifier): use pattern matching
way more efficient than manual slicing
2023-05-20 01:49:43 +02:00
EdJoPaTo
3e92570a16 feat: configure node open state symbols (#19) 2023-05-20 01:30:53 +02:00
Diego Frias
61bc6da821 fix: panic on key up/down (#16) 2023-03-20 17:26:51 +01:00
EdJoPaTo
94197fa1d1 docs: fix spelling 2023-02-22 14:04:43 +01:00
EdJoPaTo
ed4e06c000 build: ensure no unsafe code 2023-02-22 14:03:53 +01:00
EdJoPaTo
982125508c fix: do not unset the block on render 2022-11-06 13:48:49 +01:00
EdJoPaTo
a902bce55d docs: use doc comments and doc tests 2022-11-06 13:48:49 +01:00
EdJoPaTo
cf104bb495 refactor(lint): adapt to lints 2022-11-06 10:54:26 +01:00
EdJoPaTo
c8c5a37b28 feat: add TreeItem::children()
returns all the current children
2022-09-01 16:29:56 +02:00