Wire `[[/` smart-tag autocomplete into the editor

Wire [[/ smart-tag autocomplete into the editor

#38 in Riparion/riparion-cms — merged 2026-06-02

What

Type [[/ in the post/page body editor → an inline popup of smart tags, filtered as you type. ↑/↓ select, Enter/Tab insert the snippet at the cursor (on its own line so it renders as an embed), Esc dismisses. This is the v2 of smart-tag insertion: the old flow appended the snippet to the end of the body; now it lands at the caret. Works in both Live and Raw modes.

Depends on Riparion/riparion-editor#4 (merged) — this PR bumps the pin to pick up the crate's new app-agnostic autocomplete capability.

How

  • Pin bump: cargo update -p riparion-editord819a14 (also pulls the already-merged dnd-rename/CI/example commits that were ahead of the old pin).
  • MarkdownPane supplies a complete callback that filters SMART_TAGS (case-insensitive on name/label) into the crate's CompletionItems; each item's insert is the literal [[/…]] embed snippet.
    • Live mode: passed to BlockEditor (complete + completion_*_class props); the crate owns the popup + key handling for the active block's textarea.
    • Raw mode: a local use_autocomplete(Some(complete)) drives the source textarea — wrapped in a position:relative div, with the same CompletionPopup. The autocomplete keydown gets first refusal so its ↑/↓/Enter/Tab/Esc don't also exit fullscreen or move the caret.
    • Popup styling reuses the existing "+ Smart tag" dropdown look (border-white/10 bg-[#0f1116], hover:bg-white/5), centralized in three AC_* consts.
  • The existing "+ Smart tag" dropdown is unchanged (still appends), kept as a discoverability affordance.

No new direct deps — the crate encapsulates all web-sys/DOM work and exposes only Dioxus-event APIs.

Verification

  • cargo fmt --check clean.
  • clippy -D warnings on server,sqlite + server,postgres (--all-targets) and wasm/web — all clean.
  • Manual steps recorded in TODO_VERIFICATION.md (Live + Raw: trigger/filter/Enter-Tab-Esc, click-to-pick, mid-paragraph own-line insert, dropdown regression).

🤖 Generated with Claude Code

Last updated 2026-06-03