Commit Graph

194 Commits

Author SHA1 Message Date
6c10db760d fix: Changed the implementation to not require the direct use of identifiers, and to instead generate them using the hashes of the contents of each tree item 2024-11-14 17:35:40 -07:00
8a91f662dd fix: Changed the type constraints to use the ToText Ratatui trait 2024-11-14 16:38:38 -07:00
37d7b77f90 fix: Corrected doctests to pass 2024-11-14 16:04:39 -07:00
3e23a73f6b feat: Updated the Ratatui Tree Widget to allow the tree to story any data type that implements Into<Text>, so that users can also easily fetch data from within the tree based on what's selected for non-text data types. 2024-11-14 15:38:37 -07:00
735f111866 feat: Changed the tree to accept any type that implements Into<Text> so I can use the tree to fully store structs in the TUI as well as listing them 2024-11-13 13:06:15 -07:00
6e66e3e398 feat: Added the ability to get the text of any given TreeItem 2024-11-11 18:00:49 -07:00
EdJoPaTo
c6d1a5c7e5 build: v0.23.0 2024-10-31 13:32:59 +01:00
Terakomari
422b3ce260 build: bump ratatui to 0.29 (#44) 2024-10-31 13:31:25 +01:00
EdJoPaTo
78bfd653b3 ci(rust): improve workflow 2024-10-24 12:18:14 +02:00
EdJoPaTo
e6694060ed style: add rustfmt.toml 2024-10-24 12:09:33 +02:00
dependabot[bot]
b913dcda77 build(cargo): update unicode-width requirement from 0.1 to 0.2 (#43)
Updates the requirements on [unicode-width](https://github.com/unicode-rs/unicode-width) to permit the latest version.
- [Commits](https://github.com/unicode-rs/unicode-width/commits)

---
updated-dependencies:
- dependency-name: unicode-width
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-01 11:22:32 +02:00
EdJoPaTo
f777df7015 build: v0.22.0 2024-08-07 16:23:34 +02:00
Justin Restivo
e9ac48dba1 build: update ratatui to v0.28 (#41) 2024-08-07 15:46:20 +02:00
EdJoPaTo
84066758ef fixup! build: update ratatui to v0.27 (#40) 2024-07-09 22:36:27 +02:00
EdJoPaTo
a4ad85bd7a build: v0.21.0 2024-06-28 16:13:23 +02:00
Justin Restivo
42910cb919 build: update ratatui to v0.27 (#40) 2024-06-28 15:55:36 +02:00
EdJoPaTo
b5fc5ca693 fix(example): exit on Ctrl+C 2024-06-08 17:21:00 +02:00
EdJoPaTo
d676f66504 fix: must_use the structs 2024-05-23 15:15:08 +02:00
EdJoPaTo
136599257a build(cargo): include examples and benches 2024-05-22 21:59:35 +02:00
EdJoPaTo
569043ebfd build: v0.20.0 2024-05-22 21:14:55 +02:00
EdJoPaTo
051f49fd72 refactor(state)!: use same naming pattern for getters
BREAKING CHANGE: instead of deprecating selected, change it directly.
The old behaviour can be achieved with a `.collect::<Vec<_>>()` easily.
2024-05-22 14:52:57 +02:00
EdJoPaTo
d23f55b2ad feat(state): click_at (#36) 2024-05-22 08:35:06 +02:00
wenqian
c2b2340ef4 feat(tree_item): add method to expose identifier (#38) 2024-05-22 05:53:06 +02:00
sandercm
b07b537067 perf: take Tree::new items by reference (#32)
Co-authored-by: EdJoPaTo <rfc-conform-git-commit-email@funny-long-domain-label-everyone-hates-as-it-is-too-long.edjopato.de>
2024-05-16 10:21:38 +02:00
EdJoPaTo
fc2495396f fixup! refactor: improve lifetime names 2024-05-15 17:08:35 +02:00
EdJoPaTo
2fd909aa0f refactor(flatten): improve variable/test names 2024-05-15 14:45:01 +02:00
EdJoPaTo
2811a79713 perf(state): less clones on handling the selection 2024-05-15 13:51:54 +02:00
EdJoPaTo
bba94dcf88 perf(state): const get_open
no need for additional logic, its read only anyway

The only reason for this was to keep the API with less breaking changes.
Performance is more important.
2024-05-15 13:51:54 +02:00
EdJoPaTo
fa85e7bb56 test: check rendered results 2024-05-15 13:51:54 +02:00
EdJoPaTo
9dcccba31d refactor: improve lifetime names 2024-05-15 13:51:54 +02:00
EdJoPaTo
04ecf5388f docs(state): improve comments 2024-05-15 13:51:54 +02:00
EdJoPaTo
a20134bdcd feat(example): debounce, top right corner performance info and update on resize 2024-05-15 13:51:54 +02:00
EdJoPaTo
65fd1c04ed refactor!: reuse text style of tree item
BREAKING CHANGE: TreeItem style is gone
2024-05-15 13:51:54 +02:00
EdJoPaTo
775e5cc4ef refactor(TreeItem): simplify with Self 2024-05-15 13:51:54 +02:00
EdJoPaTo
202e8d874c style: split import groups correctly 2024-05-15 13:51:54 +02:00
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
701be9315d test(bench): add benchmark 2024-05-15 12:49:37 +02:00
EdJoPaTo
37ade72330 refactor(item): use keyword Self 2024-05-15 12:49:37 +02:00
EdJoPaTo
68d19b0a58 ci(rust): improve workflow 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
d5f3635613 build: v0.19.0 2024-02-26 21:12:44 +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
0a5c7d6cfb refactor(example): move draw to App::draw 2024-02-26 18:09:26 +01:00
EdJoPaTo
15f05be46c fix: do not move offset on unselect 2024-02-26 18:05:17 +01:00
EdJoPaTo
d3386fe016 build: v0.18.0 2024-02-24 18:39:38 +01:00