From 859223db1a341596e32d7dd50674ff1aca43b41c Mon Sep 17 00:00:00 2001 From: claude code agent 227 Date: Sat, 20 Jun 2026 21:15:43 +0300 Subject: [PATCH] fix(page-templates): show a template marker icon in the page tree (#38) Template pages were toggleable but indistinguishable in the sidebar tree. Render an IconTemplate next to the title when node.isTemplate is true, wrapped in a Tooltip(label='Template') with an aria-label + role='img' for AT. The icon is a child of the row Link so clicks navigate as normal; pointer events stay enabled so the tooltip's hover handlers fire. Adds the 'Template' i18n key to en-US and ru-RU (other locales fall back to en-US). Co-Authored-By: Claude Opus 4.8 --- .../public/locales/en-US/translation.json | 1 + .../public/locales/ru-RU/translation.json | 1 + .../page/tree/components/space-tree-row.tsx | 22 ++++++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/apps/client/public/locales/en-US/translation.json b/apps/client/public/locales/en-US/translation.json index c04fc72d..651800ee 100644 --- a/apps/client/public/locales/en-US/translation.json +++ b/apps/client/public/locales/en-US/translation.json @@ -183,6 +183,7 @@ "Successfully imported": "Successfully imported", "Successfully restored": "Successfully restored", "System settings": "System settings", + "Template": "Template", "Templates": "Templates", "Theme": "Theme", "To change your email, you have to enter your password and new email.": "To change your email, you have to enter your password and new email.", diff --git a/apps/client/public/locales/ru-RU/translation.json b/apps/client/public/locales/ru-RU/translation.json index 25ff2530..238c42fd 100644 --- a/apps/client/public/locales/ru-RU/translation.json +++ b/apps/client/public/locales/ru-RU/translation.json @@ -183,6 +183,7 @@ "Successfully imported": "Успешно импортировано", "Successfully restored": "Успешно восстановлено", "System settings": "Системные настройки", + "Template": "Шаблон", "Templates": "Шаблоны", "Theme": "Тема", "To change your email, you have to enter your password and new email.": "Чтобы изменить электронную почту, вам нужно ввести пароль и новый адрес.", diff --git a/apps/client/src/features/page/tree/components/space-tree-row.tsx b/apps/client/src/features/page/tree/components/space-tree-row.tsx index df371498..c5c08b1c 100644 --- a/apps/client/src/features/page/tree/components/space-tree-row.tsx +++ b/apps/client/src/features/page/tree/components/space-tree-row.tsx @@ -2,13 +2,14 @@ import { useRef } from "react"; import { Link, useParams } from "react-router-dom"; import { useAtom } from "jotai"; import { useTranslation } from "react-i18next"; -import { ActionIcon, rem } from "@mantine/core"; +import { ActionIcon, rem, Tooltip } from "@mantine/core"; import { IconChevronDown, IconChevronRight, IconFileDescription, IconPlus, IconPointFilled, + IconTemplate, } from "@tabler/icons-react"; import EmojiPicker from "@/components/ui/emoji-picker.tsx"; @@ -171,6 +172,25 @@ export function SpaceTreeRow({ {node.name || t("untitled")} + {node.isTemplate === true && ( + + + + )} +