Skip to content

Open a renamed note in the knowledge base at its new path - #263

Merged
BunsDev merged 6 commits into
mainfrom
notes-open-knowledge-path
Oct 16, 2026
Merged

BunsDev merged 6 commits into
mainfrom
notes-open-knowledge-path

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Part of #241 (finding 8: "Open in knowledge base can send the old path").

The probe

With the notes folder as the knowledge base: create a page (its file is Untitled.md), type a new title, then right away choose Page actions → Open in knowledge base. Blurring the title renames the file to Renamed.md, but the menu action read the page's file from notes.tree in the render that built the menu. The action's own await notes.refresh() could not help, because the click handler still held the old tree. Main got knowledge:open with Personal/Notes/Untitled.md and failed with ENOENT.

The fix

Main already knows where each page's file is (NotesStore.pageRel). After saving and settling the page, the action now asks main for that path at click time through a new notes:page:path channel and opens it. The renderer's tree lookup (pagePath) is gone. The channel is registered in the desktop main process, in browser dev (commands.ts) and as unavailable in the store review demo, like the other notes:* channels.

Regression test

e2e/knowledge.spec.ts → "Open in knowledge base opens a just-renamed page at its new file". It stubs knowledge:state so the notes folder is the knowledge base and records what reaches knowledge:open. To act before the sidebar's 1.5 s tree poll every time, it makes polls report "unchanged" while full reads still go to main. Then it creates a page, retitles it, opens it in the knowledge base, and asserts { folder, path: "Personal/Notes/Renamed.md" }, that the file exists, and that no error is shown.

  • Before the fix: failed 4/4, receiving "path": "Personal/Notes/Untitled.md". Without the poll hold it failed 2 of 3 runs, the same race the reviewer saw.
  • After the fix: passed 4/4.

Checks run locally

  • pnpm build: passed. pnpm --filter @modex/desktop typecheck: passed.
  • pnpm test: worktrees 107/107, core 16/16, site 10/10, store-desktop 16/16. Desktop unit: 1,420 passed, 16 skipped, 0 failed, and 1 cancelled. The cancelled test, demo waits for a slow turn to reach approval before auto-answering, hit its 5 s timeout while the Mac's load average was about 30; it is unrelated to this change. Rerun alone, demo.test.js passed 3/3, and the remaining desktop node tests passed 21/21.
  • playwright test e2e/space.spec.ts e2e/knowledge.spec.ts e2e/notes.spec.ts: 20 passed, 3 skipped (the MODEX_TEST_OPEN_KNOWLEDGE-gated tests).
  • playwright test e2e/notes-tree.spec.ts e2e/notes-files.spec.ts: 2 passed.

Coven-Harness: Claude Code / claude-opus-5-5

Before: right after a page title was changed, Open in knowledge base read
the page's file from the notes tree held by the render that built the menu.
That tree still had the old name (Untitled.md), so main was asked to open a
file that no longer existed and failed with ENOENT. Refreshing the tree in
the action did not help, because the click handler kept the old tree.

After: once the page is saved and its file renamed, Space asks main for the
page's current file (new notes:page:path channel, from the notes store's
pageRel) and opens that.

Part of #241 (finding 8).

Coven-Harness: Claude Code / claude-opus-5-5
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modex Ready Ready Preview Oct 16, 2026 11:41am UTC

Request Review

BunsDev added a commit that referenced this pull request Oct 16, 2026
…reply (#266)

The Images live-update subscription depended on the expanded job id. Submitting a job
sets that id, so React tore the subscription down and cleared its pending 100 ms refresh.
When main took the new job from queued to waiting-for-approval before React committed
that render, every change event had already been folded into the cleared refresh. No
further event comes while a job waits for approval, so the list kept the "queued" it read
right after submitting, and the open transcript kept the previous job's items with no
Approve button, until the window regained focus.

The job queue is not involved. The two failing CI runs (38856460357 for #255 and
38850091541 for #263) show the same snapshot: the revision job "queued" with the first
job's transcript, "Decision: yes", under it. A stale transcript means no refresh fired
after the job id changed in the 15 s wait. Their traces show the first job succeeding
about 110 ms after Approve and the revision click 250 ms later, so CI was not slow.

Probe logs locally: the effect re-ran 7-33 ms after the submit, and main reached
approval 90-330 ms after it because each store write fsyncs on a busy disk. With fsync
stubbed in main, as on a fast CI disk, main reached approval in 5-9 ms, before React's
effect at 11-16 ms. The existing spec then failed 8 of 10 runs with the CI snapshot.
With this change it passed 10 of 10.

The subscription now lives for as long as Images is shown. It reads the current refresh
and job id from refs when it fires. Submitting points it at the new job immediately and
clears the old transcript. Showing Images again reloads the open job's transcript,
because events are not observed while it is hidden.

New e2e test: it pauses the renderer through CDP right after it sends the submission
and resumes once jobs.json says waiting-for-approval. The new job's Approve button must
then appear without reopening Execution details. It failed 3 of 3 runs before the
change and passes after it.

Coven-Harness: Claude Code / claude-opus-5-5
@github-code-quality

Copy link
Copy Markdown

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage-agent

main a60efbb notes-open-knowledge... 549ad6f +/-
61% 61% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

@BunsDev
BunsDev merged commit 8a635f2 into main Oct 16, 2026
13 checks passed
@BunsDev
BunsDev deleted the notes-open-knowledge-path branch October 16, 2026 12:04
BunsDev added a commit that referenced this pull request Oct 19, 2026
… and the routines spec (#310)

v0.2.0 was published on 2026-10-18 (23:14Z) from the signed tag on 01b1b8a. This
follows Val's status layout (#290):

- Shipped gains a v0.2.0 row linking its release and its review.
- The 13 "On main, unreleased" items move unchanged to a new "Status summary"
  at the end of the v0.2.0 review, along with the old In flight entry. Each one
  was introduced by a commit in the tag (#248, #253, #254, #257 to #261, #263,
  #264, #266, #267, #269). The CF slices and #283's Markdown parser came after
  the tag, so they stay.
- In flight keeps a short follow-ups entry for the gates no receipt records yet:
  the independent download checks, the banner upgrade on the release Mac, and
  the Companion 0.2.0 (7) TestFlight upload.
- The routines spec and the README now say Phase 1, and most of Phase 0, ship
  from v0.2.0.

Unchanged: the website's static fallback (apps/site/release.json) and the
release evidence, which stay with the release owner. Claimed on #290.

Coven-Harness: Claude Code / claude-opus-5-5

This branch was successfully deployed

1 active deployment
Preview — 549ad6ff Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant