Skip to content

Conversation

@Saphereye
Copy link

@Saphereye Saphereye commented Oct 4, 2025

Description

Adds space key as a toggle for maximizing/minimizing nodes inside process tree mode,

Issue

#1808

Closes: #

Testing

  • TODO

The tests were run on Linux only.

  • 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, doc pages, etc.)
  • The pull request passes the provided CI pipeline
  • There are no merge conflicts
  • If relevant, new tests were added (don't worry too much about coverage)

@Saphereye
Copy link
Author

I have not added my changes to handle_char as space shouldn't be considered a char(?), but as crossterm didn't have an enum for Space I am (mis)using KeyCode::Char to get Spacebar info.

@ClementTsang ClementTsang self-assigned this Oct 5, 2025
@codecov
Copy link

codecov bot commented Oct 5, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.18%. Comparing base (16449f2) to head (fb45122).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/event.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1830   +/-   ##
=======================================
  Coverage   36.18%   36.18%           
=======================================
  Files         115      115           
  Lines       16325    16324    -1     
=======================================
  Hits         5907     5907           
+ Misses      10418    10417    -1     
Flag Coverage Δ
macos-14 37.27% <0.00%> (+<0.01%) ⬆️
ubuntu-latest 37.40% <0.00%> (+<0.01%) ⬆️
windows-2022 37.60% <0.00%> (+<0.01%) ⬆️

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.

@Saphereye
Copy link
Author

Hi @ClementTsang, I just wanted to check in to see if there’s anything else you’d like me to change in the PR. Thanks!

@ClementTsang
Copy link
Owner

Sorry for the delay, my bad! I'll review it in a bit.

Copy link
Owner

@ClementTsang ClementTsang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, hm, I think I should have been more clear on what that issue was asking - it was for toggling whether an entry was minimized/maximized. Apologies for not being more clear, updated that issue.

@Saphereye
Copy link
Author

Saphereye commented Oct 13, 2025

Hi,

No issues at all!

Just to confirm, we need functionality similar to this, but in the tree view of processes (same as what the left and right keys are performing):
Maximised:
image

Minimised:
image

If you don't mind, can I keep this pr open (change the name etc.) and try to work on it a bit? I will change this to draft and ping you again if there's progress.

@Saphereye Saphereye marked this pull request as draft October 13, 2025 08:16
@Saphereye Saphereye changed the title feature: adding spacebar to toggle tree mode feature: adding spacebar to toggle maximising/minimising of tree mode nodes Oct 13, 2025
@ClementTsang
Copy link
Owner

Yeah, basically the space key does what clicking on the entry would do (or the +/- key), toggle between maximized and minimized states.

@Saphereye
Copy link
Author

Great, I’ve added the code to support that.

For the case where the space key is pressed while the program is in a dialog, should it perform any action? I was thinking it could either scroll to the next option or select the current one.

@Saphereye Saphereye marked this pull request as ready for review October 13, 2025 08:52
@Saphereye
Copy link
Author

I’m planning to use the - and + keys to collapse and expand all entries, respectively.
Please let me know if you’d prefer a different shortcut or if I should not proceed with this change.

@Saphereye
Copy link
Author

Hi, I believe the implementation is now complete. I’ve added a few new features, including full collapse and expansion of the tree.
Here’s a quick summary of the updates:

  • Space to toggle individual nodes
  • ‘-’ to collapse all nodes
  • ‘+’ to expand all nodes

The idea behind using ‘-’ and ‘+’ is to make it easier to navigate through the process IDs in the tree view.
Please let me know if I should make further changes. Thanks!

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.

2 participants