Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions IMPLEMENTATION_PLAN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# IMPLEMENTATION PLAN — WebObsidian

## Browser language packs — 2026-11-03

- [x] Add an English UI catalog, compatible .txt import, blank template download,
Settings → Language, server persistence, browser cache and immediate UI updates. Validate
partial imports, template round trips, replacement, reset, invalid files,
literal user content and existing editor/PDF widgets.

Nhật ký tiến độ — 2026-11-03. Implementation follows
`docs/superpowers/plans/2026-11-03-language-packs.md`. One active server-level
pack replaces its predecessor. Following the user's refinement, imported
compatible strings are persisted in server settings and refreshed on login,
window focus and opening Language settings. The browser retains a startup cache.
Existing local packs migrate when the server has no saved language.
The final upstream check imported ru.txt entirely
in memory and matched 134 UI keys with zero parameter warnings, including a
server round trip. The own English catalog contains 952 strings. External
dictionaries are absent from source, test fixtures and the production bundle.
Verification passed — 520 web tests, 391 server tests (10 existing skips),
full typecheck, production build and integration smoke. Additional browser
assertions cover empty-cache server loading, local-pack migration, failed saves,
serialized save/reset, preserving literal user titles and existing widget controls.

Deployment — 2026-11-03. Installed `localization-4b2213c625cb` on CT102.
Linux smoke and language HTTP round trip with a second session passed before
activation. Live healthy/build, served asset hashes, unchanged settings and
service/retry timer verified. Backup is recorded in `docs/INSTALLATION_CT102.md`.

PR preparation — 2026-11-03. Added the authored Russian file to
`translations/ru.txt` with a catalogue/placeholder coverage test. All 521 web
tests passed locally. Final review found a PDF-label reset issue when a widget
was created under an active language. Restore its canonical default label
instead of retaining translated text. The regression failed before the fix and
passed with the related language/PDF fixtures afterward.

## Canvas text flow and arrowheads — 2026-11-03

- [x] Compare the three screenshot samples with an isolated Obsidian profile. Match their line breaks and vertical spacing, scope Canvas text to the measured 16px reference size, and use the native 13×10.4px stroked arrowhead. Verify normal note font preferences and document bytes.

Cập nhật lần cuối: 2026-11-03. Native reference uses flexible before/after spacers. The existing fixed padding produced a 12px top gap instead of approximately 17px in a 250×140 card. The live vault note font preference is 19px, which the embedded Preview applied to Canvas text. Use an explicit 16px Canvas rendering override to match the supplied reference. Synthetic captures are in `build/obsidian-canvas-typography/`.

Verification — all 516 web tests and production web build passed. Exact wrapping assertions use the same bundled Liberation Sans font in the web fixture and isolated native capture for portability. Independent review corrections preserve placeholder spacing. Deployed `canvas-flow-8a0c5da7bcf7`, healthy and served asset hashes verified, settings unchanged. Backup `/opt/webobsidian/backups/canvas-flow-8a0c5da7bcf7-20261103T002232Z`.

## PR #16 hosted CI — 2026-11-02

- [x] Stabilize the toolbar viewport fixture after resize before opening its overflow menu. Preserve all zoom, mobile keyboard, selection and bounds assertions. The viewport, overflow and navigation browser tests pass locally.
Expand Down
20 changes: 20 additions & 0 deletions PRD.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@

# PRD — WebObsidian

## Browser language packs — 2026-11-03

The web client supports user-imported UTF-8 language files using Obsidian's
`[key]`, `original=`, `translation=` format. Its own English catalog supplies
fallback strings and a downloadable blank template. Users obtain external files
themselves through the repository link in Settings → Language. One active pack
is saved in the authenticated server settings and shared by browsers of this
WebObsidian instance. A local cache supplies startup/offline labels. Imports validate parameters and preserve
the current pack on failure. Compatible strings update React and existing editor
widgets immediately. Document names, text, command IDs and saved custom labels
retain their literal values. Existing browser-language editor messages and PDF
defaults are supported until a pack is chosen. Public server-rendered pages,
native Electron menus and third-party plugin strings are outside this first
version. Users obtain official dictionaries themselves and explicitly upload
their chosen file. Successful imports save only compatible strings on the server.
Existing browser-local packs migrate when the server has no language setting.
An explicit reset clears the server setting and local cache. Returning to a
browser window or opening Language settings refreshes its active server pack.

