Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: tables V2 #749

Merged
merged 14 commits into from
Oct 12, 2022
Merged

refactor: tables V2 #749

merged 14 commits into from
Oct 12, 2022

Conversation

ClementTsang
Copy link
Owner

@ClementTsang ClementTsang commented Jun 9, 2022

Description

A description of the change and what it does. If relevant (such as any change that modifies the UI), please provide screenshots of the change:

Overview

This PR generally refactors the table and sortable table components, used by temp, disk, process, and CPU widgets.

Note most of the commits in this PR are going to be more of trial and error/testing things out, rather than proper commits. I'll probably squash some things as this approaches completion.

General goals

This PR started with the following goals in mind:

  • Reduce memory usage - the previous refactor seemed to increase memory usage by a significant amount, so hopefully this refactor knocks that down a peg.
  • Make using sortable tables (and tables in general) a bit less ugly - ton of gross hard-coding required to get it to just work last time, so hopefully something more elegant can come out of this.

Other

  • This PR also fixes a longstanding bug in disk or temp tables, where you could select the last value of one of those tables, and if you removed a value (e.g. unmount a drive), the scroll index would be incorrect. This is easily fixed by doing a check during the draw to ensure data is consistent with state.
  • Moves colour scheme creation before app creation in the main.rs pipeline. Highly considering moving it into the config pipeline in the future.

Issue

If applicable, what issue does this address?

Related to #374

Closes #773, closes #815

Testing

If relevant, please state how this was tested. All changes must be tested to work:

Please also indicate which platforms were tested. All platforms directly affected by the change must be tested:

  • Windows
  • macOS
  • Linux

Checklist

If relevant, ensure the following have been met:

  • Areas your change affects have been linted using rustfmt (cargo fmt)
  • The change has been tested and doesn't appear to cause any unintended breakage
  • Documentation has been added/updated if needed (README.md, help menu, etc.)
  • The pull request passes the provided CI pipeline
  • There are no merge conflicts

@codecov-commenter
Copy link

codecov-commenter commented Jun 9, 2022

Codecov Report

Base: 23.57% // Head: 19.11% // Decreases project coverage by -4.45% ⚠️

Coverage data is based on head (3d22846) compared to base (1e5f0ea).
Patch coverage: 15.94% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #749      +/-   ##
==========================================
- Coverage   23.57%   19.11%   -4.46%     
==========================================
  Files          60       70      +10     
  Lines       13291    13151     -140     
==========================================
- Hits         3133     2514     -619     
- Misses      10158    10637     +479     
Impacted Files Coverage Δ
src/app.rs 0.00% <0.00%> (-0.05%) ⬇️
src/app/data_farmer.rs 0.00% <0.00%> (-8.37%) ⬇️
src/app/data_harvester/cpu.rs 0.00% <0.00%> (ø)
src/app/data_harvester/cpu/heim.rs 0.00% <0.00%> (ø)
src/app/data_harvester/processes/linux.rs 19.83% <ø> (ø)
src/app/data_harvester/temperature.rs 0.00% <0.00%> (ø)
src/app/frozen_state.rs 0.00% <0.00%> (ø)
src/app/states.rs 0.00% <0.00%> (-61.44%) ⬇️
src/app/widgets/cpu_graph.rs 0.00% <0.00%> (ø)
src/app/widgets/disk_table.rs 0.00% <0.00%> (ø)
... and 40 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

ClementTsang and others added 11 commits October 11, 2022 20:21
work towards porting over CPU

fix typo

partially port over cpu, fix some potentially inefficient concat_string calls

more work towards cpu widget migration

some refactoring
sortable data

more refactoring

some sort refactoring

more refactoringgggg

column refactoring

renaming and reorganizing

more refactoring regarding column logic

add sort arrows again
port over process

precommit

temp

temp two, remember to squash

work

fix broken ltr calculation and CPU hiding

add back row styling

temp

fix a bunch of issues, get proc working

more fixes around click

fix frozen issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants