Repository navigation
Force off question: Don't quit, and say which guests are already off - #165
Conversation
…y happened By the time this question shows, every guest has had its power button pressed. Cancel read like undoing that, but it only abandons the quit, and the guests keep shutting down. The button is now Don't quit, and the detail says the guests were already asked to shut down. It also names the VMs that did shut down within the wait, so after Don't quit it isn't a surprise that they are off.
A21-devs
left a comment
There was a problem hiding this comment.
Wording and the off list read well, and the cancel button still maps to the quit being abandoned. One case where the new sentence isn't true.
| // so Don't quit doesn't leave the user wondering where the other VMs went | ||
| off.length ? `${off.join(', ')} ${off.length === 1 ? 'is' : 'are'} already off.` : '', | ||
| `A guest installing updates on shutdown can take a few minutes. Force off loses anything unsaved inside ${waiting.length === 1 ? 'it' : 'them'}.`, | ||
| `Don't quit keeps the app open, but ${waiting.length === 1 ? 'the guest was' : 'the guests were'} already asked to shut down and may still turn off.` |
There was a problem hiding this comment.
Not every VM in waiting was asked to shut down. pressPower swallows a failed resume/shutdown (no QMP connection) and the VM ends up here with no power button press at all. For that one, "the guest was already asked to shut down and may still turn off" is wrong: it won't turn off on its own, and Wait another minute will never help. The flow should remember which VMs it couldn't reach and say so for those, e.g. that the app couldn't reach it to ask, so Force off is the way to turn it off.
pressPower swallowed a failed shutdown (no QMP connection), and the question then said that guest was already asked to shut down. It now returns whether the press went through, and the question says which VMs the app couldn't reach, and that only Force off will turn those off.
|
Right, Two new tests with a fake runner whose |
A21-devs
left a comment
There was a problem hiding this comment.
The fix does what the first review asked: only guests whose press went through are called asked, and the unreached ones get their own sentence. One thing that follows from it.
| ] | ||
| .filter(Boolean) | ||
| .join('\n\n'), | ||
| buttons: [MORE, FORCE, STAY], |
There was a problem hiding this comment.
When every guest still up is one the app couldn't reach, the text now says they won't turn off by themselves, but Wait another minute is still the first and default button. Enter then waits a minute for something the question just said won't happen, and asks again. In that case the question should offer only Force off and Don't quit.
|
Fixed the second review's point in ed0c8b6: when none of the guests still up got the power button, the buttons are Force off and quit / Don't quit, with Don't quit as the cancel button. With at least one reachable guest the three buttons stay, since another minute can still help that one. The unreachable-only test checks the buttons now. |
…r button If every guest still up is one the app couldn't reach, waiting can't help, so the question offers only Force off and Don't quit.
Closes #158
Closes #92
Both issues are about the question Shut down VMs and quit shows when a guest is still up after a minute.
On the first idea in #158, showing the window: it's already showing.
waitForShutdowncallshost.show()before it asks, since the question needs the window, and nothing hides it after the answer. So after Don't quit the window is up with each VM's status in the library. The missing piece was the wording.Testing
tests/quitFlow.test.ts: the buttons and the cancel button, the already-off list with three VMs and one stuck, and no list when all are stuck. The existing Cancel tests now click Don't quit.npm run typecheck,npm test(203 pass),npm run build