-
Notifications
You must be signed in to change notification settings - Fork 81
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
Disk page in Installer requires pressing Enter two times before switching to next page #650
Conversation
0b1096e
to
ce9bdff
Compare
ce9bdff
to
90e3b42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and I tested it too just for fun, and it works fine.
I wonder though, having looked at the rest of the code some more, if we could just get rid of the diskConfirmed variable entirely? AFAICT it's only checked in gotoNextPage()
but by then it will always be true anyway given this change, which (unless I'm missing something) makes the variable redundant.
(Also, I suspect the calls to validateAllDiskSizes()
and validatePersistentPartitionSize()
in gotoNextPage()
are also redundant, given those functions are called already from diskConfirm()
, dataDiskConfirm()
and persistentSizeConfirm()
- that's unrelated to this change, I just happened to notice while re-reading everything.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functionality works fine. LGTM, thank you!
Great work. The change works great if the "Use MBR partitioning scheme" dropdown is not changed. A single enter goes to next panel. But if I change the field, it will immediately jump to the next panel. For example: new2.movI feel it's more natural if the page can stay after changing the value (that is, the original "double click" behavior). The user has the time to review the values. For example: old.movIs it possible to use a single enter if the value doesn't change, but two enters if the value changes? |
This might do it (untested, based on work in #717): --- a/pkg/console/install_panels.go
+++ b/pkg/console/install_panels.go
@@ -681,7 +681,12 @@ func addDiskPanel(c *Console) error {
}
}
+ currentVal := c.config.ForceMBR
c.config.ForceMBR = forceMBR == "yes"
+ if c.config.ForceMBR != currentVal {
+ // Force another ENTER hit to proceed if the value is chaned
+ return nil
+ }
return gotoNextPage(g, v)
}
askForceMBRV.KeyBindings = map[gocui.Key]func(*gocui.Gui, *gocui.View) error{ |
…hing to next page Signed-off-by: Volker Theile <[email protected]>
90e3b42
to
b45ef30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and that's a neat way to not bother with a temporary variable :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
Problem:
After the user entered all information in the disk page it is still necessary to press
Enter
orKey-Down
twice at theUse MBR partitioning scheme
form control before switching to the next (Hostname) page.Solution:
Set the
diskConfirmed
after thePersistent size
has been validated. Because of this, only oneKey-Down
orEnter
is necessary to confirm the value and switch to the next page.Related Issue:
harvester/harvester#5097
Test plan:
Case 1:
Use MBR partitioning scheme
. Do not modify the value (defaults toNo
). PressEnter
orKey-Down
.Hostname
page.Case 2:
Use MBR partitioning scheme
. PressTab
, chooseYes
and confirm withEnter
.Use MBR partitioning scheme
is still focused. PressEnter
orKey-Down
.Hostname
page.