Skip to content

Add content search to the editor link input - #3235

Merged
ascorbic merged 3 commits into
emdash-cms:mainfrom
swissky:feat/editor-link-picker
Sep 21, 2026
Merged

ascorbic merged 3 commits into
emdash-cms:mainfrom
swissky:feat/editor-link-picker

Conversation

@swissky

@swissky swissky commented Sep 21, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Adds an internal link picker to the rich text editor, as proposed in Discussion #3177 (Layer 1). The link popovers (toolbar and bubble menu) replace the plain URL input with a combined destination field, modeled on WordPress's link control:

  • Typing plain text searches existing entries by title across all searchable, routable collections and lists them below the field. Typing anything URL-like (scheme, path, anchor, domain) behaves exactly as before.
  • Picking a result inserts the entry's public URL resolved from the collection's urlPattern, including locale prefixes and date tokens (the entry is fetched on demand only for date-token patterns). Entries whose URL needs a publish date can't be picked until they are published — the picker explains why instead of baking a broken {year} href into the content.
  • Editors with content:read_drafts also find drafts, marked with the standard status badge.

Two additive core changes support this:

  • The search API and the search()/searchCollection() helpers gain a scope=title option that restricts the FTS5 match to the collection's title column, so body-text matches don't surprise authors picking a link target. Queries containing FTS5 operators are always term-quoted under this scope so no clause can escape the column filter (covered by a regression test).
  • The auth middleware resolves the session on GET /_emdash/api/search, so status=draft honors the content:read_drafts permission instead of silently falling back to published results. Anonymous requests skip the session lookup entirely and stay on the zero-query hot path (covered by a unit test asserting no user lookup happens without a session cookie).

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Cursor + Claude Fable 5

Screenshots / test output

Searching "team" in the link popover lists matching entries by title, with the first result pre-highlighted for Enter:

Link popover in the editor showing a search input with "team" and one result, the Team page, highlighted below it

Drafts are listed for editors with draft access and marked with the standard status badge:

Link popover showing the search "upcoming" with one result, the draft post Upcoming Announcement, carrying a Draft badge

Picking a result inserts the entry's resolved public URL as the link:

Editor content with the selected text now underlined as a link to /pages/team, and the bubble menu showing the active link state

The rich text editor's link popovers get a combined destination field:
plain text searches entries by title across collections, URL-like text
behaves as before. Picking a result inserts the entry's public URL
resolved from the collection's urlPattern, including locale prefixes and
date tokens. Drafts appear for users with draft access and are marked;
entries whose URL needs a publish date can't be picked until published.

Supporting core changes: the search API gains an additive scope=title
option that restricts FTS5 matching to the collection's title column
(operators are always term-quoted there so clauses can't escape the
column filter), and the auth middleware resolves the session on
/_emdash/api/search so status=draft honors content:read_drafts.
Anonymous search requests stay on the zero-query path.
@changeset-bot

changeset-bot Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 55a4aef

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@emdash-cms/admin Minor
emdash Minor
@emdash-cms/cloudflare Minor
@emdash-cms/plugin-test Patch
@emdash-cms/sandbox-workerd Patch
@emdash-cms/auth Minor
@emdash-cms/blocks Minor
create-emdash Minor
@emdash-cms/gutenberg-to-portable-text Minor
@emdash-cms/x402 Minor
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the review/needs-review No maintainer or bot review yet label Sep 21, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/admin@3235

@emdash-cms/auth

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/auth@3235

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/auth-atproto@3235

@emdash-cms/blocks

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/blocks@3235

@emdash-cms/cloudflare

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/cloudflare@3235

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/contentful-to-portable-text@3235

emdash

npm i https://pkg.pr.new/emdash-cms/emdash@3235

create-emdash

npm i https://pkg.pr.new/emdash-cms/emdash/create-emdash@3235

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/gutenberg-to-portable-text@3235

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/plugin-cli@3235

@emdash-cms/plugin-test

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/plugin-test@3235

@emdash-cms/plugin-types

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/plugin-types@3235