> FR-2 clarification 2026-10-29: literal angle identifiers containing underscores
> (for example `<LS_BEN>`) must use the normal body text color, not HTML tag red.
> Apply in Source/Live/Reading without editing the note. Earlier red-preservation
Expand Down Expand Up @@ -677,6 +696,7 @@ chúng bằng đường có mũi tên, dùng cho brainstorm, moodboard, sơ đ
submenu "Align" menu chuột phải; áp cho cả textarea lẫn nội dung render.
*Lưu ý: Obsidian thật bỏ qua field này khi mở lại.*
- **Selection toolbar parity (2026-11-02)**: a single text card shows Remove, Set color, Zoom to selection and Edit in a compact native-style toolbar. Text cards use readable 16px default typography, native neutral borders and no outer paragraph margins. Vertical padding shrinks with card height using the native Canvas rule so two lines fit a 250×60 card. Opening a small board fits at up to 100%. Zoom changes viewport state only.
- **Canvas screenshot parity (2026-11-03)**: text cards use an explicit 16px render size to match the reference even when the vault note font preference differs. Flexible vertical spacers grow up to 16px and shrink with short cards. Arrowheads use a 13px base, 10.4px length and 1px rounded outline.
- **Lưu**: autosave debounce (~900ms) như editor, ghi qua `PUT /api/files/content` (store `content`/`save`,
`.canvas` đã nằm trong `TEXT_RE`). Không thêm endpoint mới.
- **Tạo canvas mới**: context menu cây thư mục ("New canvas") + command palette; tên `Untitled.canvas` không
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ It is **single-user** and self-hosted: one master password protects the whole ap
configuration lives in a plain `data/settings.json` (no database engine), and the entire
stack runs from a single `docker compose up`.

### Interface language

Open **Settings → Language** to import a UTF-8 `.txt` language file or download a
blank template. The selected translation is saved on the server and shared by
your browsers. Missing translations use the app's English text.

This fork provides an independently authored Russian translation for manual import.
[Download the Russian language file](translations/ru.txt).

