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
38 changes: 38 additions & 0 deletions IMPLEMENTATION_PLAN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# IMPLEMENTATION PLAN — WebObsidian

## 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.

Nhật ký tiến độ — 2026-11-02. Hosted CI passed dependency audit and Docker build. Its web suite passed 519/520 tests, with the viewport fixture clicking More during the asynchronous overflow update at a 960×600 CSS viewport. Require stable measured geometry and command inventory before the click.

## Native code colors, Canvas and favicon fork PR — 2026-11-02

Cập nhật lần cuối: 2026-11-02.

- [x] Match native fenced JavaScript, Python and YAML token boundaries and colors with lazy stream grammars. Keep Markdown, frontmatter and the standalone code viewer palettes independent. Verify both themes and Live, Reading and Source modes without source changes.
- [x] Review all pending changes against fork main. Add a failing browser assertion for neutral Canvas borders and narrow the colored-card selector to the actual `--c:` property.
- [x] Run fresh full tests, typecheck, workspace/desktop builds and disposable integration smoke. Prepare all pending source, tests and documentation for a PR against `macros0/webobsidian:main`.

Nhật ký tiến độ — 2026-11-02. Independent review identified the Canvas height variable colliding with the existing broad colored-card selector. The correction is included in this PR and has not been deployed to CT102.

Final validation — 2026-11-02. Fresh full run passed 390 server tests (10 Windows capability skips) and all 520 web tests. Typecheck, workspace build, desktop typecheck/build, disposable integration smoke and all three MCP tests passed. The earlier PDF Chrome-startup `bad port` failure passed in isolation and in the final full run. Independent review approved the selector correction with no remaining findings.

## Obsidian site icon — 2026-11-02

- [x] Add the official Obsidian gradient SVG as the browser favicon, verify the production HTML resolves the icon, and deploy the tested assets to CT102.

Nhật ký tiến độ — 2026-11-02. Use the original asset from https://obsidian.md/images/obsidian-logo-gradient.svg. Vite fingerprints the icon URL for browser cache refresh.

Verification — production build, SVG/XML and exact asset bytes passed. Deployed `favicon-a88455468a4a` with healthy container, matching served assets and unchanged settings. Backup `/opt/webobsidian/backups/favicon-a88455468a4a-20261102T162308Z`.

## Compact Canvas text layout — 2026-11-02

Cập nhật lần cuối: 2026-11-02.

- [x] Reproduce compact two-line card clipping in a browser, remove reading-view boundary margins and verify long-card scrolling and unchanged document bytes. Match native selection controls, compact toolbar dimensions, text typography and neutral card borders. Check zoom/reset and Edit through the selection toolbar.

Nhật ký tiến độ — 2026-11-02. Browser reproduction confirms a 70px card has 96px of scroll content because of paragraph margins. Scope the layout correction to Canvas text cards under FR-12.

Verification — 2026-11-02. All 520 web tests passed after the text layout correction. After the native toolbar and border changes, all three focused Canvas browser tests and the production web build (including TypeScript) passed. Native toolbar dimensions and neutral border colors were checked against the installed Obsidian application resources. Plugin controls were excluded at the owner's request. Deployment records follow below.

- [x] Follow-up with the actual 250×60 card dimensions. The original 300×70 fixture missed residual overflow. Use native height-dependent vertical padding, keep small boards at 100% on opening, and verify zoom without document changes. All three focused browser tests and the production build pass. Deployed `canvas-layout-332337470529` with healthy container, matching served asset hashes and unchanged settings. Backup `/opt/webobsidian/backups/canvas-layout-332337470529-20261102T120623Z`. Browser UI inspection reported page zoom at 90%. Direct screenshot capture failed in computer-use, so final visual verification in the user's Comet remains manual.


## Native embed parity fork PR — 2026-11-01

Expand Down
8 changes: 5 additions & 3 deletions PRD.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
> deployment is outside this integration task.

