authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-10-02 19:16:24-07:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-10-02 20:22:32-07:00
logd8e439ce5e7a3acbcc02653af384400b9a5052de
treefecfb35c8e659d083eac6d6a4111e623b259778f
parent7e428759e27de7e50a06ca5afadfbfe0f76c42f0
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

fix: Enter takes Live Share's default wherever the focus is, and Open Shared Notebook's too

Enter started sharing only from the password field. It now starts sharing, or once sharing has started closes the dialog, from anywhere in it but another button, which Enter presses as before; Open Shared Notebook takes it from the dialog itself as well as its fields. Assisted-by: claude-opus-5.5

1 files changed, 8 insertions(+), 9 deletions(-)

crates/snowbound/src/share.rs+8-9
......@@ -260,13 +260,11 @@ impl State {
260260 let starting = self.peers.starting.get(&location).cloned();
261261 let ui = &mut self.ui;
262262 let theme = ui.theme.clone();
263 let fields: &[Id] = if host.is_none() && dialog.protect {
264 &[password_field()]
265 } else {
266 &[]
267 };
263 // Enter takes the dialog's default, Start Sharing or else Done, wherever the focus is
264 // but on another button.
268265 let entered =
269 ui::popup::navigation(ui, fields, &[NamedKey::Enter]).contains(&NamedKey::Enter);
266 ui::popup::navigation(ui, &[share_id(), password_field()], &[NamedKey::Enter])
267 .contains(&NamedKey::Enter);
270268 frame(ui, share_id(), "Live Share");
271269 text(ui, "notebook", &dialog.library.name, true);
272270 let (mut start, mut stop, mut copy) = (false, false, None);
......@@ -384,7 +382,8 @@ impl State {
384382 start = ui::button(ui, "start", "Start Sharing").clicked || entered;
385383 }
386384 }
387 let done = ui::button(ui, "done", "Done").clicked;
385 let offered = host.is_none() && !matches!(starting, Some(None));
386 let done = ui::button(ui, "done", "Done").clicked || entered && !offered;
388387 ui.close();
389388 ui.close();
390389 if let Some(code) = copy {
......@@ -443,9 +442,9 @@ impl State {
443442 }
444443 }
445444 let ui = &mut self.ui;
445 let owners = [join_id(), code_field(), join_password()];
446446 let entered =
447 ui::popup::navigation(ui, &[code_field(), join_password()], &[NamedKey::Enter])
448 .contains(&NamedKey::Enter);
447 ui::popup::navigation(ui, &owners, &[NamedKey::Enter]).contains(&NamedKey::Enter);
449448 frame(ui, join_id(), "Open Shared Notebook");
450449 text(ui, "what", "Enter the code from the person sharing.", false);
451450 labelled(ui, "Code:", |ui| {