Skip to content

feature: show graph legend in more situations - #2031

Merged
ClementTsang merged 3 commits into
mainfrom
fix-mem-legend-hiding
Apr 12, 2026
Merged

feature: show graph legend in more situations#2031
ClementTsang merged 3 commits into
mainfrom
fix-mem-legend-hiding

Conversation

@ClementTsang

Copy link
Copy Markdown
Owner

Description

A description of the change, what it does, and why it was made. If relevant (e.g. UI changes), please also provide screenshots/recordings:

This PR makes it so that instead of always just hiding the entire legend if it's too big for the current size, we instead show less parts of the legend to make it fit. For example, if it's too tall, we just show less entries. If it is too wide, but other entries still would fit, we truncate the entries that are too long so they fit.

This is somewhat helpful because in the memory widget, the GPU entry at the moment is causing the legend to hide in situations where it used to not. We can also do more work to make that better, but IMO not always hiding the legend also makes sense to have in general.

Issue

If applicable, what issue does this address?

Closes: #1999

Testing

If relevant, please state how this was tested (including steps):

If this change affects the program, please also indicate which platforms were tested:

  • Windows
  • macOS (specify version below)
  • Linux (specify distro below)
  • Other (specify below)

Checklist

Ensure all of these are met:

  • If this PR adds or changes a dependency, please justify this in the description
  • If this is a code change, areas your change affects have been linted using (cargo fmt)
  • If this is a code change, your changes pass cargo clippy --all -- -D warnings
  • If this is a code change, new tests were added if relevant
  • If this is a code change, your changes pass cargo test
  • The change has been tested to work (see above) and doesn't appear to break other things
  • Documentation has been updated if needed (README.md, help menu, docs, configs, etc.)
  • There are no merge conflicts
  • You have reviewed your changes first
  • The pull request passes the provided CI pipeline

Other

Anything else that maintainers should know about this PR:

@codecov

codecov Bot commented Apr 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.74797% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.62%. Comparing base (ddd8d87) to head (470bbc3).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/canvas/widgets/network_graph.rs 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2031      +/-   ##
==========================================
+ Coverage   60.43%   60.62%   +0.18%     
==========================================
  Files         122      122              
  Lines       16959    17049      +90     
