Repository navigation
Description
Verdict
Add a hovercard on the docs.plus pad (desktop) when the pointer rests on a link. Keep today's click preview toolbar. Mobile keeps the tap sheet.
@docs.plus/extension-hyperlink must not gain hovercard DOM, hovercard CSS, or a prebuilt fallback card. It must not call a URL. Slice 1 is host-only.
Hovercard is the product name (so it does not collide with preview). It is not a new word in extensions/README.md §Vocabulary. The content is read-only host UI, not a toolbar.
Headless (hard constraint)
The published packages own schema, commands, URL decisions, and pointer plugins. They do not own product chrome for this feature.
Be exact about today's package: it ships prebuilt preview / create / edit factories and styles.css. Click preview does not auto-mount them. popovers.previewHyperlink defaults to null. The click handler stores that slot as-is and opens nothing when it is null. Create and edit openers still fall back to the prebuilt factory when the slot is null. A factory that returns null is the real opt-out.
So "opt-in" is true for click preview only. It is false for create / edit commands. Hover must copy the click-path rule, not the opener ?? fallback.
Do not add a fourth prebuilt popover. Do not add hovercard rules to styles.css. Do not ship a hostname chip from the package. getSpecialUrlInfo may inform a host card. It is not a reason to draw one in the npm tarball.
A later package hook is allowed only if it is a factory slot (or an event) with default null and no prebuilt fallback. Slice 1 does not need that hook. Do not call openPreviewHyperlink on hover. That opener hardcodes kind 'preview' and falls back to the prebuilt toolbar.
Problem
Preview already names the click toolbar and the mobile sheet. That surface is copy, edit, remove, plus a title when the host has metadata. There is no hover path.
Hover and click are different jobs. One shared UI copies Google Docs' noisy stack.
A published extension cannot scrape Open Graph data. docs.plus already has GET /api/metadata. Other hosts stay blank until they bring their own card.
Touch devices have no hover. The pad mobile sheet already shows title, description, and actions on tap.
Related work that is not this issue: #174 (internal-link chip copy) and #146 (URL decision pipeline).
Decision
Two species, two names:
- Preview — click or tap. Action toolbar or sheet. Already shipped.
- Hovercard — desktop pad only. Read-only page context. Headed host UI. New.
Click, create, and edit win. Opening those surfaces destroys the hovercard. Hover leave must close only the hover instance. A blind close() tears down create / edit.
The first shippable slice is the docs.plus pad on desktop. Do not change the package to ship slice 1.
Slice 1 host rules (required)
Host-only is shippable. The shared controller already accepts a custom kind. These gaps must stay in the spec:
- Kind. Adopt a host kind (for example
'hovercard'). Do not reuse'preview'. Do not callopenPreviewHyperlink. - Pad-only plugin. Attach hover to the pad editor DOM. Desktop composer uses the same
previewHyperlinkfactory. A shared wrap would leak hover into the composer. - Dual gate.
!settings.editor.isMobileand(pointer: fine). Pointer alone is not desktop. Host mobile is UA-gated (getDeviceInfo/mobile-detect). Viewport resize is not mobile. iPad is the mobile shell, even with a mouse. Slice 1: no hovercard there. - Hover-bridge. The pointer must be able to enter the card. A gap between the link and the card must not dismiss it at once.
- Leave. Close only when the mounted kind / element is the hover instance. Do not idle-sync the React create / edit portal by mistake.
- Display-only. Read L1 / L2 / L3 for paint. Do not
flush()mark attrs from hover. Click preview stays the Yjs write path. A passer-by must not edit the room by resting the pointer. - Fetch discipline. Debounce. Pass
AbortSignal. Abort on leave and on click-wins. Do not fetch on everymouseenter. Reuse L2.fetchMetadatahas no in-flight coalesce today; a hover herd can hit L3 N times for one cold URL. Host must not do that. Metadata shares the global REST limiter.
Extension (@docs.plus/extension-hyperlink)
Headless core stays as it is. Honest data the package already exposes (host reads, host paints):
- stored mark
href(not the resolved DOMlink.href) getSpecialUrlInfo—mailto:,tel:, catalog type- mark attrs
title/imageonly if a host wrote them earlier
If we extract a hook after slice 1, match the click-preview slot (no opener fallback):
// HyperlinkOptions — default null, no prebuilt fallback
popovers: {
// existing slots unchanged
hovercard?: ((options: HovercardOptions) => HTMLElement | null) | null
}null / omitted means no hover UI. A factory that returns null opts out. Do not nest this under popovers.previewHyperlink.
A new optional null slot is a minor. A prebuilt hovercard fallback, or default-on hover, is a breaking product change.
Rules if a hook lands later:
- Host factory owns delay, chrome, fetch, and the hover-bridge.
- Package plugin may gate
(pointer: fine)the same way click owns pointer events. HostisMobilestill wins in docs.plus. - Distinct popover kind from
preview. The engine is one-shot: afterhide(), rebuild. - Do not write mark attrs on hover.
- Do not mount an
aria-liveregion inside.ProseMirror.
docs.plus host
This is the headed consumer. Reuse the existing metadata pipeline. No new REST route.
- L1 — mark attrs
title/image(read only on hover) - L2 — 5-minute session cache in
fetchMetadata - L3 —
GET /api/metadata?url=
Do not force the house envelope onto this route. That is settled.
Internal means same document: exact slug and same origin. Cross-doc docs.plus URLs stay external and may hit metadata. That is intended. Chip copy stays on #174.
First slice: pad desktop only.
- Composer desktop: skip.
- Pad mobile and composer mobile: unchanged.
Failed fetch degrades to href as title. safeImageSrc allows http(s) only.
Mobile
No hover. Keep tap → pad linkPreview sheet and composer preview dialog.
Do not add long-press. Tap already opens the sheet.
Composer must not call pad dismissSoftKeyboard. That rule stays.
If we later want "preview before open" on mobile, put title and description inside the existing sheet.
Keyboard
Click preview stays the accessible path for v1. Hover-only facts are not enough. Tab / :focus-visible plus the existing click preview must work without hover.
A GitHub-style shortcut (focus the link, then Option+↑) can wait.
What this is not
- A prebuilt hovercard in the npm package
- Hovercard rules in package
styles.css - A zero-network chip drawn by the extension
- Calling
openPreviewHyperlinkon hover - Writing Yjs mark attrs from hover (
flush) - Hover on the iPad / mobile shell
- Treating a narrow desktop window as mobile
- Slack or Discord message unfurl as an editor block
- Client scrape of arbitrary pages from the npm package
- Replacing click preview with hover
- Forcing the house envelope onto
/api/metadata - Renaming the
hyperlinkmark - A second
HyperlinkPopoverPortalin the composer - Adding card as a fifth house vocabulary word
Why this shape
- GitHub: hovercard for context; click navigates. Keyboard: Option+↑.
- Google Docs: hover details plus a click chip. Users often disable the hover.
- Notion: rich hover on mentions; mobile has no hover.
- TipTap: hosts bring UI.
@tiptap/extension-linkships no hovercard. - This package: click preview is opt-in. Create / edit commands still use prebuilt UI when the slot is empty. Hover follows the click-preview rule.
- Chat unfurl is the wrong editor pattern.
Suggested slices (not filed as tickets)
- Pad desktop hovercard in the webapp. No package change. Proves delay, click-wins, hover-bridge, abort, and display-only.
- Optional
popovers.hovercardslot, defaultnull, no prebuilt fallback. Only if another host needs the same pointer plugin. - Composer desktop later, only if pad hover is wanted.
Acceptance criteria
- Product copy uses hovercard for hover and preview for click / tap
- Pad desktop shows a delayed hovercard on external links via L1 → L2 → L3
- Same-document links skip OG; cross-doc docs.plus URLs may fetch
- Click preview, create, and edit evict the hovercard
- Hover leave closes only the hover instance
- Hover uses a distinct controller kind; it does not call
openPreviewHyperlink - Hover is pad-only; desktop composer does not show it
- Hover requires
!isMobileand(pointer: fine) - Pointer can enter the card (hover-bridge)
- Hover does not write mark attrs
- Fetch uses debounce +
AbortSignal; leave / click-wins abort - Slice 1 adds no hovercard DOM, CSS, or prebuilt factory to the package
- Any later package slot defaults to
nulland has no prebuilt fallback - Mobile tap sheet is unchanged; no long-press path
- No live region inside
.ProseMirror - Composer mobile still does not call pad
dismissSoftKeyboard
Alternatives considered
- Hover opens today's preview toolbar. Rejected. Preview is an action toolbar.
- Rich card, or a hostname chip, inside the npm package. Rejected. Chrome for this feature belongs to the host.
- Prebuilt hovercard fallback when the slot is empty. Rejected. Copy the click-preview
nullrule, not the create / edit opener fallback. - Defer L1 write on hover (same as click). Rejected for hover. Defer only stops write-while-open. It still stamps Yjs after the first rest. Hover is display-only.
- Host-only forever, no package hook. Correct for slice 1.
- Inline unfurl block (Slack / Discord). Rejected.
Adviser pass (2026-09-06)
Checked against the package, floating-popover, webapp popovers, metadata module, and mobile UA gate. Kept: L1–L3 reuse, no house envelope, no package fetch, click-preview null rule, host-only slice 1. Fixed: create / edit are not opt-in; "card" is not house vocabulary; hover must not call openPreviewHyperlink; dual desktop gate; hover-bridge; display-only write rule; abort / herd; same-document internal.
Blocked by
None — can start after this RFC is accepted.
Activity
HMarzban commentedon Sep 6, 2026
Correction from review: the published extensions are headless.
The first draft treated a zero-network hostname chip as something the package could ship. That was wrong. Schema, commands, URL decisions, and pointer plugins stay in
@docs.plus/extension-hyperlink. Product chrome does not.Hover now follows the click-preview slot rule:
nullmeans no UI, and there is no prebuilt fallback. Slice 1 is docs.plus host-only. The issue body is updated.HMarzban commentedon Sep 6, 2026
Adviser pass (extension contract, host slice 1, interaction / mobile, metadata / safety). Claims were checked against the tree, then this body was updated.
Kept. Click preview is
nullunless the host wires a factory. The package has no fetch client. Slice 1 can stay host-only. L1–L3 and the house-envelope skip are real.Fixed in the body.
null. Hover must copy the click rule, not that fallback.openPreviewHyperlinkon hover. That opener is kind'preview'and can fall back to the prebuilt toolbar.!isMobileand(pointer: fine). iPad is the mobile shell.flush()Yjs from hover. Click preview stays the write path.HMarzban commentedon Oct 26, 2026
Maintainer ruling, 2026-10-26
The maintainer accepted this RFC and moved it to milestone v2.3.0. The answers below came through a multiple-choice prompt in the agent session. Each one is the option the maintainer picked.
Hovercard
http(s)links get a hovercard. Same-document links,mailto:,tel:and app schemes get none. Cross-document docs.plus links do get one.og:image) when it has one, then the site icon and host, the title and the description. Mock: variant A plus the social image. The image loads through our own server, like link icons, so the linked site never sees the reader. It is hidden when it fails.One cache for hover and click
titleorimage, as the Stop link preview metadata writes from reaching every peer #519 ruling (2026-10-18) already says for every preview.fetchMetadata.ts), keyed by URL. Callers of one URL share one request.Server metadata fetch (added to this issue's scope)
facebookexternalhit/1.1in its User-Agent. Every outbound metadata request names docs.plus only. Sites that let in only Meta's crawler will show the plain link card. This overturns the old line inapps/hocuspocus.server/CLAUDE.md.GET /api/metadata, 10 times the base limit, like the link-icon route. Hover traffic can then never 429 the pad's own REST calls.The measured baseline and the full design are kept in the maintainer's local notes. Measured with an honest User-Agent on 30 public URLs: 23 useful cards, 16 with title, description and a real image, p50 669 ms, p95 1416 ms. The 5 hard failures are bot walls (403 or a JavaScript challenge). No honest change fixes those.
HMarzban commentedon Oct 27, 2026
Maintainer ruling update, 2026-10-26
The maintainer ran an architecture review of the hyperlink feature (the extension, its webapp host and the link-metadata API), then a grilling round. The answer was "all recommended" to every question. Each line below is the accepted recommendation.
Privacy and the proxy rule
GET /api/metadata/image. YouTube thumbnails and older saved previews stay direct./privacyis rewritten to say exactly what the code does, including what still loads straight from other sites: embedded players, pasted media links and GIPHY.Link forms and editing
Name
/privacyandCONTEXT.mduse it.Server
#fragmentleaves the server cache key. The cache key prefix moves tometa:v2in the same deploy. The icon and image routes share one image fetch, and the image route sendsVary: Accept-Language.Rust
CLAUDE.mdSettled list.HTMLRewriteris filed as Replace metascraper with an HTMLRewriter head extractor #644.Filed for later (v2.4.0)
HTMLRewriterextractor.nocookiedefault is already tracked in [Idea]: Launch-legal and listing compliance backlog #241 (Phase 2), so it was not filed again.HMarzban commentedon Nov 1, 2026
Build update, 2026-11-01
The hovercard is built and reviewed on local
main. It is not pushed or deployed yet, so this issue stays open until the deploy.The extension (
@docs.plus/extension-hyperlink, release 2.3.0 owed)hovercardoption shows a read-only card when a mouse pointer rests on a link. The host'sfetchMetadatareturns the title, description and picture.siteIcon,shouldShowandimageLayout('cover'or'adaptive') are optional.hovercard.cssstyles the card through--hl-*tokens.navigate(href, { newTab })option.newTabistrueonly for Mod or the middle button. So a plain open of another pad can route in place (RFC: should a link to another docs.plus pad open in the same window? #359).role="dialog", named "Link preview".The pad
padHovercardwithimageLayout: 'cover'. All card data comes through our server. The phone, chat, history and/editorget no card, and neither does a link to a part of this pad.The server
HTMLRewriterscraper, not metascraper. The worst crafted page now takes 39.5 ms at 1 MiB on one laptop.</head, and the scraper reads no body rule. So one page always gives the same card, which matters because the card is cached for 24 h.GET /api/metadata/image.Still owed
HMarzban commentedon Nov 3, 2026
Refactor round, 2026-11-03. Ten commits on local
main(ceb853258..be63d2138), not pushed yet. Behaviour stays the same, except for three small changes that make two rules agree:Also in the round:
hasModis a new root export of the extension.The remaining structure items are tracked in #678.
fix(extension-hyperlink): accept only one whole link, keep a link's c…
33 remaining items
fix(extension-hyperlink): refuse a file name that hides an address
docs: show pasted link titles in the demo
docs: keep the extension link in the demo plain
fix(extension-hyperlink): refuse an email title on another domain
docs(webapp): give the command for the manual paste-title test
feat(link-metadata): look up an archived copy of a page
feat(extension-hyperlink): add the Use page title action
feat(webapp): add page-title and archive actions to link cards
docs: align the link docs with the shipped code
HMarzban commentedon Nov 4, 2026
Status, 2026-11-04. The earlier "not pushed yet" note is out of date. The work is on
mainin4e1aca058, and deploy run41854096960shipped it.Left:
feat(webapp): explain a /new link before it opens
HMarzban commentedon Nov 6, 2026
Closed by maintainer ruling, 2026-11-06. The desktop hovercard RFC is built and deployed. The follow-up issues keep their own close gates: #680, #681, #682, #683, #689, #692, #693 and #694 (production checks and the extension 2.3.0 publish), and #174. They stay open on their own.
fix(extension-hyperlink): give customValidator the stored link
fix(skills): flag release-note entries that share an issue