Skip to content

Conversation

@SiboVG
Copy link
Member

@SiboVG SiboVG commented Jul 23, 2022

This PR fixes #1549 and allows all elements of the simulation table to be selected with the ctrl/cmd + A command. The same shortcut also works in the component tree, where all components are selected, except for the rocket.

I also noticed a bug in the simulation table where if you select e.g. row 1, then row 2, the plot button was disabled, as should be, but if you would then deselect row 1, then the button's status did not re-enable. This is fixed now in this PR. I also disabled the 'Edit simulation' when multiple simulations are selected. The 'plot' and 'edit' context menu items are now also disabled when multiple simulations are selected.

While working on the previous bug, I also noticed that the 'Edit', 'Delete' and 'Duplicate' button in the home screen (next to the component tree) had a smaller text than the move up/down buttons above. I think this was only macOS specific, but in any case this PR fixes that.

@neilweinstock
Copy link
Contributor

When I just tried this, it only selected them all after I had selected one. If I started with none selected, cmd-A didn't do anything.

@SiboVG
Copy link
Member Author

SiboVG commented Jul 23, 2022

When I just tried this, it only selected them all after I had selected one. If I started with none selected, cmd-A didn't do anything.

You first need to put focus on the simulation table. If you simply switch to the simulation tab, the simulation table is not focused (you can actually see the blue outline around the 'New simulation' button, so that button has focus).

@neilweinstock
Copy link
Contributor

How do I give it focus without selecting an existing sim? Clicking in the blank part of the list area doesn't do it.

@hcraigmiller
Copy link
Collaborator

hcraigmiller commented Jul 23, 2022

Testing results, using A simple model rocket example. There are two behaviors, the first of which is expected, the second of which is not.

Action One (Expected Behavior)

  1. Open the example and go straight to the Flight simulations tab.
  2. Press Ctrl+A results in no selection; expected behavior.
  3. Left-click on Simulation 1 (highlighting that simulation).
  4. Press Ctrl+A results in selection of all simulations.

Action Two (Unexpected Behavior)

  1. Open the example and go straight to the Flight simulations tab.
  2. Left-click on Simulation 1 (highlighting that simulation), and left-click Run simulations to re-run that simulation (the simulation remains highlighted after being re-run and may be re-run any number of times without re-selecting the simulation).
  3. Press Ctrl+A results in no selection; unexpected behavior, the expected bahavior would be to select all simulations.
  4. Left-click on any simulation, including Simulation 1.
  5. Press Ctrl+A results in selection of all simulations.

No other unexpected behaviors found.

Build 826
[Windows 11 Pro; Version 21H2; OS Build 22000.739; Windows Feature Experience Pack 1000.22000.739.0]
[Java "11.0.15" 2022-04-19 LTS; Java(TM) SE Runtime Environment 18.9 (build 11.0.15+8-LTS-149)]

@SiboVG
Copy link
Member Author

SiboVG commented Jul 23, 2022

How do I give it focus without selecting an existing sim? Clicking in the blank part of the list area doesn't do it.

You can't, you can only do so by selecting a sim (the same is true for the motors, recovery and stage configuration table).

@SiboVG
Copy link
Member Author

SiboVG commented Jul 23, 2022

Action Two (Unexpected Behavior)

  1. Open the example and go straight to the Flight simulations tab.
  2. Left-click on Simulation 1 (highlighting that simulation), and left-click Run simulations to re-run that simulation (the simulation remains highlighted after being re-run and may be re-run any number of times without re-selecting the simulation).
  3. Press Ctrl+A results in no selection; unexpected behavior, the expected bahavior would be to select all simulations.
  4. Left-click on any simulation, including Simulation 1.
  5. Press Ctrl+A results in selection of all simulations.

Hm well this issue isn't really inherent to the implementation of this PR... The same behavior holds in the motors, recovery and stage config tables. E.g. the motors config: select a config, hit ctrl + A, selects all configs, select an individual config again and click 'reset deployment', and then hit ctrl + A again, nothing happens.

On macOS you can also see that Java Swing make a visual distinction between a row being selected and in focus and a row being selected, but not in focus (because the focus was lost after clicking 'reset deployment'). See video below.

Screen.Recording.2022-07-23.at.22.13.16.mov

So I would create a new issue to restore the focus to the motors, recovery, stage and simulation table after a certain action has been performed. That will fix the issue you described.

@hcraigmiller
Copy link
Collaborator

hcraigmiller commented Jul 23, 2022

As described by @SiboVG above, this PR functions as expected with no anomalies found.

Build 826
[Windows 11 Pro; Version 21H2; OS Build 22000.739; Windows Feature Experience Pack 1000.22000.739.0]
[Java "11.0.15" 2022-04-19 LTS; Java(TM) SE Runtime Environment 18.9 (build 11.0.15+8-LTS-149)]

@neilweinstock
Copy link
Contributor

On macOS you can also see that Java Swing make a visual distinction between a row being selected and in focus and a row being selected, but not in focus

That is hilariously subtle.

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.

Feature Request: Select all objects in simulation table with Ctrl/Cmd + A shortcut

3 participants