From 9f99bd674205dcd964a52d950df765ce94b16ba0 Mon Sep 17 00:00:00 2001 From: i-execute Date: Fri, 13 Nov 2026 10:57:11 +0000 Subject: [PATCH] site fixes: pass eleven --- src/App.jsx | 22 +++++++++++----------- src/components/FumadocsView.jsx | 6 ++---- src/components/QuasarScene.jsx | 4 +++- src/data/docs.jsx | 28 ++++++++++++++-------------- src/index.css | 6 +++--- src/tokens.css | 14 ++++++++++---- 6 files changed, 43 insertions(+), 37 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 71e9c4d..63068de 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -8,6 +8,9 @@ import { CONTENT } from './data/content.jsx'; export function App() { const [lang, setLang] = useState('en'); const [view, setView] = useState(() => (window.location.hash.startsWith('#docs') ? 'docs' : 'home')); + const [docsInitialTab, setDocsInitialTab] = useState(() => + window.location.hash.includes('catalog') ? 'catalog' : 'chapters' + ); const currentContent = CONTENT[lang] || CONTENT.en; useEffect(() => { @@ -64,25 +67,21 @@ export function App() { }, []); useEffect(() => { - const handleHash = () => { - if (window.location.hash.startsWith('#docs')) { - setView('docs'); - } else { - setView('home'); - } - }; - window.addEventListener('hashchange', handleHash); - return () => window.removeEventListener('hashchange', handleHash); + // Older builds used a #docs fragment even though the guide is an + // in-app view. Remove it from old links so navigation never leaves a + // decorative hash in the address bar. + if (window.location.hash.startsWith('#docs')) { + window.history.replaceState(null, '', window.location.pathname + window.location.search); + } }, []); const openDocs = (target) => { - window.location.hash = target === 'catalog' ? '#docs-catalog' : '#docs'; + setDocsInitialTab(target === 'catalog' ? 'catalog' : 'chapters'); setView('docs'); window.scrollTo({ top: 0, behavior: 'smooth' }); }; const backHome = () => { - window.location.hash = ''; setView('home'); window.scrollTo({ top: 0, behavior: 'smooth' }); }; @@ -94,6 +93,7 @@ export function App() { lang={lang} setLang={setLang} onBackToHome={backHome} + initialTab={docsInitialTab} /> ); } diff --git a/src/components/FumadocsView.jsx b/src/components/FumadocsView.jsx index b31a32e..c05d0d0 100644 --- a/src/components/FumadocsView.jsx +++ b/src/components/FumadocsView.jsx @@ -266,10 +266,8 @@ function FormattedContent({ rawContent, copyLabel, copiedLabel, failedLabel }) { ); } -export function FumadocsView({ content, lang, setLang, onBackToHome }) { - const [activeTab, setActiveTab] = useState(() => - window.location.hash.includes('catalog') ? 'catalog' : 'chapters' - ); +export function FumadocsView({ content, lang, setLang, onBackToHome, initialTab = 'chapters' }) { + const [activeTab, setActiveTab] = useState(initialTab); const [activeSection, setActiveSection] = useState(0); const [chapterDropdownOpen, setChapterDropdownOpen] = useState(false); const [searchQuery, setSearchQuery] = useState(''); diff --git a/src/components/QuasarScene.jsx b/src/components/QuasarScene.jsx index e8acee1..d1b3db0 100644 --- a/src/components/QuasarScene.jsx +++ b/src/components/QuasarScene.jsx @@ -300,6 +300,8 @@ function rotate(v, k, ang) { // the page bare const DEFAULT_PITCH = 0.34; const DEFAULT_DIST = 26.0; +const DIST_MIN = 15.0; +const DIST_MAX = 33.0; // how far the eye sits below the middle of the band, to compensate for the // bright limb of the disk glowing above the eye point const BRIGHT_LIFT = 16; @@ -777,7 +779,7 @@ export function QuasarScene({ lang = 'en', copyRef = null }) { stateRef.current.isDragging = false; }; const zoomBy = (k) => { - stateRef.current.dist = Math.max(14.0, Math.min(48.0, stateRef.current.dist * k)); + stateRef.current.dist = Math.max(DIST_MIN, Math.min(DIST_MAX, stateRef.current.dist * k)); start(); }; diff --git a/src/data/docs.jsx b/src/data/docs.jsx index 68ef5f8..ade0bd5 100644 --- a/src/data/docs.jsx +++ b/src/data/docs.jsx @@ -26,7 +26,7 @@ Hotaru inherits the transport and the cryptography from GoyGram. ![The GoyGram mark](media/goygram-mark.png) -The chart below is the upstream GoyGram TL codec benchmark, rendered here in grayscale to match the rest of the interface. +The chart below is the upstream GoyGram TL codec benchmark. ![GoyGram TL codec benchmark: 351270 operations per second for serialize sendMessage](media/goygram-codec.png)`, }, @@ -101,7 +101,7 @@ HOTARU = { | Field | Type | Rule | | --- | --- | --- | -| \`id\` | string | Non-empty, at most 128 characters, no slash or NUL. | +| \`id\` | string | Canonical module ID and default name. Non-empty, at most 128 characters, no slash or NUL. | | \`version\` | string | Non-empty. | | \`commands\` | list of strings | No empty entries and no whitespace inside a command. | | \`capabilities\` | list of strings | Names from the capability registry. | @@ -110,7 +110,7 @@ HOTARU = { | Field | Type | Meaning | | --- | --- | --- | -| \`name\` | string | Display name. Defaults to \`id\`. | +| \`name\` | string | Optional display label; the runtime uses \`id\` when omitted. | | \`watchers\` | list of strings | Watcher entry points the runtime subscribes. | | \`tasks\` | dict | Background tasks. Each entry may set \`interval\` (seconds, default 60) and \`autostart\`. | | \`aliases\` | dict | Alternative command names mapped to existing commands. | @@ -385,9 +385,9 @@ The image below is the running Singularity frontend, captured from the upstream }, { id: 'skill', - title: 'The agent skill', - summary: 'SKILL.md, the reference an agent reads to write modules against the real API.', - content: `\`SKILL.md\` is the guide written for an AI agent that has to produce working modules. It is a single file, and it is the same file the download button serves. + title: 'Module-writing reference', + summary: 'SKILL.md documents the Hotaru module contract and runtime API.', + content: `\`SKILL.md\` is the reference for Hotaru's module contract and runtime API. It is available as a single-file download. ### What it contains @@ -404,7 +404,7 @@ The method cards are generated from the upstream sources rather than written by ### Language -The guide is written in Russian, which is the language of the upstream project. The interface here keeps the same split: this documentation in the language you chose, the agent guide in the language it was written in.`, +The guide is written in Russian, the language of the upstream project.`, }, ]; @@ -436,7 +436,7 @@ Hotaru наследует транспорт и криптографию от Go ![Знак GoyGram](media/goygram-mark.png) -На графике ниже — бенчмарк TL-кодек GoyGram из upstream-репозитория, переведённый здесь в оттенки серого, чтобы встать в ряд с остальным интерфейсом. +На графике ниже — бенчмарк TL-кодек GoyGram из upstream-репозитория. ![Бенчмарк TL-кодек GoyGram: 351270 операций в секунду на serialize sendMessage](media/goygram-codec.png)`, }, @@ -511,7 +511,7 @@ HOTARU = { | Поле | Тип | Правило | | --- | --- | --- | -| \`id\` | строка | Не пусто, не длиннее 128 символов, без слэша и NUL. | +| \`id\` | строка | Канонический ID и имя модуля по умолчанию. Не пусто, не длиннее 128 символов, без слэша и NUL. | | \`version\` | строка | Не пусто. | | \`commands\` | список строк | Без пустых записей и без пробелов внутри команды. | | \`capabilities\` | список строк | Имена из реестра владений. | @@ -520,7 +520,7 @@ HOTARU = { | Поле | Тип | Значение | | --- | --- | --- | -| \`name\` | строка | Отображаемое имя. По умолчанию равно \`id\`. | +| \`name\` | строка | Необязательная подпись для отображения; если её нет, среда использует \`id\`. | | \`watchers\` | список строк | Точки входа наблюдателей, на которые подписывается среда. | | \`tasks\` | словарь | Фоновые задачи. У каждой можно задать \`interval\` (секунды, по умолчанию 60) и \`autostart\`. | | \`aliases\` | словарь | Другие имена команд, отображаемые на существующие. | @@ -795,9 +795,9 @@ Hotaru может поднять туннель Cloudflare Horizon и зарег }, { id: 'skill', - title: 'Скилл для агента', - summary: 'SKILL.md — справочник, по которому агент пишет модули по настоящему API.', - content: `\`SKILL.md\` — руководство, написанное для ИИ-агента, которому нужно писать рабочие модули. Это один файл, и именно его отдаёт кнопка скачивания. + title: 'Справочник по разработке модулей', + summary: 'SKILL.md описывает контракт модулей Hotaru и API среды выполнения.', + content: `\`SKILL.md\` — справочник по контракту модулей и реальному API Hotaru. Он доступен для скачивания одним файлом. ### Что внутри @@ -814,6 +814,6 @@ Hotaru может поднять туннель Cloudflare Horizon и зарег ### Язык -Руководство написано по-русски — на языке самого проекта. Здесь разделение такое же: эта документация на выбранном вами языке, руководство для агента на языке, на котором оно написано.`, +Руководство написано по-русски, как и сам проект.`, }, ]; diff --git a/src/index.css b/src/index.css index 814c85b..a1523ed 100644 --- a/src/index.css +++ b/src/index.css @@ -882,7 +882,7 @@ margin-top: var(--space-lg); font-size: var(--text-lg); color: var(--color-ink); - text-shadow: var(--halo-doc-title); + text-shadow: var(--halo-doc-head); } .doc-h3 { margin-top: var(--space-md); @@ -890,7 +890,7 @@ font-size: var(--text-md); font-weight: 600; color: var(--color-ink); - text-shadow: 0 0 16px oklch(100% 0 0 / 0.09); + text-shadow: var(--halo-doc-head); } .doc-list { margin: 0; @@ -986,7 +986,7 @@ cursor: pointer; transition: color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out); } - .doc-code code { font: inherit; white-space: pre; } + .doc-code code { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; } .doc-code:hover { color: var(--color-ink); } .doc-code:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; } .doc-code--done { color: var(--color-ink); background: oklch(100% 0 0 / 0.035); } diff --git a/src/tokens.css b/src/tokens.css index 84ddeca..1376f07 100644 --- a/src/tokens.css +++ b/src/tokens.css @@ -38,10 +38,16 @@ 0 0 40px oklch(100% 0 0 / 0.17), 0 0 96px oklch(100% 0 0 / 0.07); --halo-doc-title: - 0 0 3px oklch(100% 0 0 / 0.14), - -2px 0 11px oklch(100% 0 0 / 0.07), - 2px 0 11px oklch(100% 0 0 / 0.07), - 0 0 28px oklch(100% 0 0 / 0.04); + 0 0 4px oklch(100% 0 0 / 0.42), + -3px 0 15px oklch(100% 0 0 / 0.28), + 3px 0 15px oklch(100% 0 0 / 0.28), + 0 0 34px oklch(100% 0 0 / 0.16), + 0 0 80px oklch(100% 0 0 / 0.07); + --halo-doc-head: + 0 0 3px oklch(100% 0 0 / 0.30), + -2px 0 10px oklch(100% 0 0 / 0.16), + 2px 0 10px oklch(100% 0 0 / 0.16), + 0 0 24px oklch(100% 0 0 / 0.08); --halo-method: 0 0 4px oklch(100% 0 0 / 0.62), -2px 0 12px oklch(100% 0 0 / 0.34),