> Product Requirements Document
> Phiên bản: 1.23 · Cập nhật: 2026-09-30 · Trạng thái: Draft
> Phiên bản: 1.24 · Cập nhật: 2026-11-02 · Trạng thái: Draft
> Changelog 1.24 (FR-2, FR-12): fenced JavaScript, Python and YAML use the native editor token palette in Live, Reading and Source modes. Canvas uses compact native selection controls, height-dependent text padding and an initial fit capped at 100%. The browser tab uses the official Obsidian gradient icon.
> Changelog 1.23 (FR-23 — chọn giá trị cho thuộc tính đóng: nút `▾` + danh sách giá trị, issue #61): trên
> trang task, `status:` là **text tự do** nên đổi trạng thái phải gõ đúng id — mà gõ sai thì không vô hại:
> board chỉ map id canonical (`open`/`in-progress`/`blocked`/`done`) + vài alias, mọi giá trị khác thành
Expand Down Expand Up @@ -672,9 +673,10 @@ chúng bằng đường có mũi tên, dùng cho brainstorm, moodboard, sơ đ
`ceil(15/scale)` đơn vị canvas). Giữ **Alt** (⌃ trên macOS) để kéo tự do (tắt snap); giữ **Shift** để khoá trục.
- **Format trong text card**: phím tắt như editor chính (`obsidianKeymap`) — ⌘B đậm, ⌘I nghiêng, ⌘K thêm link,
⌘L task, `⌘/` comment (toggle marker); menu chuột phải mở **đúng tại con trỏ** và tự dịch vào trong màn hình.
- **Căn lề text** (mở rộng ngoài JSON Canvas spec): `TextNode.textAlign` = `left|center|right`, chọn qua nút trong
selection menu (khi chọn text node) hoặc submenu "Align" menu chuột phải; áp cho cả textarea lẫn nội dung render.
- **Căn lề text** (mở rộng ngoài JSON Canvas spec): `TextNode.textAlign` = `left|center|right`, chọn qua
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.
- **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
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

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

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

- Build `favicon-a88455468a4a`, image ID `sha256:0ca49dacd783e37b7ec1799404e6442386538cc93e6ddf5b3feeb4e4ea80667c`.
- Добавлена официальная SVG-иконка Obsidian во вкладке браузера. Проверены production build, Linux smoke, healthy, SPA/asset hashes и совпадение настроек с backup.
- Резервная копия `/opt/webobsidian/backups/favicon-a88455468a4a-20261102T162308Z`, предыдущий образ `webobsidian:canvas-layout-332337470529` сохранён.
- Локальный пакет `build/favicon-release/`.

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

- Build `canvas-layout-332337470529`, image ID `sha256:6650bcfac3e895d2e37a4b9d3b269d7944823f3a55ffbcb7fab36d85509f159d`.
- Исправлены отступы двухстрочной карточки 250×60, шрифт, рамка и штатная панель выбранной карточки. Начальный fit маленькой доски ограничен 100%.
- Три браузерных теста Canvas, production web build и изолированный Linux smoke прошли. Healthy, build ID, отдаваемые SPA/JS/CSS и совпадение настроек с резервной копией проверены.
- Резервная копия `/opt/webobsidian/backups/canvas-layout-332337470529-20261102T120623Z`. Предыдущий образ `webobsidian:canvas-layout-c31c06e2314e` сохранён.
- Локальный пакет `build/canvas-layout-final-release/`. Исходники развёрнуты как снимок рабочей копии. Commit и push не выполнялись.

### Установленная версия: цвет литералов и многострочные кавычки Live — 29 октября 2026

