From c9eb495688b49c508afe423b8d77e55a436af4f6 Mon Sep 17 00:00:00 2001 From: claude code agent 227 Date: Sat, 20 Jun 2026 21:21:32 +0300 Subject: [PATCH] fix(page-templates): clean up page-embed node chrome (#39) Two design problems on the whole-page embed (pageEmbed) node: - Double selection frame: the generic square cyan .ProseMirror-selectednode outline stacked on top of the rounded .includeWrap border. Add node-pageEmbed to the existing outline:none rule (already covering the transclusion nodes) so only the single rounded border remains. - Redundant 'open source' controls: the floating toolbar's external-link button duplicated the header badge title link. Remove the toolbar button; the badge title is now the single way to open the source (kept Refresh + ... menu). Also swap the badge fallback icon IconArrowsMaximize (read as 'expand') for a neutral IconFileText. Follow-ups from review: render the badge whenever the source resolves (so the only open-source link can't vanish when title+icon are empty), and label the link (title/aria-label) + add the 'Open source page' i18n key (en-US, ru-RU). Co-Authored-By: Claude Opus 4.8 --- .../public/locales/en-US/translation.json | 1 + .../public/locales/ru-RU/translation.json | 1 + .../components/page-embed/page-embed-view.tsx | 26 ++++++------------- .../transclusion/transclusion.module.css | 3 ++- 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/apps/client/public/locales/en-US/translation.json b/apps/client/public/locales/en-US/translation.json index 651800ee..0f6a1a9f 100644 --- a/apps/client/public/locales/en-US/translation.json +++ b/apps/client/public/locales/en-US/translation.json @@ -474,6 +474,7 @@ "Make sub-pages public too": "Make sub-pages public too", "Allow search engines to index page": "Allow search engines to index page", "Open page": "Open page", + "Open source page": "Open source page", "Page": "Page", "Delete public share link": "Delete public share link", "Delete share": "Delete share", diff --git a/apps/client/public/locales/ru-RU/translation.json b/apps/client/public/locales/ru-RU/translation.json index 238c42fd..ef5d3dc7 100644 --- a/apps/client/public/locales/ru-RU/translation.json +++ b/apps/client/public/locales/ru-RU/translation.json @@ -472,6 +472,7 @@ "Make sub-pages public too": "Сделать подстраницы тоже общедоступными", "Allow search engines to index page": "Разрешить поисковым системам индексировать страницу", "Open page": "Открыть страницу", + "Open source page": "Открыть исходную страницу", "Page": "Страница", "Delete public share link": "Удалить публичную ссылку", "Delete share": "Удалить общий доступ", diff --git a/apps/client/src/features/editor/components/page-embed/page-embed-view.tsx b/apps/client/src/features/editor/components/page-embed/page-embed-view.tsx index 63890eec..707a051f 100644 --- a/apps/client/src/features/editor/components/page-embed/page-embed-view.tsx +++ b/apps/client/src/features/editor/components/page-embed/page-embed-view.tsx @@ -2,10 +2,9 @@ import { NodeViewProps, NodeViewWrapper } from "@tiptap/react"; import { ActionIcon, Menu, Tooltip } from "@mantine/core"; import { IconAlertTriangle, - IconArrowsMaximize, IconDots, - IconExternalLink, IconEyeOff, + IconFileText, IconInfoCircle, IconRefresh, IconRepeat, @@ -136,20 +135,6 @@ function PageEmbedBody({ - {sourceHref && ( - - - - - - )} @@ -170,13 +155,18 @@ function PageEmbedBody({ ) : null; const header = - sourceTitle || sourceIcon ? ( + // Render the badge whenever the source resolves (sourceHref), not only when + // it has a title/icon — the title link is now the single way to open the + // source, so it must not disappear when title and icon are both empty. + sourceTitle || sourceIcon || sourceHref ? (
- {sourceIcon ? `${sourceIcon} ` : } + {sourceIcon ? `${sourceIcon} ` : } {sourceHref ? ( {sourceTitle || t("Untitled")} diff --git a/apps/client/src/features/editor/components/transclusion/transclusion.module.css b/apps/client/src/features/editor/components/transclusion/transclusion.module.css index 4d8d321a..168da0c7 100644 --- a/apps/client/src/features/editor/components/transclusion/transclusion.module.css +++ b/apps/client/src/features/editor/components/transclusion/transclusion.module.css @@ -183,7 +183,8 @@ } :global(.react-renderer.node-transclusionSource.ProseMirror-selectednode), -:global(.react-renderer.node-transclusionReference.ProseMirror-selectednode) { +:global(.react-renderer.node-transclusionReference.ProseMirror-selectednode), +:global(.react-renderer.node-pageEmbed.ProseMirror-selectednode) { outline: none; }