summaryrefslogtreecommitdiffstats
path: root/src/app.rs
AgeCommit message (Collapse)Author
2021-09-05refactor: delete a bunch of old unused codeClementTsang
2021-09-05refactor: move basic mode overClementTsang
Because writing your own layout system and management is just *so much fun*. Totally. ------------------------------------------------------------------- Moves the basic mode system over to the new drawing/widget system. In the process, it has forced me to completely redo how we do layouts... again. This is because basic mode has widgets that control their own height - this means the height of the columns and rows that wrap it are also affected by the widget's height. The previous system, using a constraint tree and splitting draw Rects via tui-rs' built-in constraint solver, did not support this concept very well. It was not simple to propagate up the widths/heights towards parents while also using tui-rs' built-in constraint solver. In the end, it was easier to just rewrite it using another algorithm. We now follow a process very similar to Flutter's layout system. Relevant links to the Flutter docs are found in the code or below: - https://flutter.dev/docs/development/ui/layout/constraints - https://flutter.dev/docs/resources/inside-flutter#sublinear-layouts The gist of it, however, is that we now instead a few new options for any element in the layout tree. A node can either: - Grow to fill remaining space - Take up as much room as its children - Be a specific length Technically right now, it's not perfect, in that leaf nodes can be as large as their children (which makes no sense), though in that case it just treats it as an expand.
2021-09-05refactor: add back grouping and commandClementTsang
2021-09-05refactor: add text inputClementTsang
2021-08-30bug: fix bug causing click bounds to failClementTsang
There were three bugs: 1. The click bounds calculation was incorrect. I did the silly mistake of checking for <= bounds for the bottom and right sections of a Rect when checking if the mouse intersected - this is WRONG. For example, let's say you want to calculate if an x value of 5 falls between something that starts at 0 and is 5 long. It shouldn't, right? Because it draws from 0 to 4? But if you just did <= Rect.right(), you would get a hit - because it just does (start + width), so you get 5, and 5 <= 5! So, easy fix, change all far bounds checks to <. 2. The second bug is a mistake where I accidentally did not include bounds sets for my memory and net widgets. Instead, they set their bounds to the underlying graph representation, which is WRONG, since that bound gets updated on draw, and gets set to a slightly smaller rect due to borders! 3. A slightly sneakier one. This broke my bounds checks for the CPU widget - and it would have broken my process widget too. The problem lies in the concept of widgets that handle multiple "sub"-blocks internally, and how I was doing click detection internally - I would check if the bounds of the internal Components were hit. Say, the CPU, I would check if the internal graph was hit, then if the internal table was hit. But wait! I said in point 2 that a graph gets its borders updated on draw to something slightly smaller, due to borders! And there's the problem - it affected tables too. I was setting the bounds of components to that of the *internal* representation - without borders - but my click detection *needed* borders included! Solution? Add another trait function to check bordered bounds, and make the default implementation just check the existing bounds. For cases like internal Components that may need it, I add a separate implementation. I also switched over all border bounds checks for Widgets to that, since it's a bit more consistent.
2021-08-29refactor: change up event handling logisticsClementTsang
Slightly move around the ideas of EventResult, ReturnSignalResult, and how they all work. The gist of it is that we now have widgets returning EventResults (and renamed to WidgetEventResult), and the main app event handler returns ReturnSignalResult (now named EventResult). Also add a new signal to handle re-updating data inputs! This is needed for the process, and any sortable/configurable widget.
2021-08-29refactor: Add data updating to process widgetClementTsang
2021-08-28refactor: port over graph widgetsClementTsang
Things working as of now: - Actually drawing - Interpolation - Styling
2021-08-28refactor: start moving over the event systemClementTsang
2021-08-28refactor: start moving over drawing systemClementTsang
In particular, moving over table-style widgets
2021-08-24refactor: rip out trait system for drawing widgetsClementTsang
This rips out this weird trait system I previously used for drawing widgets, where I implemented a trait onto the Painter struct that did the drawing. I have no idea what I was thinking back then.
2021-08-24refactor: more glue code to build layoutClementTsang
Even more glue code to help glue together our layout options to our new layout system! Note that this PR will most likely likely break the two options: - default_widget_type - default_widget_count and as such, they'll probably be deleted in a later commit. As for why, it's since they're kinda a pain to support and don't work well. Users can still enable default widget selection through the layout system (which will also see a revamp in the future).
2021-08-23refactor: Create basic widget systemClementTsang
2021-08-23refactor: clean up some states and codeClementTsang
2021-08-23refactor: Start state refactorClementTsang
2021-06-22feature: add F9 as an alternative process kill key (#518)Clement Tsang
Adds F9 as an alternative kill shortcut to dd.
2021-06-21docs: migrate documentation over to mkdocs (#506)Clement Tsang
A large migration of documentation over to mkdocs, and some rewrites. Some stuff (install information, basic supported systems, contributors, thanks) are still staying in README.md, and CONTRIBUTING.md is essentially duplicated right now. However, stuff like configuration and key/mouse bindings are now moved to mkdocs. Some parts are still a bit WIP - it is definitely not done (documentation never seems to be...). However, it should be "good enough" for now, and I'm much happier working with the documentation in this form than trying to scroll through a giant endless README.md file. It also works much better for adding new documentation.
2021-06-20bug: Fix battery widget color and mouse (#504)Clement Tsang
Fixes two bugs causing the battery widget colours and mouse events to be broken.
2021-05-09other: lower the timer for multi-digit in dd times (#469)Clement Tsang
Lowers the timer for multi-digit inputs in dd. I'm going to eventually completely rewrite the input part for the entire application though, but this will do for now.
2021-04-23bug: Fix mouse hitboxes (#459)Clement Tsang
Fixes the mouse hitbox checks overextending by 1. Also reverts the bandaid fix done for #458.
2021-04-22feature: Add mount filtering, rework filter priority logic (#455)Clement Tsang
This PR accomplishes two things: 1. This PR aims to add mount_filter to the config file. This allows a user to filter their disk widget entries by the mount name as well; this was particularly a problem in trying to address #431. 2. A slight rework of how the filter system works due to the need of being able to manage two potentially conflicting filter sources, since the disk widget will now potentially filter on both the disk name and the mount name. In regards to the second point, the new behaviour is as such: 1. Is the entry allowed through any filter? That is, does it match an entry in a filter where is_list_ignored is false? If so, we always keep this entry. 2. Is the entry denied through any filter? That is, does it match an entry in a filter where is_list_ignored is true? If so, we always deny this entry. 3. Anything else is allowed. This main (breaking) change is really the third point. This would mean that temp_filter and net_filter, when set to allow listed entries with is_list_ignored = false, are kinda... useless, as a whitelist in the scenario of being the only filter is kinda pointless. But hopefully this shouldn't be a problem...?
2021-04-04feature: Rework network y-axis, linear interpolation for off-screen data (#437)Clement Tsang
Rewrite of the y-axis labeling and scaling for the network widget, along with more customization. This still has one step to be optimized (cache results so we don't have to recalculate the legend each time), but will be done in another PR for sake of this one being too large already. Furthermore, this change adds linear interpolation at the 0 point in the case a data point shoots too far back - this seems to have lead to ugly gaps to the left of graphs in some cases, because the left hand limit was not big enough for the data point. We address this by grabbing values just outside the time range and linearly interpolating at the leftmost limit. This affects all graph widgets (CPU, mem, network). This can be optimized, and will hopefully be prior to release in a separate change.
2021-02-28feature: User info in proc widget for Unix-based systems (#425)Clement Tsang
Adds users into the process widget (for Unix-based systems). This shows only in non-grouped modes, similar to state. Search is also supported. In addition, a quick fix to prevent users from being in grouped mode when they tried to enter tree mode while grouped.
2021-02-19deps: Update various deps as per 2021-02-19 (#420)Clement Tsang
Major update is tui-rs from 0.13 to 0.14. This change allows us to update our tables to make them look nicer!
2021-02-19change: Don't jump to top when using sort shortcuts (#418)Clement Tsang
For consistency, we now don't automatically jump to the top of the list when using a sort shortcut. This behaviour already occurred with the sort menu and sorting by mouse clicks, so this is just now more consistent (and IMO less annoying, you can also always jump to the top via gg).
2021-02-19bug: Fix sorting menu and sort shortcuts not syncing in gui (#417)Clement Tsang
Fixes sorting menus and shortcuts not syncing correctly if the sorting window is open.
2021-02-18feature: Add mouse support to sorting columns (#413)Clement Tsang
Adds mouse support for sorting columns within the process widget. You can now click on the column header to sort (or invert the sort).
2021-02-16feature: Add ctrl-w and ctrl-h support in the search (#409)Clement Tsang
Ctrl-w deletes one word backwards from the current cursor location. Ctrl-h is just an alias for backspace.
2021-02-15feature: Allow toggling advanced kill menu (#408)Clement Tsang
Allows toggling the advanced kill menu via --advanced_kill or advanced_kill=true.
2021-02-15feature: add nord and nord-light colours (#406)Clement Tsang
Adds colour schemes for Nord, along with a light variant.
2021-01-12bug: Fix missing sorting arrow when for non-% mem (#389)Clement Tsang
Fixes a bug where you could make the sorting arrow disappear in the mem column if you did: 1. Go to proc widget 2. Switch to memory values from % 3. Press `m`
2021-01-01feature: Add network interface filtering (#381)Clement Tsang
Adds a new option in the config file to filter out network interfaces. Also add the option to filter by whole words. Interface follows that of the existing ones: ```toml [net_filter] is_list_ignored = false list = ["virbr0.*"] regex = true case_sensitive = false whole_word = false ```
2020-12-15feature: Fine grained kill signals on unix (#263)Lukas Rysavy
* feature: added signal selection for killing in unix * feature: set default signal to 15 (TERM) * feature: selecting kill signal number with number keys * feature: mouse selection of kill signals * fix: restore working previous kill dialog for win * bug: more fixes for killing on windows * feature: made two digit number selection only work in time window * feature: replaced grid with scrollable list for kill signal selection * fix: handling scrolling myself * chore: replaced tui list with span so we actually know for sure where the buttons are * feature: always display cancel button in kill signal selection * chore: simplified as suggested in review * fix: made scrolling in kill list more intuitive * fix: differentiating macos from linux signals * fix: fixed reversed kill confirmation movement * chore: fixed unused warnings for windows * feature: added G and gg keybindings for kill signal list
2020-11-28feature: Add scroll indicator to keep track of table position in widgets. (#333)Clement Tsang
Adds the option to enable an "out of" indicator for scrollable table widgets (using --show_table_scroll_position).
2020-11-19feature: Add mem_as_value flag (#309)Clement Tsang
Adds a new flag, --mem_as_value (and its corresponding config option, mem_as_value = true), which defaults to showing process memory values by their amount rather than percentage.
2020-11-18feature: Add collapsible tree entries (#304)Clement Tsang
Adds collapsible trees to the tree mode for processes. These can be toggled via the + or - keys and the mouse by clicking on a selected entry.
2020-11-02bug: fix incorrect basic cpu spacing (#291)Clement Tsang
Fixes a bug with CPU spacing on basic mode.
2020-10-17feature: Add simple indicator for when data updating is frozen (#269)Clement Tsang
2020-09-30feature: add --debug flag for logging (#259)Clement Tsang
Adds a `--debug` flag to aid in debugging issues. This saves to `/tmp/bottom_debug.log`.
2020-09-28feature: Add persistent search settings (#257)Clement Tsang
Adds persistent search settings across runs, by saving to the config file. Each process widget keeps track of it's *own* behaviour. The previous flags/options are now for *global* behaviour. The following new behaviour is: - Relevant flags: `--case_sensitive`, `--whole_word`, and `--regex`, will *override* the current widget's default behaviour. - Relevant options: `case_sensitive`, `whole_word`, and `regex`, will also *override* the current widget's default behaviour. As per before, if you set, say, `--case_sensitive`and `case_sensitive=true`, the flag always overrides. Documentation updates will be done in #248.
2020-09-26refactor: tui-rs 0.11.0 refactor (#253)Clement Tsang
Refactors tui-rs usage to the new 0.11.0 release. This release also fixes the highlighting bug from #249, and now, expanding a widget no longer overrides the widget title colour. This commit also introduces #255, but that seems to be easy to bandaid so hopefully it will get fixed soon?
2020-09-22feature: Beginnings of in-app config (#231)Clement Tsang
Initial refactorings and additions to support in-app config. - Refactor our current options logic to support in-app configs. That is, we can write to a config file with our changes now. - The default action when creating a new config file is to leave it blank. (TBD and for now, not sure on this one) - Previously, we would set everything in a config file on startup; now we need to read from the config TOML struct whenever. - `C` keybind is now occupied for configs. - `no_write` option to never write to a config file.
2020-09-11feature: mouse support for tabs and dd dialog (#230)Clement Tsang
2020-09-09refactor: rewrite column algorithm (#227)Clement Tsang
Update how we position and generate column widths to look less terrible. This also adds truncation w/ ellipsis to the columns, and for processes, the state will automatically shrink to a short form (just a character) if there isn't enough space.
2020-09-06feature: Adds tree view (#223)Clement Tsang
Adds a tree process view to bottom. Currently uses a pretty jank method of column width setting, should get fixed in #225.
2020-09-06fix: Fixes count being sortable, but nothing occuring (#224)Clement Tsang
Fixes sorting by count being available, but doing nothing. This fix makes it sortable.
2020-09-05fix: Fix mouse detection not working on proc after closing searchClementTsang
2020-09-02feature: Add ability to filter out disks and temp (#220)Clement Tsang
You can now filter out disks and temp sensors by name via config.
2020-09-02bug: fix being able to click widgets when dd-dialog was open (#219)Clement Tsang
Fixes a bug where you could click on a widget when dd's dialog was open.
2020-08-29feature: Allow Ctrl-F and / to work in sort (#212)Clement Tsang
Fixes a bug, and also allows `Ctrl-F` and `/` to work in the sort widget.