- Build: `cc8b061-worktree-a14ad1ae6b77`; source SHA256
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/assets/obsidian.svg" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover, interactive-widget=resizes-content"
Expand Down
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@codemirror/lang-yaml": "^6.1.3",
"@codemirror/language": "^6.10.6",
"@codemirror/language-data": "^6.5.2",
"@codemirror/legacy-modes": "^6.5.5",
"@codemirror/merge": "6.12.3",
"@codemirror/search": "^6.7.0",
"@codemirror/state": "^6.4.1",
Expand Down
51 changes: 51 additions & 0 deletions web/src/assets/obsidian.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 12 additions & 22 deletions web/src/components/CanvasView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ export default function CanvasView() {
return;
}
const pad = 80;
const scale = Math.min(4, Math.max(0.1, Math.min((r.width - pad) / bb.width, (r.height - pad) / bb.height, 1.5)));
const scale = Math.max(0.1, Math.min((r.width - pad) / bb.width, (r.height - pad) / bb.height, 1));
const tx = r.width / 2 - (bb.x + bb.width / 2) * scale;
const ty = r.height / 2 - (bb.y + bb.height / 2) * scale;
setView({ tx, ty, scale });
Expand Down Expand Up @@ -1248,10 +1248,10 @@ export default function CanvasView() {
})();
const onlyEdges = sel.edges.size > 0 && sel.nodes.size === 0;
const selEdgeHasLabel = onlyEdges && data.edges.some((e) => sel.edges.has(e.id) && e.label);
// Text-card alignment state (only when ≥1 selected node is a text card).
const selTextNodes = data.nodes.filter((n) => sel.nodes.has(n.id) && n.type === 'text') as TextNode[];
const selHasText = selTextNodes.length > 0;
const curAlign: TextAlign = selTextNodes[0]?.textAlign ?? 'left';
// Native Edit action applies to a single selected text card.
const singleTextNode = sel.nodes.size === 1 && sel.edges.size === 0
? data.nodes.find((n) => sel.nodes.has(n.id) && n.type === 'text')
: undefined;
// Current color of the selection (first selected node/edge) → highlight its swatch.
const selColor: string | undefined = (() => {
const n = data.nodes.find((x) => sel.nodes.has(x.id));
Expand Down Expand Up @@ -1440,7 +1440,7 @@ export default function CanvasView() {
<div
key={n.id}
className={`canvas-node canvas-${n.type} ${selected ? 'selected' : ''}`}
style={{ left: n.x, top: n.y, width: n.width, height: n.height, ...(col ? ({ '--c': col, borderColor: col } as React.CSSProperties) : {}) }}
style={{ left: n.x, top: n.y, width: n.width, height: n.height, '--canvas-node-height': `${n.height}px`, ...(col ? ({ '--c': col, borderColor: col } as React.CSSProperties) : {}) } as React.CSSProperties}
onPointerDown={(e) => beginNodeDrag(e, n.id)}
onPointerEnter={() => setHoverNode(n.id)}
onPointerLeave={() => setHoverNode((h) => (h === n.id ? null : h))}
Expand Down Expand Up @@ -1481,7 +1481,7 @@ export default function CanvasView() {
style={{ textAlign: (n as TextNode).textAlign ?? 'left' }}
/>
) : (
<div className="canvas-text-body markdown-preview" style={{ textAlign: (n as TextNode).textAlign ?? 'left' }}>
<div className="canvas-text-body" style={{ textAlign: (n as TextNode).textAlign ?? 'left' }}>
{(n as TextNode).text.trim() ? <Preview source={(n as TextNode).text} /> : <span className="canvas-placeholder">Empty card — double-click to edit</span>}
</div>
)
Expand Down Expand Up @@ -1528,22 +1528,12 @@ export default function CanvasView() {
<Icon name="palette" size={16} />
</button>
<button className="canvas-menu-btn" title="Zoom to selection" onClick={zoomToSelection}>
<Icon name="zoom-in" size={16} />
<Icon name="zoom-to-selection" size={16} />
</button>
{selHasText && (
<>
<span className="canvas-menu-vsep" />
{(['left', 'center', 'right'] as const).map((a) => (
<button
key={a}
className={`canvas-menu-btn ${curAlign === a ? 'active' : ''}`}
title={`Align ${a}`}
onClick={() => setTextAlign(a)}
>
<Icon name={`align-${a}`} size={16} />
</button>
))}
</>
{singleTextNode && (
<button className="canvas-menu-btn" title="Edit" onClick={() => activateNode(singleTextNode.id)}>
<Icon name="square-pen" size={16} />
</button>
)}
{onlyEdges && (
<>
Expand Down
Loading
Loading