♻️(refacto) Drop the initialBlockId workaround of user mentions once BlockNote does

Aperta
#2,887 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
54/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
django, react, typescript
Ambito
backend, frontend

Direzione di ricerca

Read BlockNote's UniqueID.ts and FixUpSchema.ts references, then inspect replaceInitialBlockId in src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Mention/UserMention/ and its call in useSearchUserMention. Confirm how the backend validates mention anchors and how copied block links behave. Done means BlockNote supplies a UUID for the initial block (or a generation hook), the workaround and call are removed, and existing links remain valid.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

blocknote-side editor frontend

BlockNote gives the fixed id initialBlockId, not a uuid, to the first block of a new collaborative doc and keeps it once the block has content (also set in FixUpSchema.ts):
https://github.com/TypeCellOS/BlockNote/blob/ea5d80358f179d1683abcd2e0e3e9d547bf52eef/packages/core/src/extensions/tiptap-extensions/UniqueID/UniqueID.ts#L190-L216

The backend only accepts a uuid as mention anchor, so the frontend renames this block to a uuid before notifying the mentioned user (replaceInitialBlockId in src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Mention/UserMention/, marked with a TODO); the rename breaks the #initialBlockId block links copied before it. No open BlockNote issue tracks it, the closest is TypeCellOS/BlockNote#475 (closed).

Suggested fix: ask BlockNote to give the initial block a real uuid (or a hook to generate it), then remove replaceInitialBlockId and its call in useSearchUserMention.

Lingua principale
TypeScript
Stelle
17k
Fork
705
Merge medio
4g 13h
PR unite (30g)
47

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di suitenumerique/docs

Tutte le issue di suitenumerique/docs

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.