linutil/tui/Cargo.toml

34 lines
1.2 KiB
TOML
Raw Normal View History

[package]
name = "linutil_tui"
description = "Chris Titus Tech's Linux Toolbox - Linutil is a distro-agnostic toolbox designed to simplify everyday Linux tasks."
documentation = "https://christitustech.github.io/linutil"
readme = "../README.md"
edition = "2021"
license.workspace = true
repository = "https://github.com/ChrisTitusTech/linutil/tree/main/tui"
version.workspace = true
include = ["src/*.rs", "Cargo.toml", "cool_tips.txt", "../man/linutil.1"]
2024-09-20 16:48:09 +01:00
[features]
default = ["tips"]
tips = ["rand"]
2024-09-20 16:48:09 +01:00
[dependencies]
clap = { version = "4.5.20", features = ["derive"] }
oneshot = { version = "0.1.8", features = ["std"], default-features = false }
portable-pty = "0.8.1"
ratatui = { version = "0.29.0", features = ["crossterm"], default-features = false }
tui-term = { version = "0.2.0", default-features = false }
time = { version = "0.3.36", features = ["formatting", "local-offset", "macros"], default-features = false }
unicode-width = { version = "0.2.0", default-features = false }
rand = { version = "0.8.5", optional = true }
refact: rust fixes and optimizations (#933) * fix: getting locked out when running script * Use success and fail colors and reorder imports Use theme color instead of using ratatui::Color for running_command success and fail + search preview text color + min tui warning color, add colors for confirmation prompt, fix inverted success and fail colors * Remove redundant code in themes Removed redundant match statement with a function * Fix scroll beyond list, color bleeding and refact in confirmation.rs Remove unnecessary usage of pub in ConfirmPropmt struct fields, simplify numbering, prevent scrolling beyond list, fix color bleeding * Implement case insensitive, fix word disappearing bug Use regex for case insesitive finding, implement String instead of char<Vec>, fix word disappearing by recalculating the render x for preview text * Revert "Remove redundant code in themes" This reverts commit 3b7e859af80bfa1f453928a74c47efd897e26934. * Reference instead of passing the vector * Revert regex and String implementation Use Vec<char> for search_input to prevent panics when using multi-byte characters, use lowercase conversion instead of regex, Added comments for clarity * Replace ansi and text wrapping code with ratatui Replaced ansi related code for tree sitter highlight with direct ratatui::text. Cache the processed text in appstate to remove processing of text for every frame render.Create paragraph instead of list so that scroll and wrapping can be done without external crates. Add caps keys for handle_key_event. * Fix conflicts * Reference instead of borrowing commands, refact mut variables Reference instead of borrowing commands from state, Refactor draw function variables to immutable, calculate innersize from block instead of manual definition * Update tui/src/filter.rs Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com> * Rendering optimizations and function refactors Handle `find_command` inside state itself -> `get_command_by_name`. Move tips to a seperate file for modularity. Pass the whole args to state instead of seperate args. Use const for float and confirmation prompt float sizes. Add the `longest_tab_length` to appstate struct so that it will not be calculated for each frame render use static str instead String for tips. Use function for spawning confirmprompt. Merge command list and task items list rendering a single widget instead of two. Remove redundant keys in handle_key. Optimize scrolling logic. Rename `toggle_task_list_guide` -> `enable_task_list_guide` * Cleanup Use prelude for ratatui imports. Use const for theme functions, add missing hints * Update deps, remove unused temp-dir * Add accidentally deleted preview.tape Add labels + Wait 2sec after program ends * Add fields to config files Skip Confirmation, Bypass Size * Remove accidentally commited config file --------- Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
2024-11-17 18:24:54 +00:00
linutil_core = { version = "24.10.31", path = "../core" }
tree-sitter-highlight = "0.24.4"
tree-sitter-bash = "0.23.3"
nix = { version = "0.29.0", features = [ "user" ] }
refact: rust fixes and optimizations (#933) * fix: getting locked out when running script * Use success and fail colors and reorder imports Use theme color instead of using ratatui::Color for running_command success and fail + search preview text color + min tui warning color, add colors for confirmation prompt, fix inverted success and fail colors * Remove redundant code in themes Removed redundant match statement with a function * Fix scroll beyond list, color bleeding and refact in confirmation.rs Remove unnecessary usage of pub in ConfirmPropmt struct fields, simplify numbering, prevent scrolling beyond list, fix color bleeding * Implement case insensitive, fix word disappearing bug Use regex for case insesitive finding, implement String instead of char<Vec>, fix word disappearing by recalculating the render x for preview text * Revert "Remove redundant code in themes" This reverts commit 3b7e859af80bfa1f453928a74c47efd897e26934. * Reference instead of passing the vector * Revert regex and String implementation Use Vec<char> for search_input to prevent panics when using multi-byte characters, use lowercase conversion instead of regex, Added comments for clarity * Replace ansi and text wrapping code with ratatui Replaced ansi related code for tree sitter highlight with direct ratatui::text. Cache the processed text in appstate to remove processing of text for every frame render.Create paragraph instead of list so that scroll and wrapping can be done without external crates. Add caps keys for handle_key_event. * Fix conflicts * Reference instead of borrowing commands, refact mut variables Reference instead of borrowing commands from state, Refactor draw function variables to immutable, calculate innersize from block instead of manual definition * Update tui/src/filter.rs Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com> * Rendering optimizations and function refactors Handle `find_command` inside state itself -> `get_command_by_name`. Move tips to a seperate file for modularity. Pass the whole args to state instead of seperate args. Use const for float and confirmation prompt float sizes. Add the `longest_tab_length` to appstate struct so that it will not be calculated for each frame render use static str instead String for tips. Use function for spawning confirmprompt. Merge command list and task items list rendering a single widget instead of two. Remove redundant keys in handle_key. Optimize scrolling logic. Rename `toggle_task_list_guide` -> `enable_task_list_guide` * Cleanup Use prelude for ratatui imports. Use const for theme functions, add missing hints * Update deps, remove unused temp-dir * Add accidentally deleted preview.tape Add labels + Wait 2sec after program ends * Add fields to config files Skip Confirmation, Bypass Size * Remove accidentally commited config file --------- Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
2024-11-17 18:24:54 +00:00
vt100-ctt = "0.16.0"
[[bin]]
name = "linutil"
2024-09-20 16:48:09 +01:00
path = "src/main.rs"