Skip to content

feat(Block Editor): Restore internal dotCMS page search in the link popover - #492

Merged
jdcmsd merged 1 commit into
mainfrom
test/block-editor-page-search
Jun 17, 2026
Merged

feat(Block Editor): Restore internal dotCMS page search in the link popover#492
jdcmsd merged 1 commit into
mainfrom
test/block-editor-page-search

Conversation

@jdcmsd

@jdcmsd jdcmsd commented Jun 17, 2026

Copy link
Copy Markdown
Member

Closes #491

Proposed Changes

Restores feature parity with the legacy Block Editor by bringing internal dotCMS page search back to the Block Editor 2.0 link popover.

  • Page search in the URL field — replaced the plain URL text input with a PrimeNG p-autoComplete. Typing a partial title/path runs a debounced (250 ms) search and shows a dropdown of matching pages.
  • Reuses existing data-access — the search goes through DotContentSearchService from @dotcms/data-access (the same service the slash-menu drill-down uses); no new HTTP service. The Lucene query is built inline at the call site, mirroring the legacy editor (basetype:5 pages + URL-mapped content, matched by title/path/urlmap prefix).
  • Custom result template — each suggestion shows the contentlet name and its path, plus a thumbnail (/dA/{inode}) when available, with ellipsis truncation to fit the popover.
  • External URLs never blocked — when the value parses as a valid http(s) URL the overlay is suppressed entirely (no search, no empty message), so pasting/typing an external link works unchanged. Manual entry is always allowed.
  • Empty state — shows "No results found in dotCMS" when a search returns nothing.
  • Works in create and edit flows — selecting a result populates the link href; opening an existing link prefills the field without firing a spurious search.
  • Selection highlight while editing — in insert mode, focusing the URL input no longer hides which text will become the link: the target range is painted with a ProseMirror decoration that survives the input blur and is cleared when the popover closes.
  • Popover shell fix — whitelisted .p-autocomplete-overlay in the popover's click-outside handler so picking a suggestion (body-appended overlay) doesn't dismiss the popover.
  • rel select fix — the rel control now defaults to null instead of '', so PrimeNG's [showClear] no longer renders a stray "X" on the empty dropdown.

Checklist

  • Translations — added dot.block.editor.dialog.link.search.empty and updated the URL placeholder in Language.properties.
  • Security Implications Contemplated — no new endpoint; reuses the existing /api/content/_search. Query-term interpolation matches the legacy popover's behavior (search scoped to working/non-deleted content for the active language).

Additional Info

The search-result set (pages via basetype:5 plus URL-mapped content, scoped to the active languageId, working + non-deleted) reproduces the legacy link popover's behavior.


Mirrored from dotCMS#35907 for autodoc pipeline testing.

@claude

claude Bot commented Jun 17, 2026

Copy link
Copy Markdown

Claude finished @jdcmsd's task in 1m 56s —— View job


Claude PR Analysis

Note on the diff: the range cc26f60…85c5e0f contains a single placeholder commit (test: placeholder commit for PR #491 mirror) with 0 file changes. The doc object and rollback assessment below are therefore derived from the PR description and linked issue #491 (this PR is a mirror of dotCMS/core#35907 for autodoc pipeline testing). The epic lookup against dotCMS/dotcms-aios/work/epics returned 404 Not Found, so the epic field is omitted.


📄 Output A — Doc Object

📄 Doc Object Draft (attached to merge commit post-merge)
---
commit: PLACEHOLDER_SHORT_SHA
title: "feat(Block Editor): Restore internal dotCMS page search in the link popover"
type: feature
module: "Block Editor 2.0 / link popover"
customer_visible: yes
security_relevant: false
breaking_change: false
pr:
  primary: 492
release_notes:
  audience: customer
  priority: medium
  reasoning: "Restores a content-author-facing capability (internal page search when linking) that exists in the legacy editor but was missing from Block Editor 2.0."
provenance:
  generator: doc-object-skill
  model: claude-opus-4-8-20251001
  prompt_version: v0.1
  generated_at: 2026-06-17T15:40:03Z
  source_pr: 492
  source_diff_sha: PLACEHOLDER_FULL_SHA
---

What changed

The Block Editor 2.0 link popover's URL field is upgraded from a plain text input to a PrimeNG p-autoComplete. Typing a partial title or path runs a debounced (250 ms) internal page search and shows a dropdown of matching dotCMS pages — each suggestion renders the contentlet name, its path, and a /dA/{inode} thumbnail when available. Selecting a result populates the link href; manual entry of external http(s) URLs is preserved and bypasses the search overlay entirely. This restores feature parity with the legacy Block Editor link popover.

Why it matters

Authors composing content in Block Editor 2.0 previously had to paste raw URLs to link internal pages, losing the search-by-title/path workflow available in the legacy editor. This closes that parity gap before the new editor reaches customers, so authors retain the ability to find and link internal pages by typing rather than copying URLs.

Related

Closes #491 (Block Editor 2.0: restore internal dotCMS page search in the link popover). Reuses the existing DotContentSearchService (/api/content/_search) — the same data-access path used by the slash-menu drill-down — rather than introducing a new HTTP service. No new endpoint or API contract change.


🟢 Output B — Rollback Safety: Safe to Rollback

Assessed against every category in ROLLBACK_UNSAFE_CATEGORIES.md. No category matches:

Category Match? Reason
C-1 Structural data model · C-2 ES mapping · C-3 JSON model version · C-4 DROP table/column No runonce task, no SQL, no contentlet_as_json / ESMapping* changes. Frontend-only.
H-1 Data migration · H-2 rename · H-3 PK · H-6 drop proc · H-7 NOT NULL No database changes of any kind.
H-4 New field type No new Field subclass; the link popover consumes existing content via search.
H-5 Storage provider No StoragePersistenceProvider / metadata-version changes.
M-2 Push-publishing bundle format No *Bundler / *Handler changes.
M-3 REST / GraphQL API contract Per the PR, the feature reuses the existing /api/content/_search with no contract change. The Lucene query is built client-side; response shape is unchanged.
M-4 OSGi plugin API No exported-interface signature changes.

This is a pure Angular/PrimeNG UI change in libs/new-block-editor/.../link-popover/ (text input → p-autoComplete, a ProseMirror selection decoration, a click-outside whitelist fix, and a rel-default tweak), plus a Language.properties translation key. After a rollback to N-1, the older frontend bundle simply renders the previous plain URL input — no data is transformed, no schema or index is mutated, and the reused search endpoint is unaffected. Label applied: AI: Safe To Rollback.
· test/block-editor-page-search

@jdcmsd
jdcmsd merged commit d550c25 into main Jun 17, 2026
21 of 22 checks passed
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.

Block Editor 2.0: restore internal dotCMS page search in the link popover

1 participant