xonecas.io
8447
Co

conveyor / commit 6667f78

App: Ctrl inspector works on the real desktop; status under the form

Rune's desktop host never hands App::on_modifiers to the runtime, so the
inspector also reads Ctrl from tx.mods() on pointer moves and polls. Toasts
and thread entries wrap, toasts name the build's title, and status draws
below the inspector and the form.

Co-Authored-By: Claude Opus 5.5

sacenox2026-11-09 6667f78c2fddc2d8061e44bafd13aabae1dd6536 parent 85b362c

4 files changed

crates/conveyor-app/src/app.rs+12−3
@@ -87,7 +87,9 @@ pub fn poll(s: &mut State, _t: f64, tx: &mut Tx) -> bool {
8787 s.live.save();
8888 if s.live.animating() { tx.wake_after(Duration::from_millis(16)); }
8989 restart(s);
90- again
90+ let ctrl = s.ctrl;
91+ on_modifiers(s, tx.mods(), tx);
92+ again || ctrl != s.ctrl
9193 }
9294
9395 /// Gives each new widget kind a finished build made a place: the widget clicked takes it, or
@@ -122,7 +124,10 @@ fn restart(s: &mut State) {
122124 s.built = Some(t);
123125 }
124126
127+/// Ctrl went down or up. Rune's desktop host doesn't call `App::on_modifiers` yet (window.rs
128+/// never hands it to the runtime), so pointer moves and polls also report Ctrl here.
125129 pub fn on_modifiers(s: &mut State, mods: rune::Mods, tx: &mut Tx) {
130+ if mods.ctrl == s.ctrl { return; }
126131 s.ctrl = mods.ctrl;
127132 if s.ctrl { inspect::pick(s, tx); }
128133 }
@@ -130,8 +135,12 @@ pub fn on_modifiers(s: &mut State, mods: rune::Mods, tx: &mut Tx) {
130135 pub fn view(s: &State, rcx: &mut rune::Cx<State>) -> El {
131136 let mut app = el().key("app").w_full().h_full()
132137 .child(el().key("content").w_full().h_full().child(s.live.render("root", "root"))
133- .on_pointer_move_local(|s: &mut State, e: rune::PointerEvent, tx: &mut Tx| { s.pointer = (e.window_x, e.window_y); tx.live_only(); }));
138+ .on_pointer_move_local(|s: &mut State, e: rune::PointerEvent, tx: &mut Tx| {
139+ s.pointer = (e.window_x, e.window_y);
140+ if tx.mods().ctrl { on_modifiers(s, tx.mods(), tx) } else { tx.live_only() }
141+ }));
142+ app = app.child(status::view(s));
134143 if s.ctrl && s.form.is_none() { app = app.child(inspect::view(s, rcx)); }
135144 if let Some(f) = &s.form { app = app.child(form::view(s, f, rcx)); }
136- app.child(status::view(s))
145+ app
137146 }
crates/conveyor-app/src/form.rs+1−1
@@ -45,7 +45,7 @@ fn entry(e: &Value) -> El {
4545 let who = if kind == "prompt" { "you".into() } else { format!("#{} {kind}", e["ticket"]) };
4646 col().w_full().gap(2.0)
4747 .child(text(who).font(tok::type_::LABEL).color(t.text_secondary))
48- .child(text(e["text"].as_str().unwrap_or("").to_owned()).color(color).w_full())
48+ .child(text(e["text"].as_str().unwrap_or("").to_owned()).color(color).w_full().wrap())
4949 }
5050
5151 pub fn view(s: &State, f: &Form, rcx: &mut rune::Cx<State>) -> El {
crates/conveyor-app/src/inspect.rs+5−1
@@ -19,7 +19,11 @@ pub fn view(s: &State, rcx: &mut rune::Cx<State>) -> El {
1919 let t = tok::theme(true);
2020 let rects: Vec<(String, [f32; 4])> = s.picked.iter().filter_map(|id| Some((id.clone(), rcx.layout(&format!("w:{id}"))?))).collect();
2121 let mut layer = el().key("inspect").w_full().h_full().absolute(0.0, 0.0)
22- .on_pointer_move_local(|s: &mut State, e: rune::PointerEvent, tx: &mut Tx| { s.pointer = (e.window_x, e.window_y); pick(s, tx); })
22+ .on_pointer_move_local(|s: &mut State, e: rune::PointerEvent, tx: &mut Tx| {
23+ s.pointer = (e.window_x, e.window_y);
24+ s.ctrl = tx.mods().ctrl;
25+ pick(s, tx);
26+ })
2327 .on_press_tx(|s: &mut State, _| form::open(s));
2428 for (i, (id, [x, y, w, h])) in rects.iter().enumerate().rev() {
2529 let kind = s.live.kind(id).unwrap_or("?");
crates/conveyor-app/src/status.rs+2−2
@@ -26,8 +26,8 @@ fn toast(b: &Value) -> El {
2626 col().key(format!("toast-{id}")).w(380.0).radius(10.0).fill(t.card).padding(12.0).gap(4.0).role("button").label("Dismiss")
2727 .border(1.0, color).hover(t.hover)
2828 .on_press_tx(move |s: &mut State, _| { s.seen.insert(id); save_ids(s.live.base(), "seen", &s.seen); })
29- .child(text(format!("#{id} {state} · {}", b["kind"].as_str().unwrap_or(""))).font(tok::type_::LABEL).color(color))
30- .child(text(said).color(t.text).w_full())
29+ .child(text(format!("#{id} {state} · {}", b["title"].as_str().unwrap_or(""))).font(tok::type_::LABEL).color(color))
30+ .child(text(said).color(t.text).w_full().wrap())
3131 .child(text(if state == "done" { "Click to dismiss" } else { "Ctrl+click the widget to follow up · click to dismiss" }).font(tok::type_::LABEL).color(t.text_secondary))
3232 }