Skip to content

Refresh open Markdown links when workspace files change - #26599

Merged
OrcaWin merged 2 commits into
mainfrom
nwparker/remote-markdown-live-documents
Oct 9, 2026
Merged

OrcaWin merged 2 commits into
mainfrom
nwparker/remote-markdown-live-documents

Conversation

@nwparker

@nwparker nwparker commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​386 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​386
Prod 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​127 $\color{#cf222e}{\Huge{\mathbf{−}}}$​9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​118

ELI5

A Markdown preview now notices when a linked document is created or deleted in its workspace, without requiring you to reopen the preview.

What Changed

Before, a remote host and the file explorer could both list a newly created LATE.md, while an open [[LATE]] link still said Document not found. Markdown metadata now listens to the existing editor file-change event, checks the host and workspace root, and refreshes after creates, deletes, renames, directory changes or watcher overflow.

Why

The app already owns the file watcher. Reusing its events avoids another watcher, IPC channel or polling loop. A short debounce combines write bursts; split panes share a scan started after the change and bypass older pending results. Ordinary content updates and unrelated files do not trigger document scans.

Linked Issue

Found during SSH → Remote conversion testing; no existing issue.

Visual Proof

Before: the explorer lists LATE.md, but the preview link remains missing. After: the same open preview resolves the link. The corrected runtime also verifies that deletion restores missing-target styling.

markdown-live-documents-before-final.png
markdown-live-documents-after-final.png
markdown-live-documents-runtime-red-final.log
markdown-live-documents-runtime-green-final.log

Testing

  • Manually tested with a hidden macOS Electron client and an owned Linux Docker SSH host, using the installed production server template.
  • Automated regressions added, including the dedicated template-building Docker CI lane.

The identical conversion → full restart → open preview → host-create journey fails on untouched Phase 3.5 in 21.4 s, despite a positive host document-list response and the actual host-qualified create event. The corrected build passes create and delete in 13.3 s. Nine new regressions fail on baseline; 186 tests across 16 files pass after the change. Full pnpm tc, pnpm lint, changed-code quality, fresh E2E build and commit hooks pass. CI's standalone React Doctor check also passes after removing an unnecessary callback ref; the rebuilt create/delete runtime passes again in 12.3 s.

Unit coverage includes host/root isolation, local ownership, Markdown extensions, renames, directory deletion, overflow, burst/split-pane coalescing, late stale results, equal-clock freshness, and cancellation when the owner changes or the pane unmounts.

Review

Independent of the other consolidation fixes; base is OrcaWin/phase35. Product changes are limited to document-list refresh, sharing fresh in-flight requests, exporting an existing Markdown extension classifier, and typing the existing DOM event.

Agent skill upstream boundary

  • Not applicable; this change copies no upstream skill-installer source or resources.

Notes

No remote wire or server change. The same event path covers folder workspaces, Git worktrees, direct SSH and managed hosts. Windows path behavior uses the existing cross-platform path functions; Windows was not runtime-tested.

The real proof restarts the converted app before changing files because conversion can separately strand the editor watcher after its initial connection failure. That recovery defect remains under investigation. The independent wrong-host metadata and duplicate editor-record defects also remain visible in baseline logs; this PR does not fix them or rich-editor NodeView styling.

Checklist

  • Small, focused product change
  • ELI5, user-facing before/after, mechanism and choice explained
  • Before/after screenshots and runtime logs attached
  • Self-reviewed for correctness, security and performance
  • Cross-platform paths, SSH ownership, folder workspaces and compatibility considered
  • Local lint, typechecks, affected tests and build pass

@OrcaWin
OrcaWin force-pushed the nwparker/remote-markdown-live-documents branch from f19dd12 to be7ed94 Compare October 9, 2026 02:22
@OrcaWin
OrcaWin changed the base branch from OrcaWin/phase35 to nwparker/remote-markdown-link-refresh October 9, 2026 02:22
@OrcaWin
OrcaWin force-pushed the nwparker/remote-markdown-link-refresh branch from 9dcd07e to e5123f3 Compare October 9, 2026 05:06
@OrcaWin
OrcaWin force-pushed the nwparker/remote-markdown-live-documents branch from be7ed94 to e01f5a8 Compare October 9, 2026 05:06
@OrcaWin
OrcaWin force-pushed the nwparker/remote-markdown-link-refresh branch from e5123f3 to 8636c57 Compare October 9, 2026 05:30
@OrcaWin
OrcaWin force-pushed the nwparker/remote-markdown-live-documents branch from e01f5a8 to ed9b620 Compare October 9, 2026 05:30
@OrcaWin
OrcaWin force-pushed the nwparker/remote-markdown-link-refresh branch from 8636c57 to b99c90a Compare October 9, 2026 05:45
@OrcaWin
OrcaWin force-pushed the nwparker/remote-markdown-live-documents branch from ed9b620 to 7eb686c Compare October 9, 2026 05:45
@OrcaWin
OrcaWin changed the base branch from nwparker/remote-markdown-link-refresh to main October 9, 2026 06:03
@OrcaWin
OrcaWin force-pushed the nwparker/remote-markdown-live-documents branch from 7eb686c to b932977 Compare October 9, 2026 06:03
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 666ebdc5-9bec-4ba8-b0ea-e48a3fbfabfb
📥 Commits

Reviewing files that changed from the base of the PR and between d2d2d39 and b932977.

📒 Files selected for processing (12)
  • .github/workflows/e2e.yml
  • config/scripts/ci-e2e-job-selection.mjs
  • config/scripts/ci-e2e-job-selection.test.mjs
  • config/scripts/pr-e2e-source-routing.mjs
  • src/renderer/src/components/editor/markdown-document-list-request.test.ts
  • src/renderer/src/components/editor/markdown-document-list-request.ts
  • src/renderer/src/components/editor/markdown-internal-links.ts
  • src/renderer/src/components/editor/use-markdown-document-watch-refresh.ts
  • src/renderer/src/components/editor/useMarkdownDocuments.ts
  • src/renderer/src/components/editor/useMarkdownDocuments.watch.test.ts
  • src/renderer/src/hooks/worktree-file-change-event.ts
  • tests/e2e/ssh-orcad-markdown-live-documents.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The Markdown document listing now refreshes after qualifying worktree file-change events. Refresh requests carry a freshness timestamp, and watcher-triggered failures retain the last successful list. The changes add tests for event filtering, request freshness, refresh behavior, and cleanup. A Docker-backed E2E test checks document listing and preview-link state after a remote document is created and removed. CI routing and job selection include the new E2E spec.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to b9329

Document-list refreshes and the new E2E routing appear ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check Warning The description is detailed and covers the change, rationale, testing, visual proof, scope, and checklist. However, it explicitly states that no issue exists and does not provide the required linked i… Add an actual linked issue under "Linked Issue" using the required Fixes #<issue-number> format, or provide the applicable pre-existing issue reference.
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 11 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check Passed The title clearly describes the primary product change: refreshing open Markdown links when workspace files change.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is detailed and covers the change, rationale, testing, visual proof, scope, and checklist. However, it explicitly states that no issue exists and does not provide the required linked issue reference.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 11 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OrcaWin
OrcaWin merged commit f9d0aa2 into main Oct 9, 2026
39 checks passed
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.

2 participants