==========================================
+ Hits        10250    10336      +86     
- Misses       6709     6713       +4     
Flag Coverage Δ
macos-14 46.85% <86.17%> (+0.23%) ⬆️
ubuntu-24.04 59.40% <96.74%> (+0.20%) ⬆️
windows-2022 46.41% <86.17%> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This PR makes it so that instead of always just hiding the entire legend
if it's too big for the current size, we instead show less parts of the
legend to make it fit. For example, if it's too tall, we just show less
entries. If it is too wide, but other entries still would fit, we
truncate the entries that are too long so they fit.
@ClementTsang
ClementTsang force-pushed the fix-mem-legend-hiding branch from 00734a1 to 470bbc3 Compare April 12, 2026 06:46
@ClementTsang
ClementTsang merged commit 0f0fa21 into main Apr 12, 2026
38 checks passed
@ClementTsang
ClementTsang deleted the fix-mem-legend-hiding branch April 12, 2026 07:03
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jul 9, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ClementTsang/bottom](https://github.com/ClementTsang/bottom) | minor | `0.12.3` → `0.14.3` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>ClementTsang/bottom (ClementTsang/bottom)</summary>

### [`v0.14.3`](https://github.com/ClementTsang/bottom/blob/HEAD/CHANGELOG.md#0143---2026-07-01)

[Compare Source](ClementTsang/bottom@0.14.2...0.14.3)

##### Other

- [#&#8203;2119](ClementTsang/bottom#2119): Add workaround for draw behaviour that caused Kitty with `cursor_trail` to occasionally use more CPU.

### [`v0.14.2`](https://github.com/ClementTsang/bottom/blob/HEAD/CHANGELOG.md#0142---2026-06-27)

[Compare Source](ClementTsang/bottom@0.14.1...0.14.2)

##### Other

- [#&#8203;2109](ClementTsang/bottom#2109): Relocate the schema generation tool to avoid it interfering with `cargo install`.

### [`v0.14.1`](https://github.com/ClementTsang/bottom/blob/HEAD/CHANGELOG.md#0141---2026-06-22)

[Compare Source](ClementTsang/bottom@0.14.0...0.14.1)

##### Other

- [#&#8203;2096](ClementTsang/bottom#2096): Fix documentation suggestions around `memory_graph`.
- [#&#8203;2102](ClementTsang/bottom#2102): Mention memory/network alias in deprecation warnings.

### [`v0.14.0`](https://github.com/ClementTsang/bottom/blob/HEAD/CHANGELOG.md#0140---2026-06-20)

[Compare Source](ClementTsang/bottom@0.13.0...0.14.0)

##### Bug Fixes

- [#&#8203;2093](ClementTsang/bottom#2093): Fix memory collection using cgroup v1 sentinel max as total.

##### Features

- [#&#8203;2055](ClementTsang/bottom#2055): Add UFS disk I/O counters for FreeBSD.

##### Other

- [#&#8203;2052](ClementTsang/bottom#2052): Update minimum Rust version to 1.95.0.
- [#&#8203;2055](ClementTsang/bottom#2055): Use sysinfo for disk I/O for FreeBSD.

### [`v0.13.0`](https://github.com/ClementTsang/bottom/blob/HEAD/CHANGELOG.md#0130---2026-06-19)

[Compare Source](ClementTsang/bottom@0.12.3...0.13.0)

##### Bug Fixes

- [#&#8203;2035](ClementTsang/bottom#2035): Fix panic when deleting unicode words in search.
- [#&#8203;2042](ClementTsang/bottom#2042): Address possible memory usage growth for AMD GPU stat gathering on Linux.
- [#&#8203;2069](ClementTsang/bottom#2069): Fix issue in process search with parsing quoted delimiters.

##### Features

- [#&#8203;1938](ClementTsang/bottom#1938), [#&#8203;1980](ClementTsang/bottom#1980): Report average packet size and packet rate.
- [#&#8203;2003](ClementTsang/bottom#2003): Configurable default sort column for temperature and disk table widgets.
- [#&#8203;1979](ClementTsang/bottom#1979): Add a global `bg_colour` config option to set widget background colour.
- [#&#8203;2039](ClementTsang/bottom#2039): Add a config option for drawing a line separator (`table_gap`) between the column headers and data.
- [#&#8203;1948](ClementTsang/bottom#1948): Add support for both an `!=` operator and `!` negation prefixes in query searches.
- [#&#8203;2045](ClementTsang/bottom#2045): Add support for showing a decimal place for CPU usage
- [#&#8203;2046](ClementTsang/bottom#2046): Add a `show_table_scroll_bar` config option to show a scroll bar on table widgets.
- [#&#8203;2048](ClementTsang/bottom#2048): Add support for a temperature graph to show sensor temperature change over time.
- [#&#8203;2053](ClementTsang/bottom#2053): Add a configurable default sort column for the process widget (`processes.default_sort` or `--process-default-sort`).
- [#&#8203;2066](ClementTsang/bottom#2066): Add search support in the help dialog.
- [#&#8203;1791](ClementTsang/bottom#1791), [#&#8203;2072](ClementTsang/bottom#2072): Add support for using a short name for the GPU in memory usage.
- [#&#8203;2073](ClementTsang/bottom#2073): Add disk I/O time series graph.
- [#&#8203;2088](ClementTsang/bottom#2088): Add option to show unmounted disks on Linux.

##### Changes

- [#&#8203;2031](ClementTsang/bottom#2031): Tweak display/hiding logic for a graph widget's legend.
- [#&#8203;2039](ClementTsang/bottom#2039): Replace `hide_table_gap` with `table_gap`.
- [#&#8203;2061](ClementTsang/bottom#2061): Take cgroup into account for RAM/swap usage.
- [#&#8203;2062](ClementTsang/bottom#2062): Rename `[network]` to `[network_graph]` in the config file; `[network]` remains valid as an alias.
- [#&#8203;2062](ClementTsang/bottom#2062): Move network and memory graph config file options from `[flags]` to be under `[network_graph]` and `[memory_graph]`.
- [#&#8203;2063](ClementTsang/bottom#2063): Move process config file options from `[flags]` to be under `[processes]`.
- [#&#8203;2064](ClementTsang/bottom#2064): Move CPU config file options from `[flags]` to be under `[cpu]`.
- [#&#8203;2064](ClementTsang/bottom#2064): Move memory config file options from `[flags]` to be under `[memory_graph]`.
- [#&#8203;2066](ClementTsang/bottom#2066): Take cgroup into account for CPU usage% calculations.
- [#&#8203;2074](ClementTsang/bottom#2074): Treat uppercase 'Q' as a quit shortcut.

##### Other

- [#&#8203;1955](ClementTsang/bottom#1955): Fix mirrored documentation deploy to GitHub Pages.
- [#&#8203;1957](ClementTsang/bottom#1957): Fix CI bug around deploying docs on release.
- [#&#8203;1958](ClementTsang/bottom#1958): Fix cosmetic banner issue on docs page.
- [#&#8203;1962](ClementTsang/bottom#1962): Add code signing for Windows artifacts.
- [#&#8203;1986](ClementTsang/bottom#1986): Test and build NetBSD target.
- [#&#8203;2009](ClementTsang/bottom#2009): Configure CI job to publish to crates.io.
- [#&#8203;2037](ClementTsang/bottom#2037): Update AMD GPU names list.

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNTYuMCIsInVwZGF0ZWRJblZlciI6IjQzLjI1Ni4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6bWlub3IiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ram Widget inside of Memory Widget no longer displays in smaller window sizes

1 participant