Merge main into #1857

This commit is contained in:
bflatastic
2026-11-07 10:08:45 +07:00
15 changed files with 222 additions and 30 deletions
+1
View File
@@ -361,6 +361,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md).
| Date | Change | Summary |
|---|---|---|
| 2026-11-06 | patch | M5, #2027: `proto.settings` refuses an unknown device name with the list of devices (it saved any string, and the presenter showed no device), takes known names in any case, and answers the page's prototype settings, so `proto.settings {}` reads them back over MCP. Test: `proto_present_tests::unknown_devices_are_refused_and_settings_read_back`. Numbers unchanged |
| 2026-11-06 | patch | M7, #2032: closing a tab whose file has unsaved changes asks Don't Save / Cancel / Save, as closing the window does, instead of a toast that left the tab open; Alt+close still discards at once. Tests: `titlebar_tests::closing_a_tab_with_unsaved_changes_asks`, `titlebar_tests::save_in_the_tab_question_saves_then_closes`. Numbers unchanged |
| 2026-11-06 | patch | M8, #1906: under Wayland a minimised window answers control-channel and attached-MCP requests from its logic passes once it has drawn nothing for 0.2 s while a request waits (about half a second each; every request timed out after 60 s before). Test: `idle_tests::a_window_that_stopped_drawing_answers_from_its_logic_passes`. Numbers unchanged |
| 2026-11-06 | patch | M3: a glass's light angle bound to a number past ±180 turns round to the same direction (270 is -90), as the angle drawn from it does, instead of stopping at 180. Tests: `effects_tests::a_bound_light_angle_turns_round_instead_of_stopping`. Numbers unchanged |
+3 -1
View File
@@ -68,7 +68,9 @@ impl Backend for Store {
Err(err) => log::error!("file {file}: a change couldn't be logged: {err}"),
}
}
log.entries += journal.len();
// A refusal changes nothing in the document: it counts toward the log's size (bytes), but
// not toward the entries that make a snapshot rewrite worthwhile.
log.entries += journal.iter().filter(|j| !matches!(j, figcraft_collab::Journal::Refused { .. })).count();
log.dirty = true;
e.meta.updated = now();
if log.entries >= after || log.bytes + log.pending.len() as u64 >= max_bytes {
+18
View File
@@ -155,6 +155,24 @@ fn read_only_sessions_keep_client_ids_without_rewriting_the_snapshot() {
}
}
#[test]
fn a_viewers_refused_batches_do_not_rewrite_the_snapshot() {
let dir = TempDir::new("refusals");
let c = StoreConfig { compact_after: 3, ..cfg(dir.path()) };
let mut store = Store::open(dir.path(), c).unwrap();
let (id, _, _) = publish(&mut store, "Busy");
let mut server = store.open(&id).unwrap();
let mut v = join(&mut server, Access::View);
store.changed(&id, &mut server);
let generation = || disk::check_snapshot(&fs::read(dir.path().join(FILES).join(&id).join(SNAPSHOT)).unwrap()).unwrap();
assert_eq!(generation(), 1);
for i in 0..10 {
rename(&mut server, &mut v, &format!("P{i}"));
store.changed(&id, &mut server);
}
assert_eq!(generation(), 1, "refusals are logged, not compacted");
}
#[test]
fn a_long_log_is_compacted_while_open() {
let dir = TempDir::new("compact");
+44 -4
View File
@@ -112,7 +112,7 @@ pub fn specs() -> Vec<CommandSpec> {
spec!(
"proto.settings",
"Prototype settings",
"{device? (a device name, \"Custom size\" or \"None\"), background?, rotation? portrait|landscape (or 0|90; phones and tablets turn), color? (one of the device's colours by name), width?, height? (the custom size's screen, 1–10000 points; picks \"Custom size\"), responsive? bool (frames resize to the screen and their constraints and auto layout respond)}",
"{device? (a device name, \"Custom size\" or \"None\"; any case; another name is refused with the list), background?, rotation? portrait|landscape (or 0|90; phones and tablets turn), color? (one of the device's colours by name), width?, height? (the custom size's screen, 1–10000 points; picks \"Custom size\"), responsive? bool (frames resize to the screen and their constraints and auto layout respond)} → the page's settings after the call (none given: reads them)",
true,
settings
),
@@ -173,12 +173,51 @@ pub fn specs() -> Vec<CommandSpec> {
]
}
/// `proto.settings`: everything is checked before anything changes.
/// The device setting `name` stands for, as the device picker names it: "None", "Custom size" or a
/// model of [`PrototypeSettings::DEVICES`], whatever its case and the spaces around it.
fn known_device(name: &str) -> Option<&'static str> {
let name = name.trim();
["None", PrototypeSettings::CUSTOM_DEVICE]
.into_iter()
.chain(PrototypeSettings::DEVICES.iter().map(|d| d.name))
.find(|d| d.eq_ignore_ascii_case(name))
}
/// What `proto.settings` answers: the page's prototype settings (the device as the picker names it,
/// the colour shown, the screen as presented, `null` without a device).
fn settings_json(ps: &PrototypeSettings) -> Value {
let screen = ps.device().map(|d| json!({"width": d.width, "height": d.height}));
json!({
"ok": true,
"device": ps.device,
"background": format!("#{}", ps.background.to_hex()),
"rotation": ps.rotation,
"color": ps.device_color().map(|c| c.name),
"screen": screen,
"customSize": {"width": ps.custom_size[0], "height": ps.custom_size[1]},
"responsive": ps.responsive,
})
}
/// `proto.settings`: everything is checked before anything changes; an unknown device is refused
/// with the devices to pick from, as an unknown colour is. Answers the settings as they are after
/// the call, so a call without parameters reads them.
fn settings(s: &mut Session, p: &Value) -> Result<Value> {
let cmd = "proto.settings";
let page = s.page()?;
let bg = color(p, "background");
let dev = string(p, "device");
let dev = match p.get("device") {
None | Some(Value::Null) => None,
Some(v) => {
let name = v.as_str().unwrap_or_default();
let found = known_device(name).ok_or_else(|| {
let names: Vec<&str> =
["None", PrototypeSettings::CUSTOM_DEVICE].into_iter().chain(PrototypeSettings::DEVICES.iter().map(|d| d.name)).collect();
bad(cmd, format!("unknown device {}: device is one of {}", figcraft_format::clip(&v.to_string(), 60), names.join("|")))
})?;
Some(found.to_string())
}
};
let rot = match p.get("rotation") {
None | Some(Value::Null) => None,
Some(v) => Some(rotation_of(v).ok_or_else(|| bad(cmd, "rotation: portrait|landscape"))?),
@@ -231,12 +270,13 @@ fn settings(s: &mut Session, p: &Value) -> Result<Value> {
None if !colors.iter().any(|x| x.name == next.color) => next.color.clear(),
None => {}
}
let answer = settings_json(&next);
if next != *prototype
&& let NodeKind::Page { prototype, .. } = &mut s.doc_mut()?.get_mut(page)?.kind
{
*prototype = next;
}
ok()
Ok(answer)
}
/// Resize top-level `frame` to a screen of `(w, h)` as a responsive prototype does: its children
+3
View File
@@ -260,6 +260,9 @@ fn vue_links_are_a_default_import_with_quoted_bindings() {
ex(&mut s, "instance.setProperties", json!({"ids": [i], "properties": {"Title": "Say \"hi\""}}));
ex(&mut s, "codeConnect.set", json!({"id": i, "language": "vue", "template": "<Card title=\"{title} {title}\" />"}));
assert_eq!(code(&mut s, i, "vue"), "import Card from \"./Card.vue\";\n\n<Card title=\"Say &quot;hi&quot; Say &quot;hi&quot;\" />\n");
// Literal text before the first placeholder keeps it inside the attribute value.
ex(&mut s, "codeConnect.set", json!({"id": i, "language": "vue", "template": "<Card title=\"Say: {title}\" />"}));
assert_eq!(code(&mut s, i, "vue"), "import Card from \"./Card.vue\";\n\n<Card title=\"Say: Say &quot;hi&quot;\" />\n");
// Text after a completed tag is text, even when it contains `=`.
ex(&mut s, "instance.setProperties", json!({"ids": [i], "properties": {"Title": "Buy"}}));
ex(&mut s, "codeConnect.set", json!({"id": i, "language": "vue", "template": "<p>Total = {title}</p>"}));
+16 -12
View File
@@ -288,41 +288,45 @@ fn pieces(t: &str) -> Vec<Piece<'_>> {
checkable.then(|| parse(t).ok()).flatten().unwrap_or_else(|| vec![Piece::Text(t)])
}
/// Whether `s` ends inside an unclosed opening tag (no `>` outside quotes since the last `<`).
fn inside_open_tag(s: &str) -> bool {
/// Whether `s` ends inside an unclosed opening tag (no `>` outside quotes since the last `<`), and
/// the quote (with its byte offset) still open there.
fn tag_state(s: &str) -> (bool, Option<(char, usize)>) {
let mut in_tag = false;
let mut quote = None;
let mut chars = s.chars().peekable();
while let Some(c) = chars.next() {
let mut chars = s.char_indices().peekable();
while let Some((i, c)) = chars.next() {
match quote {
Some(q) => {
Some((q, _)) => {
if c == q {
quote = None;
}
}
None => match c {
'<' if !in_tag && chars.peek().is_some_and(|ch| ch.is_ascii_alphabetic() || matches!(*ch, '/' | '!' | '?')) => {
'<' if !in_tag && chars.peek().is_some_and(|(_, ch)| ch.is_ascii_alphabetic() || matches!(*ch, '/' | '!' | '?')) => {
in_tag = true;
}
'>' if in_tag => in_tag = false,
'"' | '\'' if in_tag => quote = Some(c),
'"' | '\'' if in_tag => quote = Some((c, i)),
_ => {}
},
}
}
in_tag
(in_tag, quote)
}
/// Where a placeholder sits in a Vue template: whether the attribute is bound, and the quote the
/// template already opened (if any). `None` when it isn't in an attribute at all.
fn vue_attribute(out: &str) -> Option<(bool, Option<char>)> {
let end = out.trim_end();
if !inside_open_tag(end) {
let (in_tag, open) = tag_state(out);
if !in_tag {
return None;
}
let (after, quote) = match end.chars().last() {
Some(q @ ('"' | '\'')) => (&end[..end.len() - q.len_utf8()], Some(q)),
_ => (end, None),
// A quote still open, with literal text after it (`title="Buy {x}"`), puts the placeholder in
// that attribute's value as much as one directly after the quote does.
let (after, quote) = match open {
Some((q, at)) => (&out[..at], Some(q)),
None => (end, None),
};
let after = after.trim_end();
let eq = after.rfind('=')?;
+28
View File
@@ -97,3 +97,31 @@ fn explicit_variable_modes_go_back_to_auto() {
assert!(s.execute("variable.setMode", &json!({"ids": [f], "collection": "Tokens", "mode": "Dusk"})).is_err());
assert!(s.execute("variable.setMode", &json!({"ids": [f], "collection": "Tokens"})).is_err(), "a mode, or null for Auto");
}
/// #2027: an unknown device is refused with the devices to pick from, as an unknown colour is, and
/// nothing changes; a known one is taken whatever its case and stored as the picker names it; the
/// settings read back from `proto.settings` without parameters.
#[test]
fn unknown_devices_are_refused_and_settings_read_back() {
let mut s = Session::new();
let before = settings(&s);
for junk in [json!("Pixel Nonexistent"), json!(""), json!(42), json!(["iPhone 16"])] {
let err = s.execute("proto.settings", &json!({"device": junk, "responsive": true})).unwrap_err().to_string();
assert!(err.contains("unknown device") && err.contains("iPhone 17|") && err.contains("Custom size"), "{junk}: {err}");
assert_eq!(settings(&s), before, "{junk}: nothing changes");
}
let set = s.execute("proto.settings", &json!({"device": " iphone 16 ", "color": "black"})).unwrap();
assert_eq!(settings(&s).device, "iPhone 16", "stored as the picker names it");
assert_eq!((&set["device"], &set["color"]), (&json!("iPhone 16"), &json!("Black")));
let read = s.execute("proto.settings", &json!({})).unwrap();
assert_eq!(read, set, "a call without parameters reads the settings");
assert_eq!((&read["ok"], &read["rotation"], &read["responsive"]), (&json!(true), &json!("portrait"), &json!(false)));
assert_eq!(read["screen"], json!({"width": 393.0, "height": 852.0}));
assert!(read["background"].as_str().is_some_and(|c| c.starts_with('#')), "{read}");
// "None" and "Custom size" in any case; no device has no screen or colour.
s.execute("proto.settings", &json!({"device": "custom SIZE", "width": 800, "height": 600})).unwrap();
assert_eq!(settings(&s).device, PrototypeSettings::CUSTOM_DEVICE);
let none = s.execute("proto.settings", &json!({"device": "none"})).unwrap();
assert_eq!((&none["device"], &none["screen"], &none["color"]), (&json!("None"), &json!(null), &json!(null)));
assert_eq!(none["customSize"], json!({"width": 800.0, "height": 600.0}));
}
+11
View File
@@ -459,6 +459,8 @@ fn path_end(path: &BezPath, at_end: bool) -> Option<(Point, Vec2)> {
/// The filled arrowhead shape for `cap` at one end of an open path.
pub fn arrowhead(path: &BezPath, cap: StrokeCap, weight: f64, at_end: bool) -> Option<BezPath> {
// Capped like a stroke's width: the circle below is flattened at a fixed tolerance.
let weight = weight.min(MAX_STROKE_WIDTH);
let (tip, dir) = path_end(path, at_end)?;
let n = Vec2::new(-dir.y, dir.x);
let s = (weight * 3.0).max(6.0);
@@ -760,6 +762,15 @@ mod tests {
assert!((b.x0 + 5.0).abs() < 0.01);
}
#[test]
fn an_absurd_arrow_weight_is_capped() {
let mut line = BezPath::new();
line.move_to((0.0, 0.0));
line.line_to((100.0, 0.0));
let head = arrowhead(&line, StrokeCap::CircleFilled, 1e300, true).unwrap();
assert!(head.elements().len() < 10_000, "{}", head.elements().len());
}
#[test]
fn arrows_on_open_paths() {
let mut line = BezPath::new();
+6
View File
@@ -385,6 +385,12 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"Decoration style" = "გაფორმების სტილი"
"Decoration" = "გაფორმება"
"Deep select" = "ღრმა მონიშვნა"
"Wrap style" = "გადატანის სტილი"
"Balance" = "დაბალანსებული"
"Pretty" = "მოწესრიგებული"
"Auto: as many words as fit on each line" = "ავტომატური: თითო სტრიქონში იმდენი სიტყვა, რამდენიც ეტევა"
"Balance: every line close to the same length" = "დაბალანსებული: ყველა სტრიქონი დაახლოებით ერთი სიგრძისაა"
"Pretty: full lines, no one word alone on the last" = "მოწესრიგებული: სავსე სტრიქონები, ბოლო სტრიქონზე ერთი სიტყვა მარტო არ რჩება"
"Default" = "ნაგულისხმევი"
"Default content" = "ნაგულისხმევი შიგთავსი"
"Default value (the top-left variant)" = "ნაგულისხმევი მნიშვნელობა (ზედა მარცხენა ვარიანტი)"
+56
View File
@@ -1214,3 +1214,59 @@ fn sidebar_field_text_stays_in_place_on_focus() {
assert!((before.center().y - after.center().y).abs() <= 0.5, "numeric={numeric}: before={before:?}, after={after:?}");
}
}
/// "You can also hover the input field itself and hold down the modifier key: Mac: ⌥ Option
/// Windows: Alt" to scrub it (Adjust alignment, rotation, position, and dimensions). Alt is what
/// makes the drag a scrub there, not the fine rate: a point moves a step, as on the label. Without
/// Alt a drag on the field is no click, so it neither edits nor moves anything.
#[test]
fn alt_held_over_a_field_scrubs_it() {
let (mut u, a, _) = setup();
let (at, _) = field(&mut u, "X");
let steps = undo_steps(&u);
// Alt is held as the pointer arrives over the field, a frame before the press (the field takes
// a drag only once it has seen Alt; egui assigns a press by the frame before it).
let alt = Modifiers { alt: true, ..Modifiers::NONE };
u.frame_with(vec![Event::PointerMoved(at)], alt);
drag(&mut u, at, 25.0, alt);
assert_eq!(geom(&u, a).0, 35.0, "a step a point: X from 10");
assert_eq!(undo_steps(&u), steps + 1, "one undo step for the whole scrub");
assert_eq!(field(&mut u, "X").1, "35", "the field shows it and isn't editing");
let (at, _) = field(&mut u, "X");
drag(&mut u, at, 25.0, Modifiers::NONE);
assert_eq!(geom(&u, a).0, 35.0, "without Alt the field doesn't scrub");
assert_eq!(undo_steps(&u), steps + 1);
// Alt let go before the button still ends the scrub with its undo step.
let (at, _) = field(&mut u, "X");
let press = |pressed: bool, m: Modifiers, p: Pos2| Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed, modifiers: m };
u.frame_with(vec![Event::PointerMoved(at)], alt);
u.frame_with(vec![press(true, alt, at)], alt);
for k in 1..=10 {
u.frame_with(vec![Event::PointerMoved(pos2(at.x + 2.0 * k as f32, at.y))], alt);
}
let to = pos2(at.x + 20.0, at.y);
u.frame_with(vec![Event::PointerMoved(to), press(false, Modifiers::NONE, to)], Modifiers::NONE);
u.frame(vec![]);
assert_eq!(geom(&u, a).0, 55.0, "twenty more");
assert_eq!(undo_steps(&u), steps + 2, "committed when the button went up, without Alt");
// Without Alt the field doesn't take the drag at all (a touch swipe over it is the panel's to
// scroll): the press is a click of the field's, not a drag.
let (at, _) = field(&mut u, "X");
let field_id = Id::unique("pos_x").with("field");
u.frame_with(vec![Event::PointerMoved(at)], Modifiers::NONE);
u.frame_with(vec![press(true, Modifiers::NONE, at)], Modifiers::NONE);
u.frame_with(vec![Event::PointerMoved(pos2(at.x + 10.0, at.y))], Modifiers::NONE);
assert!(!u.ctx.is_being_dragged(field_id), "a plain press on the field isn't a drag of the field's");
u.frame_with(vec![Event::PointerMoved(pos2(at.x + 10.0, at.y)), press(false, Modifiers::NONE, pos2(at.x + 10.0, at.y))], Modifiers::NONE);
u.frame(vec![]);
assert_eq!(geom(&u, a).0, 55.0, "nothing scrubbed");
// With Alt held over it, the field does take the drag.
let (at, _) = field(&mut u, "X");
u.frame_with(vec![Event::PointerMoved(at)], alt);
u.frame_with(vec![press(true, alt, at)], alt);
u.frame_with(vec![Event::PointerMoved(pos2(at.x + 10.0, at.y))], alt);
assert!(u.ctx.is_being_dragged(field_id), "with Alt the drag is the field's");
u.frame_with(vec![Event::PointerMoved(pos2(at.x + 10.0, at.y)), press(false, alt, pos2(at.x + 10.0, at.y))], alt);
u.frame(vec![]);
assert_eq!(geom(&u, a).0, 65.0, "ten more");
}
@@ -58,7 +58,7 @@ pub(super) fn spacing_input(ui: &mut Ui, field: &SpacingField, value: &str, widt
ui.ctx().set_cursor_icon(egui::CursorIcon::ResizeHorizontal);
}
let numeric = value.trim_end_matches('%').parse::<f64>().ok();
match widgets::scrub(ui, field.id, &response, numeric, 1.0) {
match widgets::scrub(ui, field.id, &response, numeric, 1.0, true) {
Some(FieldEdit::Scrub(v, done)) => Some(SpacingEdit::Scrub(v, done)),
_ => typed.map(SpacingEdit::Typed),
}
+24 -7
View File
@@ -132,8 +132,9 @@ pub fn scrubbed(from: f64, amount: f64, quantum: f64) -> f64 {
}
/// The shared label-scrub gesture, including changing modifier rates and raw edge motion.
/// Callers supply the hit area and apply live values until the final `Scrub(_, true)`.
pub(crate) fn scrub(ui: &Ui, id: Id, response: &Response, value: Option<f64>, step: f64) -> Option<FieldEdit> {
/// Callers supply the hit area and apply live values until the final `Scrub(_, true)`. `fine_on_alt`:
/// Alt gives tenths (off where Alt is what makes the drag a scrub at all).
pub(crate) fn scrub(ui: &Ui, id: Id, response: &Response, value: Option<f64>, step: f64, fine_on_alt: bool) -> Option<FieldEdit> {
let v = value?;
// Where the scrub began and how far it has taken the value (the modifiers can change on
// the way: each stretch counts at its own rate).
@@ -150,7 +151,7 @@ pub(crate) fn scrub(ui: &Ui, id: Id, response: &Response, value: Option<f64>, st
// does too. Elsewhere the scrub just stops there.
let raw = p.motion().map_or(0.0, |m| m.x / i.pixels_per_point);
let at_edge = moved == 0.0 && p.hover_pos().is_none_or(|at| at.x <= 1.0 || at.x >= i.content_rect().max.x - 1.0);
(f64::from(if at_edge { raw } else { moved }), i.modifiers.shift, i.modifiers.alt)
(f64::from(if at_edge { raw } else { moved }), i.modifiers.shift, i.modifiers.alt && fine_on_alt)
});
// The frame the button goes up moves nothing: the scrub ends where the last one left it.
if response.dragged() {
@@ -265,7 +266,20 @@ fn number_field_impl(
let edit_rect = Rect::from_min_max(pos2(rect.min.x + lead_w, rect.min.y), rect.max);
let editing_id = id.with("editing");
let mut editing: Option<String> = ui.data(|d| d.get_temp(editing_id));
let field_resp = ui.interact(edit_rect, id.with("field"), Sense::click());
// Alt held over the field scrubs it too, as the label always does: "hover the input field
// itself and hold down the modifier key" (Adjust alignment, rotation, position, and
// dimensions). The field senses drags only while Alt is held, or while a scrub begun that way
// goes on (Alt released or not), so a plain press or a touch swipe on it stays the scroll
// area's; egui assigns a press by the frame before it, so Alt is held over the field before
// the press, as a hand does. Alt as the drag begins is what makes it a scrub.
let field_id = id.with("field");
let alt_now = ui.input(|i| i.modifiers.alt);
let scrubbing_id = id.with("altscrub");
let scrubbing = ui.data(|d| d.get_temp::<bool>(scrubbing_id)).unwrap_or(false);
let field_sense = if editing.is_none() && (alt_now || scrubbing) { Sense::click_and_drag() } else { Sense::click() };
let field_resp = ui.interact(edit_rect, field_id, field_sense);
let alt_scrub = editing.is_none() && if field_resp.drag_started() { alt_now } else { scrubbing };
ui.data_mut(|d| d.insert_temp(scrubbing_id, alt_scrub && field_resp.dragged() && !field_resp.drag_stopped()));
a11y::number(&field_resp, lead.name(), value, suffix, empty.text());
a11y::ring_around(ui, rect, &field_resp);
// The label scrubs with the pointer; the keyboard stops at the value only.
@@ -291,10 +305,13 @@ fn number_field_impl(
}
Lead::None | Lead::Named(_) => {}
}
if lead_resp.hovered() || lead_resp.dragged() {
if lead_resp.hovered() || lead_resp.dragged() || (alt_now && editing.is_none() && field_resp.hovered()) || (alt_scrub && field_resp.dragged()) {
ui.ctx().set_cursor_icon(egui::CursorIcon::ResizeHorizontal);
}
if let Some(edit) = scrub(ui, id, &lead_resp, value, step) {
// On the field, Alt is what makes the drag a scrub, so it is not the fine rate there.
if let Some(edit) =
scrub(ui, id, &lead_resp, value, step, true).or_else(|| alt_scrub.then(|| scrub(ui, id, &field_resp, value, step, false)).flatten())
{
out = Some(Edit::All(edit));
}
let (key_step, key_big) = key_steps(ui.ctx(), suffix, step);
@@ -340,7 +357,7 @@ fn number_field_impl(
}
// Typing on a field the keyboard reached (Tab) edits it: the editor takes the typed text.
let typed_now = editing.is_none() && on_field && ui.input(|i| i.events.iter().any(|e| matches!(e, egui::Event::Text(_))));
let started = editing.is_none() && (field_resp.clicked() || typed_now);
let started = editing.is_none() && ((field_resp.clicked() && !alt_now) || typed_now);
// The text the field would commit to no effect: what it showed when the edit began, or the
// value the arrows last stepped it to.
let kept_id = id.with("kept");
+6 -2
View File
@@ -854,11 +854,15 @@ removes the whole conditional). Every one is an undo step and applies to all `id
with the same interactions). Flows `proto.flow.add` / `rename` / `remove`,
and the device, its rotation and the background `proto.settings {device?, background?,
rotation?, color?, width?, height?, responsive?}` (`None`, `iPhone 16`, `iPhone 16 Pro Max`,
`Android Compact`, `iPad mini`, `MacBook Air`, `Desktop` or `Custom size`; `rotation` `portrait` or
`Android Compact`, `iPad mini`, `MacBook Air`, `Desktop` or `Custom size`, in any case; another
name is an error that lists the devices, and nothing changes; `rotation` `portrait` or
`landscape`, which turns phones and tablets; `color` one of the device's colours by name, e.g.
`Black`, `White`, `Pink`, `Teal`, `Blue` for the iPhone 16 (an error lists them), `""` for the
default; `width` / `height` set the custom size's screen, 1–10000 points, and pick `Custom size`,
which is a bare screen without a body). On a device the presented frame is sized to the device's
which is a bare screen without a body). Every call answers the page's settings as they are after
it, so `proto.settings {}` reads them: `{device, background, rotation, color (the colour shown, null
without a body), screen ({width, height} as presented, null without a device), customSize,
responsive}`. On a device the presented frame is sized to the device's
screen: a frame bigger than the screen scrolls through its whole size whatever its `overflow`, content
past the frame's own edges scrolls only as its `overflow` allows (else it's clipped), and `fixed`
layers stay on screen (pinned to the edges their constraints name). With `responsive: true` (saved
+2 -1
View File
@@ -1,6 +1,6 @@
# Prototyping parity
> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-01 · **Change:** minor (Hide UI in the presenter's Options menu, and Cmd/Ctrl+\ as in the editor: the bar above the prototype and the navigation bar under it go away, a toast names the key that brings them back, `proto.presentOptions {hideUi}` (#1820); the Controller menu names each button as PlayStation and Switch controllers do; "Open in new tab" on Open link: off, the web build's own tab goes to the link; a manual overlay's position can be dragged on the canvas (#405); Open link notices now cover mail links, and skipping them covers only links the viewer fired (#1096); overlay positions relative to the layer that opens them; the Triggers row no longer lists delays on mouse triggers as missing; top-level frames bigger than the device's screen scroll in the player; Change to, set variable and set variable mode lay out what they change in the player, as the canvas does; presentation tabs, one per page of a file; a Present tab with device and scale controls (#537); core editor leftovers: delays on mouse triggers and manual overlay offsets; controller buttons on key/gamepad triggers, widgets that react in prototypes, `proto.evaluate` and the mode lookup rules pinned) · **Target:** Figma Design (desktop app 126.10.7)
> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-06 · **Change:** patch (`proto.settings` refuses an unknown device with the list of devices instead of saving it, takes a known one in any case, and answers the page's settings, so `proto.settings {}` reads them (#2027); Hide UI in the presenter's Options menu, and Cmd/Ctrl+\ as in the editor: the bar above the prototype and the navigation bar under it go away, a toast names the key that brings them back, `proto.presentOptions {hideUi}` (#1820); the Controller menu names each button as PlayStation and Switch controllers do; "Open in new tab" on Open link: off, the web build's own tab goes to the link; a manual overlay's position can be dragged on the canvas (#405); Open link notices now cover mail links, and skipping them covers only links the viewer fired (#1096); overlay positions relative to the layer that opens them; the Triggers row no longer lists delays on mouse triggers as missing; top-level frames bigger than the device's screen scroll in the player; Change to, set variable and set variable mode lay out what they change in the player, as the canvas does; presentation tabs, one per page of a file; a Present tab with device and scale controls (#537); core editor leftovers: delays on mouse triggers and manual overlay offsets; controller buttons on key/gamepad triggers, widgets that react in prototypes, `proto.evaluate` and the mode lookup rules pinned) · **Target:** Figma Design (desktop app 126.10.7)
**Breadth ~92%, ready ~74% (estimated).** Every Figma trigger except media, every action except
media control, every transition and easing exist; key/gamepad triggers take controller buttons,
@@ -107,6 +107,7 @@ tool; opt-in), **silent** (the documentation doesn't say; the case pins the curr
| Date | Change | Summary |
|---|---|---|
| 2026-11-06 | patch | M5, #2027: `proto.settings` took any string as the device (`"Pixel Nonexistent"`, `"iphone 16"`) and saved it in the file; the presenter then drew no device while its picker showed the name as if it were one, and the settings couldn't be read back over MCP (`proto.settings {}` answered `{ok: true}`). An unknown name (or a non-string) is now refused with every name the picker offers (`None`, `Custom size` and the devices), as an unknown colour is refused with the device's colours, and nothing changes; a known name is taken in any case and stored as the picker spells it. Every call answers the page's settings after it: device, background, rotation, the colour shown, the screen as presented, the custom size and responsive. Test: `proto_present_tests::unknown_devices_are_refused_and_settings_read_back` |
| 2026-10-31 | minor | Gap 15: the Controller menu names buttons as PlayStation and Switch controllers do; that item leaves the missing list. Estimate unchanged. Test: `present::tail_tests`. |
| 2026-10-30 | minor | Opening a link in place: Open link has "Open in new tab", on by default; off, the web build's own tab goes to the link after the notice (or at once with it skipped); the desktop app has no tab of its own and opens the browser either way. Saved in files only when off (`openInNewTab`) and read from REST files. |
| 2026-10-30 | patch | A manual overlay can be placed on the canvas (#405): while the interaction editor has an Open overlay action with Manual position open, the overlay frame shows dimmed, outlined, where it opens from the top-left of the layer that opens it (right below that layer without an offset), and dragging it moves it there. The X and Y fields follow while dragging, and the drag is one undo step (`crates/ui-egui/src/canvas/proto_canvas/overlay_ghost.rs`). Numbers unchanged |
+3 -2
View File
File diff suppressed because one or more lines are too long