authoravatarclover caruso<git@paperclover.net>2026-10-19 11:26:41-07:00
committeravatarclover caruso<git@paperclover.net>2026-10-19 22:58:56-07:00
log3d2698e42b763a8b291c546360efcf2512995fa2
treee0a593b332a623f9893cc47371466f279188ca6d
parentf91a8cd65409195aa7bbe74edca1e47f928092a3
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

fix(notebook): keep the notebook listing in one write

The listing kept after each refresh was serialized straight into its file, one write per token. Deleting the Empty section of the corpus notebook m6/native-features-01 on the iPad simulator (debug build) held the notebook for about 14.5 s, sampled inside keep_listing's serde writes; written whole, the same step took under 1.5 s, the scripted run's next step landing on time. - Deleting, moving and restoring sections no longer pause for seconds. Assisted-by: claude-opus-5.5

1 files changed, 2 insertions(+), 1 deletions(-)

crates/notebook/src/session.rs+2-1
......@@ -627,7 +627,8 @@ impl Notebook {
627627 let _ = (|| -> Result<()> {
628628 let folder = self.listing.parent().unwrap_or(Path::new("."));
629629 let mut file = tempfile::NamedTempFile::new_in(folder)?;
630 serde_json::to_writer(&mut file, &self.read).map_err(io::Error::from)?;
630 // Whole, as a write per token takes seconds.
631 file.write_all(&serde_json::to_vec(&self.read).map_err(io::Error::from)?)?;
631632 file.persist(&self.listing).map_err(|error| error.error)?;
632633 Ok(())
633634 })();