fix(links): notes.link-states is no longer asked about in a loop for links to files the list does not hold (#1178) #1180

Closed
kayg wants to merge 0 commits from fix/flake-1178 into dev
Owner

Fixes #1178. A link to a file the notes list never holds (a task's note under Tasks/) was asked about again on every draw, and each answer redrew the link: notes.link-states about 28 times a second, for ever, with every task path of the vault in the body.

word() now asks again about a here answer only after the notes list has changed since the answer (askedAt per path, compared with notesState.paths, the counter checkPaths already uses). The case the branch exists for (a note that was here and left the list) is still asked at once. Three commits: the regression spec (red), the fix, a tidy (word() computes the path key once).

Perf statement (note open / link draw): removes ~28 requests per second per open page; the only added work per draw is one Map.get on an answered here link (the path key was already computed, now once instead of twice). Nothing on typing or list scroll.

Evidence and gates are on #1178.

🤖 Generated with Claude Code

Fixes #1178. A link to a file the notes list never holds (a task's note under `Tasks/`) was asked about again on every draw, and each answer redrew the link: `notes.link-states` about 28 times a second, for ever, with every task path of the vault in the body. `word()` now asks again about a `here` answer only after the notes list has changed since the answer (`askedAt` per path, compared with `notesState.paths`, the counter `checkPaths` already uses). The case the branch exists for (a note that was here and left the list) is still asked at once. Three commits: the regression spec (red), the fix, a tidy (`word()` computes the path key once). **Perf statement (note open / link draw):** removes ~28 requests per second per open page; the only added work per draw is one `Map.get` on an answered `here` link (the path key was already computed, now once instead of twice). Nothing on typing or list scroll. Evidence and gates are on #1178. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A link to a file the notes list never holds (a task's note under Tasks/)
is answered 'here', and word() asked again on every draw while the list was
ready. The answer redrew the link, which asked again, every 30 ms, for as
long as the page was open, with every task note path of the vault in each
request.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
refactor(links): word() computes the path key once
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled
84f33ad571
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Owner

Merged into dev with --no-ff (orchestrator, 16 Nov ~07:00 IST) after reviewing the diff and the red/green test.

Merged into dev with `--no-ff` (orchestrator, 16 Nov ~07:00 IST) after reviewing the diff and the red/green test.
kayg closed this pull request 2026-11-16 00:53:16 +00:00
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!1180
No description provided.