Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VdfEGXA7aJ6ftMsCc9PJze
This commit is contained in:
Edward Langley
2026-09-23 08:26:59 -07:00
parent dc944ea24b
commit d5da9747ee
3 changed files with 23 additions and 8 deletions
+8 -1
View File
@@ -303,7 +303,14 @@ pub fn records_at_stake(app: &App, cmd: &ModelCommand) -> Vec<RecordHash> {
.resolve_record(*record)
.map(|source| RecordHash::of(&source.with(category, item)))
.filter(|dest| dest != record)
.filter(|dest| app.model_state.workbook.model.data.resolve_record(*dest).is_some());
.filter(|dest| {
app.model_state
.workbook
.model
.data
.resolve_record(*dest)
.is_some()
});
records.extend(destination);
}
records
+2 -3
View File
@@ -3,9 +3,8 @@
use crate::{
BasisCache, CategoryTreeCache, Command, DocumentCache, FormulaCache, GridCache, ModelCommand,
Projection,
Rejection, Snapshot, TileBarCache, ViewListCache, ViewState, WidgetCache, reduce_view,
settled_mode,
Projection, Rejection, Snapshot, TileBarCache, ViewListCache, ViewState, WidgetCache,
reduce_view, settled_mode,
};
use improvise_core::model::record::RecordHash;
use serde::Serialize;
@@ -1239,8 +1239,9 @@ fn from_another_client(host: &mut Host, a_id: Sid, a: &mut Client, cmd: ModelCom
let frame = improvise_command::ui::reduce::caught_up(host.app(), cmd);
let relayed = host.handle(b_id, ClientFrame::command(frame));
assert!(
relayed.iter().any(|f| f.to == b_id
&& matches!(f.msg, improvise_protocol::ServerFrame::Accepted)),
relayed
.iter()
.any(|f| f.to == b_id && matches!(f.msg, improvise_protocol::ServerFrame::Accepted)),
"the other client's write must land: {relayed:?}"
);
let for_a: Vec<Addressed> = relayed.into_iter().filter(|f| f.to == a_id).collect();
@@ -1293,7 +1294,11 @@ fn a_retry_after_record_gone_renames_no_other_record() {
);
press(&mut host, a_id, &mut a, "Enter");
assert_eq!(region(&host, "Zed"), None, "the retry renamed a record never opened");
assert_eq!(
region(&host, "Zed"),
None,
"the retry renamed a record never opened"
);
assert_eq!(region(&host, "South"), Some(CellValue::Number(2.0)));
assert_eq!(region(&host, "West"), Some(CellValue::Number(3.0)));
assert_eq!(region(&host, "Yak"), Some(CellValue::Number(1.0)));
@@ -1356,6 +1361,10 @@ fn a_rename_onto_a_record_this_client_has_seen_still_overwrites_it() {
.any(|f| matches!(f.msg, improvise_protocol::ServerFrame::Accepted)),
"{answer:?}"
);
assert_eq!(region(&host, "South"), Some(CellValue::Number(1.0)), "North's value");
assert_eq!(
region(&host, "South"),
Some(CellValue::Number(1.0)),
"North's value"
);
assert_eq!(region(&host, "North"), None);
}