@emdash-cms/registry-client

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/registry-client@3235

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/registry-lexicons@3235

@emdash-cms/registry-loader

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/registry-loader@3235

@emdash-cms/registry-moderation

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/registry-moderation@3235

@emdash-cms/registry-verification

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/registry-verification@3235

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/sandbox-workerd@3235

@emdash-cms/x402

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/x402@3235

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/plugin-ai-moderation@3235

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/plugin-atproto@3235

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/plugin-audit-log@3235

@emdash-cms/plugin-color

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/plugin-color@3235

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/plugin-embeds@3235

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/plugin-field-kit@3235

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/plugin-forms@3235

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/emdash-cms/emdash/@emdash-cms/plugin-webhook-notifier@3235

commit: 55a4aef

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR implements the approved Discussion #3177 Layer 1 feature well: the editor link popover becomes a combined URL/search field, with additive scope=title and search-auth changes. The approach fits EmDash — additive defaults, no schema or API breaks, tests are included, and the changesets describe user-facing behavior.

I checked the diff, the core search/query/route/auth code, the new admin component, the existing URL helpers, and the new/updated tests. Overall the code is solid and well-localized. I found two real issues that should be fixed before merge:

  1. Draft date-token entries can still be linked — LinkDestinationInput only rejects entries whose publishedAt is missing, so a draft that carries a publish date (e.g. a previously-published entry returned to draft, or a scheduled draft that stores the date before publish) can still be inserted. The PR explicitly says such entries can’t be picked until published.

  2. Misleading middleware comment — auth.ts claims “Anonymous requests skip the session lookup entirely,” but the code runs handlePublicRouteAuth/resolveSessionUser(session) for every GET /_emdash/api/search. Anonymous requests skip the user DB lookup, not the session read. A false claim about the logged-out hot path is the kind of comment that misleads future maintainers.

A smaller suggestion: the domain-like heuristic is broad enough to classify ordinary dotted phrases (e.g. react.js) as URLs, which may surprise authors searching for titles containing file extensions or abbreviations.

Tests are generally good; I’d just add a draft-with-publishedAt regression case once the status guard is in place.


Findings

  • [needs fixing] packages/admin/src/components/editor/LinkDestinationInput.tsx:158-165

    The date-token guard only checks whether publishedAt exists. A draft can still carry a publish date (scheduled posts, or an entry that was published and then reverted to draft), in which case the picker will insert a dated public URL even though the entry is not published. That contradicts the stated behavior that “entries whose URL pattern needs a publish date can’t be picked until they are published.”

    The fetched entry is already in scope inside the try block, but its status is never inspected. The existing test only covers publishedAt: null; it should also cover a draft with a publish date.

    			let date: string | null | undefined;
    			let entry: ContentItem | undefined;
    			try {
    				entry = await fetchContent(item.collection, item.id, { locale: item.locale });
    				date = entry.publishedAt;
    			} catch {
    				return null;
    			}
    			if (entry?.status !== "published" || !date) return null;
    
  • [needs fixing] packages/core/src/astro/middleware/auth.ts:198-203

    This comment claims that anonymous requests “skip the session lookup entirely and stay on the zero-query hot path,” but the branch immediately above runs handlePublicRouteAuth, which always calls resolveSessionUser(session). Anonymous callers skip the user DB lookup (getUserById), not the session read. On a route the AGENTS.md calls part of the logged-out hot path, a false claim about how many lookups happen is a real maintenance hazard.

    		// Search filters drafts by permission, so resolve the session user when
    		// one exists. Bearer tokens are not resolved on public routes; token
    		// callers continue to receive published results only.
    
  • [suggestion] packages/admin/src/components/editor/LinkDestinationInput.tsx:39

    DOMAIN_LIKE is broad enough to treat many non-domain dotted strings as URLs, such as react.js or config.yml, which would be rejected as search queries even when they appear in a page title. Consider narrowing the heuristic (e.g. requiring a more domain-looking shape on the right side of the dot) or documenting that titles containing dots should be URL-escaped/pasted.

