Offer Change keys in the desktop app
Close #564
The desktop app's child server never offered Change keys, because the code it asks for is printed to a terminal the child does not have.
- The app makes a new code at each launch and hands it over in
CODETRIAL_CHANGE_KEYS_CODE. A code under 24 letters and digits leaves Change keys off. - The app fills the code into the Setup page when that page loads in its window, so it stays out of URLs, history and the server log.
- A save prints
codetrial: keys saved; restart to use them. On that line the app stops the child and launches it again, back on the lobby, without the failure page.
#564 asks which side should carry the code. This takes the shell-generates option, since it needs no parsing of the child's output. It is open to change if the other is preferred.
Known limits:
- With the interview in the default browser (no WebRTC in the web view), the app cannot fill the code there, so Change keys does not work in that mode, though the lobby still shows the link.
- An interview started in the moment between a save and the restart would be ended by the restart. The save's own refusal covers everything before that moment.
Verified on Linux (WSL): cargo test and cargo clippy --all-targets -- -D warnings in desktop/, and scripts/test.sh, where only review-memory-tests failed, because that machine's gh is too old for an attestation flag. The restart and the fill were not exercised in a running desktop window.
Summary by cubic
Closes #564: the desktop app's child server now offers Change keys, which it could not because the code it asks for is printed to a terminal the child does not have. The app makes a new code at each launch, hands it over in CODETRIAL_CHANGE_KEYS_CODE, and fills it into the Setup page when that page loads in its window, so it stays out of URLs, history, and the server log.
- A code under 24 letters and digits leaves Change keys off.
- A save prints
codetrial: keys saved; restart to use them, which makes the app stop the child and launch it again, back on the lobby. - Change keys does not work in default-browser mode, where the app cannot fill the code.
- An interview started between a save and the restart would be ended by the restart.