From 49443ad16ab09f593d6c567b73a48af5aa42dd32 Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 29 Apr 2026 16:21:33 +0200 Subject: [PATCH] docs(PersonMentionEditor): document client-side fetch exception inline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per Markus #5616, the leaf-component fetch in the Tiptap suggestion plugin violates the project-wide rule from frontend/CLAUDE.md ("Data flows from +page.server.ts via props — never client-side API fetch"). Add an inline block-comment explaining why this exception is justified (suggestion runs client-side per keystroke; same auth surface; no server-side reshape benefit) and points future readers at the open ADR follow-up plus Nora's PersonSummaryDTO response-shape audit. Co-Authored-By: Claude Opus 4.7 --- .../src/lib/components/PersonMentionEditor.svelte | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/frontend/src/lib/components/PersonMentionEditor.svelte b/frontend/src/lib/components/PersonMentionEditor.svelte index 81a9f8fd..3a9188c1 100644 --- a/frontend/src/lib/components/PersonMentionEditor.svelte +++ b/frontend/src/lib/components/PersonMentionEditor.svelte @@ -123,6 +123,20 @@ onMount(() => { }, suggestion: { char: '@', + // ───────────────────────────────────────────────────────────── + // EXCEPTION to frontend/CLAUDE.md "no client-side API fetch": + // Tiptap's suggestion plugin lives entirely on the client and + // fires on every keystroke after `@`. Routing each query through + // a SvelteKit form action would round-trip through SSR for a + // dropdown that needs to feel instantaneous, and a +server.ts + // endpoint would only proxy the same call. Auth flows through + // the Vite proxy in dev and Caddy in prod (cookie-based), so the + // network surface is identical to a server-driven call. + // Markus #5616: an ADR will formalise this. Open follow-up: + // "ADR: client-side fetch exception for editor suggestion plugins." + // Nora #5618 #3 — separate issue tracks the GET /api/persons + // response-shape audit (PersonSummaryDTO leaks `notes`). + // ───────────────────────────────────────────────────────────── items: async ({ query }: { query: string }) => { if (!query) return []; try {