Repository navigation
Refresh rich Markdown links when document metadata changes - #26595
Conversation
101c15b to
9dcd07e
Compare
2bf93f3 to
ffb4496
Compare
9dcd07e to
e5123f3
Compare
ffb4496 to
2e95086
Compare
e5123f3 to
8636c57
Compare
8636c57 to
b99c90a
Compare
📝 WalkthroughWalkthroughThe rich Markdown link extension now caches a document index and adds resolution decorations to links. Unit tests cover changes to link resolution while preserving document content and link labels. A Docker-gated E2E test covers retained links in a restored remote worktree and navigation to a sibling document. CI source routing, job selection, and workflow configuration direct this test to a dedicated Docker lane. Priority: ⬇️ Low Merge Risk: 🔵 Low · up to The current change is mergeable with a bounded CI coverage gap: future changes limited to the link cache will not automatically run its dedicated E2E test. Add the storage module to the route and routing test. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)Full details: Docstring CoverageExplanation 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 7 functions across 7 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d4c0dfa3-69de-4ad7-9b11-f7f0d5555a68
📒 Files selected for processing (8)
.github/workflows/e2e.ymlconfig/scripts/ci-e2e-job-selection.mjsconfig/scripts/ci-e2e-job-selection.test.mjsconfig/scripts/pr-e2e-source-routing.mjssrc/renderer/src/components/editor/rich-markdown-doc-link-resolution.test.tssrc/renderer/src/components/editor/rich-markdown-doc-link-storage.tssrc/renderer/src/components/editor/rich-markdown-doc-link.tstests/e2e/ssh-orcad-markdown-link-refresh.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.
| specs: ['tests/e2e/ssh-orcad-markdown-link-refresh.spec.ts'], | ||
| matches: (file) => | ||
| isProductSource(file) && | ||
| /^src\/renderer\/src\/components\/editor\/(?:rich-markdown-doc-link|useRichMarkdownProgrammaticSync)\.ts$/.test( |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Route storage changes to the link-refresh spec.
The new rich-markdown-doc-link-storage.ts module owns the document-index cache, but this pattern does not match it. If a later PR changes only that module, this route will not select the dedicated link-refresh E2E spec. Add the storage module to the pattern and its routing test.
ELI5
A link in the rich Markdown editor could look broken even after Orca learned that its remote document exists. Refresh the existing link when the document list changes, so its appearance matches where it can take you.
What Changed
The existing document-link decoration plugin now publishes resolution for rendered link nodes as well as links being typed. Extension storage is typed, with its existing index cache moved to a focused module to keep the extension within the file-size limit. When metadata changes, the changed decoration asks ProseMirror to update the existing link view. Text, selection and the document itself stay intact.
The real Docker conversion regression runs in the existing template-building CI lane. The shared Docker-lane contract is extracted into a separate test file without dropping existing checks.
Why
The link view previously assumed every transaction would call its update method. ProseMirror reuses an unchanged node when its decorations are also unchanged, so a metadata-only transaction left the old missing-link class in place. A decoration carries the changed resolution through the existing rendering mechanism without reparsing the document, moving the cursor or adding a separate listener lifecycle.
Linked Issue
Found while exercising SSH consolidation in #26483. Independent of the other consolidation fixes.
Visual Proof
markdown-link-refresh-runtime-red.log
markdown-link-refresh-runtime-green.log
The before and after show the same rich link as missing versus resolved. Runtime logs include positive host metadata and the corrected modifier-click opening a sibling document that exists only on that host.
Testing
pnpm tc,pnpm lint, changed-code quality, affected-file lint and fresh E2E build pass.Review
Existing CSS classes and design tokens are unchanged. Resolution is decoration state, not saved document content. The existing metadata transaction triggers the refresh; no added network requests, polling or effects.
Agent skill upstream boundary
Notes
No RPC or persisted schema change. The same rendering path handles local, remote and folder-workspace document lists. Modifier-click validation uses the platform’s shortcut modifier. Runtime checks cover macOS client/Linux SSH host; no Windows runtime claim.
The independent baseline also logs the wrong-host Markdown metadata call fixed by #26590 and contains the duplicate file records fixed by #26593. This PR fixes link resolution refresh; it does not claim either of those fixes or suppress unrelated reconnect logs.
Checklist