Commit graph

1380 commits

Author SHA1 Message Date
Clement Tsang
de765fc364
Merge pull request #730 from ClementTsang/consolidate_tables
This serves as somewhat of an intermediary refactor to unify some scrollable table code - in particular, in regards to drawing. This is almost a parallel refactor as #710, which did something similar for time graphs. However, this one has a bit more work in regards to the concepts of component state, in particular, for width calculation caching and scroll position management.
2022-05-16 21:03:20 -04:00
ClementTsang
01574c8afe bug: hide user column for non-unix 2022-05-16 15:08:46 -04:00
Clement Tsang
b65a910257
Merge pull request #729 from ClementTsang/refactor_process_widget_into_tables
Refactors how the process widget to work with the (maybe better) consolidated tables code, as well as refactoring a bunch of old logic.
2022-05-16 14:53:05 -04:00
ClementTsang
cc6d7b8ad7 bug: fix a variety of bugs
Bugs squashed:
- Incorrect column sizing for flex cases
- Case where the sort menu bounds were still existing despite being
  hidden
- Proc widget not actually taking into account the calculated row widths
  in some cases during data conversion.
2022-05-16 04:53:41 -04:00
ClementTsang
0831a56341 refactor: simplify partial ordering fn, clean up code 2022-05-15 21:02:33 -04:00
ClementTsang
1877ed5c88 refactor: remove redundant get_ordering fn, add tests 2022-05-15 21:02:33 -04:00
ClementTsang
ba362f81c9 bug: fix issues with macos and windows during refactor 2022-05-15 21:02:33 -04:00
ClementTsang
05e9cd4d4d other: delete redundant code, run clippy and fmt 2022-05-15 21:02:33 -04:00
ClementTsang
ed17264832 refactor: more work towards unifying process code
A bunch of work towards also refactoring how the process widget
gathers and converts data.
2022-05-15 21:02:33 -04:00
ClementTsang
7ee6f6a737 refactor: begin migration of process widget 2022-05-15 21:02:28 -04:00
ClementTsang
69ec526dc6 refactor: heavily simplify the old network legend 2022-05-15 05:03:42 -04:00
ClementTsang
c97126df22 refactor: move CPU graph over to new system 2022-05-07 20:53:52 -04:00
ClementTsang
9e63642e9c refactor: fix off-by-one bug with getting start position 2022-05-07 20:53:52 -04:00
ClementTsang
df1a418327 refactor: per-row styling, remove seemingly redundant table code 2022-05-07 20:53:52 -04:00
ClementTsang
2e51590bf5 refactor: don't draw header if too short 2022-05-07 20:53:52 -04:00
ClementTsang
c296b8bf5a refactor: bind the start and end ranges for tables 2022-05-07 20:53:52 -04:00
ClementTsang
64ed45083e refactor: remove unneeded freeze param 2022-05-07 20:53:52 -04:00
ClementTsang
2a65bc95fe refactor: consolidate disk and temp table drawing, refactor state
Disk and temp tables now share the same drawing logic, as well as
consolidating the "text table" states into one single state, as opposed
to two separate states (one for scroll and one for width calculations).

