Split note derived recompute into fast (local) and heavy (global) paths#892
Merged
multiplex55 merged 2 commits intonoteoptfrom Feb 17, 2026
Merged
Conversation
…note.rs Refactor save_note to use cache-driven slug collision handling and add tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
refresh_fast_derivedfor immediate local recompute oftags,wiki_links, andexternal_links, andrefresh_heavy_derivedfor expensive global recompute oftodo_label_mapand backlink rows usingnote_version()andtodo_version()to short-circuit unchanged work.fast_derived_dirty,heavy_recompute_requested,last_edit_at_secs,last_notes_version, andlast_todo_revisionfields toNotePanel, and replace the old recompute counter withheavy_recompute_countunder#[cfg(test)].maybe_refresh_heavy_derivedusing aHEAVY_RECOMPUTE_IDLE_DEBOUNCEconstant, while forcing heavy recompute after successful saves and after overwrite/save-as-new flows.mark_content_changedon edits/preview mutations and to callrefresh_fast_derived/refresh_heavy_derived(true)where a full refresh is required, and add the unit testedits_do_not_trigger_heavy_recompute_every_framewhile adjusting existing derived-recompute tests to track heavy recomputes.Testing
cargo fmt --allwhich completed successfully.cargo test edits_do_not_trigger_heavy_recompute_every_frame -- --nocapture, but the build failed in this environment due to a missing system dependency (alsa.pc) required by thealsa-syscrate, preventing the test run from completing.heavy_recompute_countbehavior, and the new test was added to prevent heavy recompute increments on every frame during active edits.Codex Task