Skip to content

B-W7QK-wikilinks-render-as-resolved-in-viewer-hosts

State: promoted/task

A host that mounts MdViewer without providing a NoteSource — the SDLC entity and task bodies, and the suspenders skill detail, both shipped that way — renders every wikilink as an ordinary, resolved-looking link:

<a class="wikilink" data-wikilink="T-0GV4-md-engine-line-endings-corpus" data-kind="note"
href="T-0GV4-md-engine-line-endings-corpus" data-path="T-0GV4-md-engine-line-endings-corpus">

Measured in the running SDF dashboard: nine such anchors on one task body, zero elements matching .is-unresolved or [class*=missing], and the ordinary link colour on all of them.

Two problems, one cause. The reader cannot tell a link that would resolve from one that never could — they look identical. And the href is a bare relative id, so clicking it navigates to a path that does not exist rather than doing nothing.

The theme already ships a .wikilink-missing style; nothing ever applies it. The wave-2 viewers were specified expecting exactly that (“resolveLink → missing”), so the gap is between the default resolver’s behaviour and what every host without a vault seam assumes it does.

Worth deciding as a renderer contract rather than patching per host: should the default resolver mark a link it cannot resolve as missing, and should an unresolvable target emit no href at all? Either answer wants the same test — a viewer with no NoteSource renders a wikilink that is visibly inert.

Found while shipping T-I4V6-sdf-entity-body-viewer and T-UQCN-suspenders-skill-body-viewer.

Partly closed there, host-side. Both viewers now pass a resolveLink that reports missing, so their wikilinks render with no href and the wikilink-missing treatment instead of looking live. That fixes the papercut without touching the renderer.

What remains is the contract question this item was filed for: a host that supplies no NoteSource at all still gets defaultResolver, which reports every target as an existing note and emits a bare relative href. Every future viewer host inherits that default and has to remember the same workaround. Worth deciding whether the default should be missing — or whether an unresolvable target should emit no href regardless of kind — and pinning it with a test that renders a wikilink through a viewer with no note source and asserts it is visibly inert.


← Back to Backlog