From 9120ad3b2d8e8d61b5b7d813f59fda94b383e4e3 Mon Sep 17 00:00:00 2001 From: agent_coder Date: Thu, 9 Jul 2026 23:12:35 +0300 Subject: [PATCH] =?UTF-8?q?feat(client):=20=D1=81=D0=BD=D0=BE=D1=81=D0=BA?= =?UTF-8?q?=D0=B8=20=E2=80=94=20=D1=80=D0=B5=D0=BD=D0=B4=D0=B5=D1=80=20?= =?UTF-8?q?=D0=B1=D0=B5=D0=B7=20=D1=81=D0=B4=D0=B2=D0=B8=D0=B3=D0=B0=20(?= =?UTF-8?q?=D0=BD=D0=BE=D0=BC=D0=B5=D1=80=20=D0=B8=D0=BD=D0=BB=D0=B0=D0=B9?= =?UTF-8?q?=D0=BD=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20::before)=20=D0=B8=20?= =?UTF-8?q?=D1=88=D1=80=D0=B8=D1=84=D1=82=D0=BE=D0=BC=20sm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Убран отдельный столбец-маркер .definitionMarker (order:-1, min-width:1.5em), дававший висячий отступ. Номер сноски теперь рисуется инлайн в начале первого параграфа через .definitionContent > :first-child::before из CSS-переменной --footnote-number (в модель документа не попадает, экспорт не затрагивает). Кегль сносок уменьшен до var(--mantine-font-size-sm). Инвариант #146 (contentDOM первый в DOM) и логика мульти-бэклинков #168 сохранены. closes #420 Co-Authored-By: Claude Opus 4.8 (1M context) --- .../footnote/footnote-definition-view.tsx | 15 +++---- .../components/footnote/footnote.module.css | 40 +++++++++---------- 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/apps/client/src/features/editor/components/footnote/footnote-definition-view.tsx b/apps/client/src/features/editor/components/footnote/footnote-definition-view.tsx index b8fe182f..db61d677 100644 --- a/apps/client/src/features/editor/components/footnote/footnote-definition-view.tsx +++ b/apps/client/src/features/editor/components/footnote/footnote-definition-view.tsx @@ -49,19 +49,14 @@ export default function FootnoteDefinitionView(props: NodeViewProps) { className={classes.definition} style={{ ["--footnote-number" as any]: `"${number}"` }} > - {/* #146: contentDOM MUST be the first child — a non-editable marker before + {/* #146: contentDOM MUST be the first child — non-editable chrome before it makes click hit-testing snap the caret above. Content first; the - marker + back-link follow in DOM and are placed left/right via CSS - flex `order`. The second #146 mitigation lives in + back-link follows in DOM and is placed on the right via CSS flex. The + decorative "N." number is rendered inline via the .definitionContent + ::before rule (from the --footnote-number var), so no marker element + precedes the content. The second #146 mitigation lives in editor-paste-handler.tsx (reflowAfterPaste). */} - {refCount > 1 ? ( // Multiple references -> ↩ followed by one lettered link per occurrence. :first-child::before { + content: var(--footnote-number, "?") ". "; + color: var(--mantine-color-dimmed); + font-variant-numeric: tabular-nums; + user-select: none; +} + +/* The inner editable paragraph inherits `.ProseMirror p { margin: 0.5em 0 }`. + Drop the outer margins so the definition sits tight to the heading above and + the ::before number aligns with the top of the row — same approach used for + callouts in core.css. */ .definitionContent > :first-child { margin-top: 0; }