@github-actions

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 1,280 lines across 16 files. Large PRs are harder to review and more likely to be closed without review.

If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs.

See CONTRIBUTING.md for contribution guidelines.

@emdashbot emdashbot Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-review No maintainer or bot review yet labels Sep 21, 2026
A draft can still carry a publish date (scheduled entries, or entries
unpublished after a release), so the picker now checks the entry status
before resolving a dated URL instead of only checking that a date
exists. Also corrects the search middleware comment: anonymous callers
skip the user DB lookup, not the session read.
@swissky

swissky commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

Both findings addressed in 96d8c6b:

  1. Date-token drafts with a publish date: resolveHref now requires entry.status === "published" in addition to a publish date before resolving a dated URL, so scheduled entries and unpublished-after-release drafts are refused like undated drafts. Added the suggested regression case (draft carrying a publish date).

  2. Middleware comment: reworded as suggested — anonymous callers skip the user DB lookup, not the session read.

On the DOMAIN_LIKE suggestion: I'd like to keep the heuristic as is. It only applies to single-token dotted input (anything with a space is always treated as a search), and any shape that still recognizes example.com also matches vue.js — the right side of the dot is indistinguishable from a TLD. Searching for a dotted title still works by typing any other part of it, while failing to recognize a pasted bare domain would insert a broken relative href with no recovery hint. Happy to revisit if authors report friction.

@swissky swissky added the bot:review Trigger an emdashbot code review on this PR label Sep 21, 2026
@github-actions github-actions Bot added review/needs-rereview New commits since the last review and removed review/awaiting-author Reviewed; waiting on the author to respond labels Sep 21, 2026

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a re-review of PR #3235. The two blocking issues from the previous review are now fixed, and the regression test coverage for the date-token draft case is in place.

  • Draft date-token guard is now correct. LinkDestinationInput now checks entry.status !== "published" || !date before resolving a date-token URL, so a draft that still carries a publishedAt cannot be linked. A regression test covers this explicitly.
  • Middleware comment is now accurate. auth.ts no longer claims that anonymous requests skip the session lookup entirely; it correctly describes that the user DB lookup is skipped for anonymous callers while the session is still resolved when present.

The approach still fits EmDash well: additive scope/auth changes, no schema break, localized UI strings, RTL-safe classes, tests for the new component and integration paths, and useful user-facing changesets. I read the updated admin component, the middleware/search route changes, the core query changes, and the new/updated tests.

I have one remaining low-confidence suggestion: the looksLikeUrl domain-like heuristic remains broad enough to classify common file-extension phrases (e.g. react.js, config.yml) as URLs, which can surprise authors searching for titles containing those strings. It's a UX edge case, not a blocker.

import { apiFetch, fetchContent, fetchManifest, throwResponseError } from "../../lib/api";
import type { ContentItem } from "../../lib/api";
import { useDebouncedValue } from "../../lib/hooks";
import { contentUrl } from "../../lib/url.js";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] DOMAIN_LIKE is broad enough to treat ordinary dotted phrases as URLs, so titles containing file extensions or dotted abbreviations can be misclassified and won't be searched. For example, react.js or config.yml match /^\S+\.\S{2,}$/ even though an author may be searching for a page with exactly that title.

Consider narrowing the heuristic (e.g. requiring a TLD-like right-hand side) or adding a comment documenting that titles containing dots should be URL-escaped/pasted. If this trade-off is intentional and acceptable, feel free to leave it as-is.

Suggested change
import { contentUrl } from "../../lib/url.js";
const DOMAIN_LIKE = /^\S+\.[a-z]{2,}$/i;

@emdashbot emdashbot Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed bot:review Trigger an emdashbot code review on this PR review/needs-rereview New commits since the last review labels Sep 21, 2026
Bare domain-like input (vue.js, example.com) is ambiguous between a
pasted host and a dotted title, so it now searches too instead of being
classified as a URL outright. For such input no result is pre-highlighted:
Enter still applies the text as a link target, while arrow keys or a
click select a result explicitly. Scheme- or path-like input keeps
search disabled as before.
@swissky

