Preserve read-only panning while canceling State edits
This commit is contained in:
@@ -305,7 +305,16 @@ fn state_bend_self_loop_add_move_remove_clear_preserves_project_and_source_histo
|
|||||||
vec![],
|
vec![],
|
||||||
);
|
);
|
||||||
assert_eq!(app.project(), &baseline.decoded.project);
|
assert_eq!(app.project(), &baseline.decoded.project);
|
||||||
|
assert_source_model_agree(&app);
|
||||||
|
// Clear is a new source-preserving edit and may retain empty-list trivia.
|
||||||
|
// Exact original bytes are restored by history, not by reauthoring a value.
|
||||||
|
for _ in 0..3 {
|
||||||
|
assert!(app.document.can_undo());
|
||||||
|
send(&mut app, Message::Undo);
|
||||||
|
}
|
||||||
|
assert_eq!(app.project(), &baseline.decoded.project);
|
||||||
assert_eq!(app.document.bundle(), &baseline.bundle);
|
assert_eq!(app.document.bundle(), &baseline.bundle);
|
||||||
|
assert!(!app.document.can_undo());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -136,13 +136,16 @@ enum Hit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl State {
|
impl State {
|
||||||
fn cancel_gesture(&mut self) {
|
fn cancel_edit(&mut self) {
|
||||||
self.press = None;
|
self.press = None;
|
||||||
self.preview = None;
|
self.preview = None;
|
||||||
self.attachment_preview = None;
|
self.attachment_preview = None;
|
||||||
self.bend = None;
|
self.bend = None;
|
||||||
self.bend_preview = None;
|
self.bend_preview = None;
|
||||||
self.attachment_viewport = None;
|
self.attachment_viewport = None;
|
||||||
|
}
|
||||||
|
fn cancel_gesture(&mut self) {
|
||||||
|
self.cancel_edit();
|
||||||
self.pan_from = None;
|
self.pan_from = None;
|
||||||
}
|
}
|
||||||
fn reset(&mut self) {
|
fn reset(&mut self) {
|
||||||
@@ -1178,7 +1181,9 @@ impl canvas::Program<Event> for StateCanvas<'_> {
|
|||||||
state.tool = Some(self.tool);
|
state.tool = Some(self.tool);
|
||||||
}
|
}
|
||||||
if !self.editable {
|
if !self.editable {
|
||||||
state.cancel_gesture();
|
// Pending edits block model changes, but read-only panning remains
|
||||||
|
// available and must survive successive pointer events.
|
||||||
|
state.cancel_edit();
|
||||||
state.source = None;
|
state.source = None;
|
||||||
}
|
}
|
||||||
if state
|
if state
|
||||||
|
|||||||
@@ -75,6 +75,15 @@ observe menus, guidance, preview and normal close. Bind evidence to an identifie
|
|||||||
source/binary and predeclared complete-Project expectations. Compilation alone
|
source/binary and predeclared complete-Project expectations. Compilation alone
|
||||||
does not establish interaction acceptance. Linux remains user-paused.
|
does not establish interaction acceptance. Linux remains user-paused.
|
||||||
|
|
||||||
|
The first full workspace run exposed a read-only pan regression: canceling model
|
||||||
|
edits on every pending-draft event also canceled the middle-button pan. Keep
|
||||||
|
edit cancellation separate from navigation cancellation; the existing scoped
|
||||||
|
pan regression exercises this distinction. The self-loop test also distinguishes
|
||||||
|
typed-model restoration by Clear from byte-exact source restoration by Undo:
|
||||||
|
source-preserving edits may retain harmless empty-list whitespace, whereas Undo
|
||||||
|
must recover the original source bundle exactly. Failed run receipts are retained;
|
||||||
|
these findings do not assert that the corrected candidate has passed its gates.
|
||||||
|
|
||||||
Codex-956atf retains issue 16 resize and issue 27 integration ownership. This
|
Codex-956atf retains issue 16 resize and issue 27 integration ownership. This
|
||||||
work uses the existing State model/router and needs composition with those
|
work uses the existing State model/router and needs composition with those
|
||||||
contributions. It does not certify a combined release, change Process/Scenario
|
contributions. It does not certify a combined release, change Process/Scenario
|
||||||
|
|||||||
Reference in New Issue
Block a user