Skip to content

Conversation

@SiboVG
Copy link
Member

@SiboVG SiboVG commented Jul 4, 2022

This PR fixes #1513 by combining the 'Add new component' and the 'Modify component' of that newly added component into a single 'Add new component' undo action. So if you now add a new component, and modify that new component in the edit dialog that popped up when the new component was added, you do not have perform two undo actions to undo adding that new component. (I also wanted this PR up because it will ease the development for issue #960).

Demo (includes first the prior behavior in OR 22.02.beta.04 and then the new behavior from this PR):

Screen.Recording.2022-07-05.at.00.13.09.mp4

@hcraigmiller
Copy link
Collaborator

hcraigmiller commented Jul 7, 2022

I think this is a nice improvement. Two questions.

  1. When the addition of a component is undone, should the parent of that component be selected by default? For example, with a new design, I add a nose cone and close, then undo adding the nose cone. Should the sustainer be selected so that I don't have to select the sustainer before adding a new/different component at that level? Or, with a new design, I add a body tube and close, then add an inner tube and close, then undo the inner tube. Should the body tube be selected so that I don't have to select the body tube before adding a new/different component at that level?
  2. Is this sufficiently related to Issue 960 such that the two should be combined (the undo function here would have the same function as the cancel button in that issue New feature request: add ok/cancel button to component config dialog #960)?

Functions as expected, no anomalies found.

Build 787
[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

I like this change.

@SiboVG
Copy link
Member Author

SiboVG commented Jul 11, 2022

  1. When the addition of a component is undone, should the parent of that component be selected by default? For example, with a new design, I add a nose cone and close, then undo adding the nose cone. Should the sustainer be selected so that I don't have to select the sustainer before adding a new/different component at that level? Or, with a new design, I add a body tube and close, then add an inner tube and close, then undo the inner tube. Should the body tube be selected so that I don't have to select the body tube before adding a new/different component at that level?

Could be a good new feature request (so will not be solved in this PR).

2. Is this sufficiently related to Issue 960 such that the two should be combined (the undo function here would have the same function as the cancel button in that issue

Not really a solution for #960, I just meant that with this functionality, it will be easier to implement a fix for #960.

@SiboVG SiboVG merged commit 6cb334f into openrocket:unstable Jul 14, 2022
@SiboVG SiboVG deleted the issue-1513 branch September 30, 2022 12:30
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: combine undo action of 'new component' and 'modify (new) component'

3 participants