> **Why?** To access and edit your knowledge base from any browser, on any device, while
> keeping full ownership of your files — and to let AI agents read/write your vault through
> a safe, scoped REST API.
Expand Down
15 changes: 15 additions & 0 deletions docs/INSTALLATION_CT102.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ package/lockfile, manifests всех пяти workspaces и `server/dist`, `serv

## Проверка состояния

### Установленная версия — локализация с серверным хранением, 3 ноября 2026

- Build `localization-4b2213c625cb`, image ID `sha256:ecb46d016ea367397445b4203f3bad097ce15e3e86741096be6b6ee89628e0ec`.
- Settings → Language поддерживает пользовательский `.txt`, шаблон и сброс. Совместимые строки сохраняются на сервере и загружаются в браузерах после входа, при возвращении в окно и открытии настроек языка.
- Linux-образ собран из локальных production-артефактов с установкой server dependencies в Linux. Изолированный HTTP-тест проверил импорт, чтение другой авторизованной сессией, запись настроек, отклонение неверной версии пакета и сброс. Общий Linux smoke прошёл.
- Проверены healthy/build, контрольные суммы SPA и отдаваемых assets, доступность с рабочего компьютера и активность service/retry timer. Настройки и `.env` совпали с резервной копией.
- Backup `/opt/webobsidian/backups/localization-4b2213c625cb-20261103T054824Z`, предыдущий образ `webobsidian:canvas-flow-8a0c5da7bcf7` сохранён. Локальный пакет `build/localization-release/`. Рабочая копия развёрнута снимком без Git commit/push.

### Установленная версия — переносы текста и стрелки Canvas, 3 ноября 2026

- Build `canvas-flow-8a0c5da7bcf7`, image ID `sha256:0610b47718db92976c5c586eb61e31ae511994e4c3c1100941c708540405e26b`.
- Canvas использует шрифт 16px, гибкие вертикальные интервалы и наконечник с основанием 13px, длиной 10,4px и обводкой 1px.
- Все 516 web-тестов, production web build и изолированный Linux smoke прошли. Проверены healthy, build ID, совпадение отдаваемых файлов и настроек с резервной копией.
- Backup `/opt/webobsidian/backups/canvas-flow-8a0c5da7bcf7-20261103T002232Z`, предыдущий образ `webobsidian:pele-c8fe88d31202` сохранён. Локальный пакет `build/canvas-flow-release/`.

### Установленная версия — иконка сайта, 2 ноября 2026

- Build `favicon-a88455468a4a`, image ID `sha256:0ca49dacd783e37b7ec1799404e6442386538cc93e6ddf5b3feeb4e4ea80667c`.
Expand Down
59 changes: 59 additions & 0 deletions docs/superpowers/plans/2026-11-02-pele-diagrams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Pele diagram migration implementation plan

> **For agentic workers:** Use superpowers:executing-plans to implement this plan inline, then request one whole-change review. Steps use checkbox syntax for tracking.

**Goal:** Match Obsidian 1.15.0 diagrams, including the supplied flowchart screenshot, without changing Markdown source.

**Architecture:** One lazily loaded Pele mounting adapter serves editor widgets and HTML previews, including nested note embeds. Pele owns responsive layout and zoom; callers own source buttons, navigation, and disposal. Map Obsidian's `--mermaid-*` theme variables to Pele variables and remove the previous dark-theme inversion.

**Tech stack:** React, CodeMirror 6, Pele 1.8.0 (the version in installed Obsidian 1.15.0), existing KaTeX, real Chromium browser fixtures.

**Spec:** User approved replacing Mermaid with Pele and supplied the new native appearance. The design is the Architecture paragraph above; native bundle `lib/pele.min.js` and theme CSS are read-only reference evidence. Reuse the current checkout, preserve existing commits, and deploy after verification.

## Constraints and review focus

- Keep `mermaid` Markdown fence syntax and persisted note content unchanged.
- Share rendering, error handling, theme mapping and disposal between editor/preview.
- Preserve hover source actions in editable Live mode and hide them in readonly modes.
- Theme changes must update colors without inversion; resizing must not expand the workspace.
- Stop observers, zoom listeners and pending mounts when widgets disappear.
- Treat link targets as untrusted; internal links use the app's existing note navigation.
- Typeset formula labels with existing KaTeX with `trust: false`; display malformed input as text.
- Check source edits, duplicate SVG IDs, malformed diagrams, links and callbacks, math, hidden/replaced mounts, narrow widths, and zoom keyboard input.

## Tasks

### 1. Shared renderer and native theme

Files: create `web/src/lib/diagram.ts`; update `web/package.json`, lockfile, `web/src/styles/obsidian.css`; replace `web/src/lib/mermaidConfig.ts`.

- [x] Add real-browser regression tests for new SVG classes, native node/line/text colors in both themes, source preservation and resize containment; confirm failure against current editor/preview.
- [x] Implement `mountDiagram(element, source, options): () => void`, with lazy Pele import, scoped math measurement, internal/external navigation, error handling and cancellable disposal.
- [x] Verify malformed input and unsafe callbacks/links cannot execute; remove obsolete Mermaid dependency and its duplicate KaTeX tests, retain web KaTeX regressions.

### 2. Integrate all rendering surfaces

Files: update `web/src/lib/livePreview.ts`, `web/src/components/Preview.tsx`; create `web/tests/peleDiagramsBrowser.test.ts` and update affected tests.

- [x] Connect editor widget mounting, source button placement, CodeMirror measurement, and `destroy()` cleanup.
- [x] Connect HTML preview/nested diagram mounting and effect cleanup.
- [x] Verify both modes, hover source controls, source editing, internal/external links, formula labels, multiple diagrams, responsive layout, zoom and error recovery with real browser input.

### 3. Verify and deploy

- [x] Compare polygon flowchart and sequence geometry with installed Obsidian 1.15 using owned fixtures and screenshots; verify both themes against the native theme CSS.
- [x] Run targeted tests, typecheck, build, full tests, dependency checks/audit; review the complete change and address findings.
- [x] Prepare an image from the current server image with public client assets only after verifying no server runtime changes; smoke-test in isolation, back up and activate.
- [x] Verify external HTTPS release/assets and unchanged protected note/fixture hashes.

## Execution ledger

- Baseline: clean checkout at `30e0411`, branch `codex/pele-diagrams-20261102`. Previous syntax/Canvas commits are preserved.
- Native reference: installed Obsidian 1.15.0 bundles Pele 1.8.0. Its theme uses normal text/lines, secondary surface, hover border and eight standard palette colors.
- Ruling: pin 1.8.0 to match the actual reference rather than assuming the newest Pele release renders identically. Check npm audit before deployment.

- Verification: native Obsidian and actual Chrome polygon flowcharts both render at 730 × 600 with Pele 1.8.0. Targeted browser/polygon/KaTeX checks pass; keyboard zoom/reset checked separately. npm audit (production) reports zero vulnerabilities.
- Review fixes (RED then GREEN): preserve embedded note origin before replacing fence DOM; rehydrate identical HTML on note changes; pass displayed paths for split/Canvas file previews; disable competing Pele zoom inside Canvas. Fresh reviewer confirmed no further findings.
- Final theme regression: defaults belong on the theme root so inherited `--mermaid-*` overrides reach diagrams. RED reproduced the override being masked; GREEN covers parent overrides in every rendering surface.
- Completed: final typecheck/build, 390 server tests (10 Windows skips), 516 web tests, 3 MCP tests, dependency baselines, full npm audit (zero findings), and isolated production-image smoke passed.
- Deployment: `pele-c8fe88d31202`, runtime commit `22eaa2ab067e56052239732690677c359add25f9`. External HTTPS and 12 asset hashes verified, including Pele. Protected note/fixture hashes and settings are unchanged. Backup: `/opt/webobsidian/backups/pele-c8fe88d31202-20261102T174625Z`.
Loading
Loading