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-editor→d819a14(also pulls the already-merged dnd-rename/CI/example commits that were ahead of the old pin). MarkdownPanesupplies acompletecallback that filtersSMART_TAGS(case-insensitive onname/label) into the crate'sCompletionItems; each item'sinsertis the literal[[/…]]embed snippet.- Live mode: passed to
BlockEditor(complete+completion_*_classprops); 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 aposition:relativediv, with the sameCompletionPopup. 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 threeAC_*consts.
- Live mode: passed to
- 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 --checkclean.- clippy
-D warningson 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
Links to this note
Merged pull requests, newest first.