swissky commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

Took the DOMAIN_LIKE suggestion after all, with a dual-affordance middle ground in 55a4aef rather than narrowing the regex (any shape that still accepts example.com also matches vue.js): bare domain-like input now searches too, but no result is pre-highlighted there — Enter keeps applying the typed text as the link target, while arrow keys or a click select a result explicitly. Scheme- and path-like input still disables search entirely. Covered by two new tests (Enter stays on the raw text; arrowing into the list picks the result).

@swissky swissky added the bot:review Trigger an emdashbot code review on this PR label Sep 21, 2026
@github-actions github-actions Bot added review/needs-rereview New commits since the last review and removed review/awaiting-author Reviewed; waiting on the author to respond labels Sep 21, 2026

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a re-review of PR #3235. The approach remains sound: the link picker is a focused, additive UI feature supported by scope=title and the auth middleware fix, with no schema break and good test coverage.

I checked the updated LinkDestinationInput, the auth.ts middleware path for /_emdash/api/search, the core search/query.ts title-scope SQL, the route integration, the new/updated tests, the changesets, and the API docs.

The two previously blocking issues are fixed:

  • The date-token draft guard in LinkDestinationInput now rejects any entry whose status !== "published" or that lacks a publish date, with a regression test covering the stale-date draft case.
  • The auth.ts comment accurately describes that anonymous callers skip the user DB lookup; session resolution only triggers the user lookup when a session cookie is present.

Lingui wrapping and logical Tailwind classes are correct in the admin component. The FTS5 title-scope SQL validates the column identifier, parameterizes the query, and disables operators so the column filter can't be escaped. Locale filtering, existing API envelope shape, and changeset quality all look good.

The only concern from the previous review—the broad DOMAIN_LIKE heuristic misclassifying some dotted phrases as URLs—still exists, but the code now documents it as a deliberate trade-off and it is low-impact UX, not a correctness issue. Clean otherwise.

@emdashbot emdashbot Bot added review/approved Approved; no new commits since and removed bot:review Trigger an emdashbot code review on this PR labels Sep 21, 2026
@emdashbot emdashbot Bot removed the review/needs-rereview New commits since the last review label Sep 21, 2026
@swissky
swissky requested a review from ascorbic September 21, 2026 09:39