BTW I know this is kinda an ugly design - creating a giant struct to
call a function - hopefully that's temporary, I want to do a bigger
refactor to consolidate more stuff together and therefore avoid this
problem, but baby steps, right?
2022-05-07 20:53:52 -04:00
ClementTsang
45680dafcf docs: clean up troubleshooting page again 2022-05-07 20:01:11 -04:00
Clement Tsang
98e7fbbeab
ci: add back paths field to coverage workflow (#728) 2022-05-07 19:57:56 -04:00
Clement Tsang
a26cffce05
docs: update mkdocs-material to 8.2.13 (#727) 2022-05-07 19:57:12 -04:00
ClementTsang
c09322fdc2 docs: add even more troubleshooting documentation 2022-05-07 19:48:32 -04:00
ClementTsang
4d507d1793 docs: add more troubleshooting documentation 2022-05-07 19:38:37 -04:00
Clement Tsang
460869f281
deployment: add arm musl targets (#726)
Adds musl targets to the nightly and deployment workflows.
2022-05-07 15:53:39 -04:00
Clement Tsang
4ceaf8d008
deps: migrate to starship-battery (#724)
Migrates the `battery` dependency to the more actively maintained
`starship-battery` fork, found at https://github.com/starship/rust-battery.
See https://github.com/svartalf/rust-battery/pull/92 for more information.
2022-05-06 17:16:57 -04:00
ClementTsang
9d6d712e27 docs: update description for winget in README 2022-05-04 14:51:59 -04:00
ClementTsang
af4756c930 docs: add snap install option to README 2022-05-04 14:49:31 -04:00
ClementTsang
4fac7ab4fa github: fix typo in packaging issue template 2022-05-04 14:48:10 -04:00
Clement Tsang
dd9111467a
github: update packaging issue wording 2022-05-03 19:07:10 -04:00
Clement Tsang
9882a9bd08
ci: move cargo fmt step into supported job (#722)
Moves the rustfmt step into the supported job, to avoid having to wait too long for machine spinup time if they are separate jobs.
2022-05-01 17:53:08 -04:00
Clement Tsang
2629709c5d
Merge pull request #721 from ClementTsang/remove_cache_from_fmt
Removes the caching step from the cargo fmt check as it does nothing. Also adds an extra test for if the battery feature is disabled.
2022-05-01 17:40:22 -04:00
ClementTsang
715af44efc ci: create deploy feature; test in CI
This encompasses features that we want on deployment.
2022-05-01 17:30:20 -04:00
ClementTsang
798683b81f other: add test for battery flag if battery feature is off 2022-05-01 17:15:54 -04:00
ClementTsang
6e2ea8eeda ci: remove caching step from cargo fmt check 2022-05-01 17:12:20 -04:00
Clement Tsang
c44e860af8
Merge pull request #720 from ClementTsang/ci_shortening
Cleaned up and updated the primary GitHub CI workflow. Also fixes a bug caught during this check.
2022-05-01 17:08:53 -04:00
ClementTsang
a92313a5be bug: fix panic if battery feature was disabled 2022-05-01 16:57:03 -04:00
ClementTsang
8cc361e443 ci: clean up ci workflow 2022-05-01 16:56:40 -04:00
ClementTsang
a9da449cef ci: update rust-cache to 1.4.0 2022-05-01 15:47:30 -04:00
Clement Tsang
e646a76630
ci: disable debug symbols and incremental in CI, force locked #719
Disables incremental compilation and debug symbols in CI and other related workflows, since they're not used there at all. Also forces --locked as needed.
2022-04-29 18:15:49 -04:00
Clement Tsang
a516104dec
refactor: refactor some tests (#718)
Small PR to quickly refactor some recent tests to avoid too much duplication.
2022-04-29 16:02:34 -04:00
Clement Tsang
cddee9d923
Merge pull request #710 from ClementTsang/consolidate_component_drawing
Cleans up some drawing code and unifies all time graph drawing.
2022-04-29 01:12:14 -04:00
ClementTsang
2401e583fb refactor: consolidate time graph components
This consolidates all the time graph drawing to one main location, as well
as some small improvements. This is helpful in that I don't have to
reimplement the same thing across three locations if I have to make one
change that in theory should affect them all. In particular, the CPU
graph, memory graph, and network graph are all now using the same,
generic implementation for drawing, which we call (for now) a component.

Note this only affects drawing - it accepts some parameters affecting style
and labels, as well as data points, and draw similarly to how it used to
before. Widget-specific actions, or things affecting widget state,
should all be handled by the widget-specific code instead. For example,
our current implementation of x-axis autohide is still controlled by the
widget, not the component, even if some of the code is shared. Components
are, again, only responsible for drawing (at least for now). For that
matter, the graph component does not have mutable access to any form of
state outside of tui-rs' `Frame`. Note this *might* change in the
future, where we might give the component state.

Note that while functionally, the graph behaviour for now is basically
the same, a few changes were made internally other than the move to
components. The big change is that rather than using tui-rs' `Chart`
for the underlying drawing, we now use a tweaked custom `TimeChart`
tui-rs widget, which also handles all interpolation steps and some extra
customization. Personally, I don't like having to deviate from the
library's implementation, but this gives us more flexibility and allows
greater control. For example, this allows me to move away from the old
hacks required to do interpolation (where I had to mutate the existing
list to avoid having to reallocate an extra vector just to insert one
extra interpolated point). I can also finally allow customizable
legends (which will be added in the future).
2022-04-28 23:36:53 -04:00
Clement Tsang
e393078691
bug: fix choosing an out of list bounds selecting the last entry (#717)
This is a simple bug fix that changes the behaviour of a scroll select
(and column select) to only update if the updated position is _within_
the bounds of the list (0 to the max index, inclusive). Prior to this,
all the implementations but the disk implementation would just bound the
change. This was both inconsistent with the disk scroll state, but also
jarring since this meant a user could click on seemingly empty space but
it would somehow click on the very last entry.

This change also unifies the scroll calculation function between all the
scroll select functions. Ideally we get rid of the intermediary
functions but that might require more refactoring than I want for this
fairly simple bug fix.

The column select scroll calculation was also changed to fit this
behaviour, but it does not use the same logic as the other scroll
states. What could be done in the future is a generic implementation for
direction (or maybe just "increment vs. decrement") to share it all.
2022-04-28 22:39:33 -04:00
ClementTsang
17dbea9a09 docs: add back TOC 2022-04-28 20:37:41 -04:00
Clement Tsang
0d1b6a6d33
github: specify in the bug report that one should install from crates/bottom 2022-04-28 14:52:27 -04:00
ClementTsang
1f731358ba refactor: remove dead config screen code
This code was never used and might as well be removed for clarity's
sake.
2022-04-28 01:40:10 -04:00
ClementTsang
f68acc5c9d refactor: remove trait usage in component drawing
When I was newer to Rust, I got the weird impression that you couldn't
add functionality to a struct outside of the defining file without using
a trait.

That's obviously not true, so it's high time I got rid of it and just
made it part of the impl of the class itself, rather than declaring a
trait and then exporting/importing it.
2022-04-28 01:40:10 -04:00
Clement Tsang
b9a356f581
ci: lock cargo-llvm-cov install in script (#715)
Super small change, install cargo-llvm-cov with --locked.
2022-04-28 01:39:58 -04:00
Clement Tsang
8a133908f4
Merge pull request #714 from ClementTsang/switch_to_llvm_cov
Experiment with llvm-cov over tarpaulin.

Tarpaulin is supposed to be switching to something similar to how this works in the future as well, so I might switch back then if I switch now.
2022-04-28 01:33:57 -04:00
ClementTsang
19430a1a49 ci: reduce code cov skip conditions 2022-04-28 01:18:27 -04:00