@ascorbic ascorbic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ascorbic
ascorbic merged commit 808f473 into emdash-cms:main Sep 21, 2026
61 checks passed
kwmr added a commit to kwmr/emdash that referenced this pull request Sep 21, 2026
Rebasing onto main brought in the link destination search (emdash-cms#3235), whose
`onPick` path sets a link mark directly. With an image selected that is
the wrong target: the mark goes nowhere and the image keeps its old
link, so picking an entry silently does nothing.

Both link controls now route every image link write through one
`setSelectedImageLink` helper, including the new pick path. That also
removes the duplicated "keep the blank flag" logic the emdash-cms#704 review
flagged in the toolbar and the bubble menu.

Tests: picking an entry with an image selected sets the image's link and
leaves text marks alone, and keeps an existing `blank`. The two existing
image link tests now address the destination field by its combobox role,
since emdash-cms#3235 replaced the plain URL input.

Co-Authored-By: Claude <[email protected]>
ascorbic added a commit that referenced this pull request Sep 25, 2026
* feat(admin): optional link on portable-text image blocks

Adds an optional `link: { href; blank? }` on portable-text image blocks,
round-tripped through the PT ↔ PM converters. The existing editor Link
buttons (main toolbar and bubble menu) now operate on image selection:
selecting an image and clicking Link opens the URL popover pre-populated
with the image's current link, and apply/remove updates the image node's
attrs. `Image.astro` wraps the rendered `<img>` in an `<a>` using
`sanitizeHref()` when `link.href` is set. `ImageDetailPanel` gains a
Link URL input and an "Open in new tab" checkbox as a secondary editing
surface.

Split from #679 per review; see discussion in that PR.

* fix(admin): keep an image link's blank flag when its URL is edited

Follow-up to the #704 port. Editing an image link's URL from the toolbar
or bubble menu replaced the whole `link` object, so an existing
`blank: true` ("open in new tab") was silently dropped. The existing
choice is now carried over.

`ImageDetailPanel` only includes `link` in its update payload when a link
is being set or an existing one cleared, so images without links keep the
same payload as before.

Adds tests for the panel's link fields and for the toolbar edit keeping
`blank`.

Co-Authored-By: Claude <[email protected]>

* fix: normalise legacy image links, resync panel link fields, keep anchors same-tab

Addresses the three review findings on #3167.

Legacy link shape: `gutenberg-to-portable-text` emits `link: "https://…"`
(a bare string) for linked images, so WordPress-imported content carries
that shape while the editor writes `{ href, blank? }`. The converters and
`Image.astro` read `link.href` directly, which silently dropped the link
on imported posts. A shared `normalizeImageLink()` now accepts both
shapes; the PT type, `Image.astro`, the PT→PM converter and the admin
editor go through it, so a legacy string renders and is upgraded to the
object shape on its next round-trip. The WordPress URL rewriter handles
both shapes too (it previously assumed a string). Admin has no dependency
on the core package, so it carries a small mirror of the helper.

Panel resync: `ImageDetailPanel`'s node-switch effect reset every field
except `linkHref`/`linkBlank`, leaving the previous image's link in the
form. Both are now reset with the rest.

Same-page anchors: `Image.astro` honoured `blank` unconditionally, unlike
`marks/Link.astro`, which never opens `#section` links in a new tab. The
image wrapper now mirrors that rule.

Tests: unit coverage for `normalizeImageLink` and the legacy-string
round-trip, URL rewriting for both link shapes, Astro render cases for
new-tab / same-page-anchor / legacy-string links, and the panel resync
test now covers the link fields.

Co-Authored-By: Claude <[email protected]>

* fix(admin): let the inline bubble menu open on a selected image

The bubble menu's `shouldShow` only admitted `TextSelection` and
`AllSelection`. A selected image is a `NodeSelection`, so the image
branches of the menu's link handling (added with the image link
feature) were never reachable: selecting an image never showed the
menu at all.

`shouldShow` now also admits a `NodeSelection` whose node is an image.
When the selection is an image, the menu renders only the link
control; the text-mark buttons (bold, italic, …) are meaningless on an
image and are hidden.

Adds bubble-menu tests for a selected image: the menu appears with the
link control only, applying a URL sets `link`, editing the URL keeps
`blank`, and Remove link clears it.

Co-Authored-By: Claude <[email protected]>

* fix(admin): link the selected image when a search result is picked

Rebasing onto main brought in the link destination search (#3235), whose
`onPick` path sets a link mark directly. With an image selected that is
the wrong target: the mark goes nowhere and the image keeps its old
link, so picking an entry silently does nothing.

Both link controls now route every image link write through one
`setSelectedImageLink` helper, including the new pick path. That also
removes the duplicated "keep the blank flag" logic the #704 review
flagged in the toolbar and the bubble menu.

Tests: picking an entry with an image selected sets the image's link and
leaves text marks alone, and keeps an existing `blank`. The two existing
image link tests now address the destination field by its combobox role,
since #3235 replaced the plain URL input.

Co-Authored-By: Claude <[email protected]>

* fix(admin): name the toolbar link button "Image link" while an image is selected

The toolbar link button already switched its tooltip to "Image link"
when an image is selected, but its accessible name stayed "Insert Link",
so screen reader users heard a different label from the one shown.
The aria-label now follows the same condition as the tooltip.

The three tests that open the link control with an image selected now
locate the button by the exact name "Image link", so they fail if the
two drift apart again.

Co-Authored-By: Claude <[email protected]>

* fix(admin): keep image link controls reachable

* fix(core): relativize portable image link objects

---------

Co-authored-by: Nicholas Penree <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Matt Kane <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants