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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ notes. Entries describe what users experience, not internal refactors.

### Changed

- Opening a Word or PowerPoint file downloads only the font faces the document
actually uses (regular / bold / italic), instead of every face of every
family up front. Pasting or applying a new style still fetches what it needs.
- The site top bar stays fixed while you scroll the homepage and content pages,
so language, GitHub and brand links remain reachable past the first screen.
- Nightly CI now runs the API surface, keyboard shortcut, and seeded monkey
sweeps (previously documented as nightly but never scheduled).

Expand Down
10 changes: 8 additions & 2 deletions docs/design-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,21 @@ Notion 正文 708)。**不存在"一个正确的宽度",只存在按内容
| ----------------- | ------------------------ | -------------------------------- | -------------------------- |
| h1 | 64/700(hero,刻意更重) | 40/700,`letter-spacing: -1.2px` | 同内容页 |
| body | 16px / 1.65 | 16px / 1.65 | 16px / 1.65 |
| 顶栏 `header.bar` | 有 | 有 | 有 |
| 顶栏 `header.bar` | 有(sticky) | 有(sticky) | 有(sticky) |
| 页脚 | 有 | 有 | **无** |

**"应用页有顶栏、无页脚"是有意的**:`/history` 和 `/embed-demo.html` 是来办事的地方,
不是浏览站点的地方;页脚的站内导航在那里只会挡路。这与 Gmail / Notion / Linear 一致。
但顶栏必须有——用户是从首页走过来的,顶栏消失会让人以为跳到了别的站。

**顶栏滚动时固定**(`position: sticky; top: 0`):首页与内容页都够长,滚过首屏后
仍要够得到语言切换与 GitHub。背景用 `--ran-color-bg` 实底,不透内容。首页的
`#landing-hero` **不能**设 `overflow-x`(非 visible 的 overflow 会让 sticky 贴在
区块上而不是视口上)。内容页右侧目录栏的 `top` 要清过这条约 4.5rem 的固定顶栏。

顶栏和页脚的样式**只有一份**(`landing.css`),页面复用它的类名与结构,
而不是抄一遍数值。`/history` 因此直接 `<link>` 了 `landing.css`。
而不是抄一遍数值。`/history` 因此直接 `<link>` 了 `landing.css`。首页自己的那份
在 `home.css`(不加载 `landing.css`),两份由 `design-contract` 钉住一致。

## 四、按钮两档

Expand Down
44 changes: 44 additions & 0 deletions docs/explorations/2026-11-22-font-needstyles-clamp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Open-time NeedStyles clamp (font-load guard 15c) — 2026-11-22

## Why

`CheckFontNeeds` builds `new AscFonts.CFont(name)` from name-only
`Document_Get_AllFontNames`, and the CFont ctor turns a missing style into
**NeedStyles = 15** (every face). A Regular-only Latin one-pager still queued
Italic/Bold/BI files for every family that had them. Style-aware data already
existed in `Document_CreateFontMap` (Style 0..3) but the open path never used it.

## What we did

- `lib/onlyoffice/guards/font-loading.ts`: wrap `DrawingDocument.CheckFontNeeds`
(primary) and `LoadDocumentFonts` (belt). Read
`Document_CreateFontMap()`, map Style → face bits (0→1, 1→4, 2→2, 3→8,
always `| 1`), rewrite `LogicDocument.Fonts`. Families **in** the map are
narrowed to `known | Regular | Italic` (Italic covers chrome / placeholders
that never appear in CreateFontMap). Families only on the open list
(style-sheet / theme extras) **keep the vendor NeedStyles** (usually 15) —
clamping those to Regular-only caused `asc_onError -25`. Dropping Italic on
mapped families also surfaced tip-level `-25` on first paint.
`LoadDocumentFonts2` (paste) does not go through CheckFontNeeds, so it stays
unclamped. The iframe poll waits for the CheckFontNeeds hook on word/slide.
- `fontSources()` in `x2t-worker.ts` now honors the same bits so conversion does
not re-pull every face after the open clamp.
- Pure helpers + bit filtering pinned in `test/unit/font-need-styles.test.ts`;
live clamp in `embed-regression` "open-time NeedStyles is clamped…"
(expects Arial NeedStyles === 7 for a Regular+Bold sample).

## Reverse verification

Temporarily short-circuit `rewriteFontsNeedStyles` so it returns without writing:
the new E2E fails with Arial NeedStyles still **15** (expected **7**). Restoring
the rewrite turns it green again. Unit tests for `fontSources(NeedStyles=1)` fail
if the bit check in `x2t-worker.ts` is removed.

Keeping Italic on mapped families also removed the tip-level `asc_onError -25`
that appeared when the clamp was Regular|Bold only (5).

## Out of scope

Cell editor (no useful CreateFontMap on open). Changing vendor x2t / rebuilding
wasm. Interactive `LoadFont` still requests 15 when the user first applies a
new face — that is intentional.
27 changes: 27 additions & 0 deletions docs/explorations/2026-11-22-sticky-site-header.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Sticky site header on home and content pages (2026-11-22)

## Why

The homepage and long content pages scroll past the first viewport. Without a
fixed top bar, brand / language / GitHub disappear — the controls people still
need after reading the hero.

## What changed

- `public/home.css` `#landing-hero .bar` and `public/landing.css` `header.bar`:
`position: sticky; top: 0; z-index: 20; background: var(--ran-color-bg)`.
- Removed `overflow-x: hidden` from `#landing-hero`. Any non-visible overflow on
that ancestor makes sticky stick to the section instead of the viewport, so
the bar still scrolled away. Horizontal spill is already contained on the
pieces that can overflow (docwin, wordmark ellipsis); body keeps
`overflow-wrap: break-word` for long Latin runs.
- Content-page `.side` sticky `top` / `max-height` now clear the ~4.5rem sticky
bar; the old `top: space-8` parked the rail behind the chrome once the bar stuck.
- `docs/design-system.md` records the sticky rule; `design-contract` and
`site-design-consistency` pin both stylesheets and the scroll behavior.

## Reverse verification

Temporarily drop `position: sticky` from either bar rule: the new unit pin in
`design-contract` fails, and the E2E "top bar stays pinned…" case reports
`bar.top` leaving 0 after `scrollBy(900)`.
5 changes: 3 additions & 2 deletions docs/ops/cloudflare-and-webmcp-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@ Boolean(document.modelContext ?? navigator.modelContext);
`edit.chaxus.com/fonts` + wasm URL. Deleted slot `/fonts/017` no longer
serves old proprietary bytes.
- [x] WebMCP token in `_headers` / `sws.toml` (live after next production deploy)
- [ ] Production `curl -sI` shows `Origin-Trial` and console `modelContext` is truthy
(needs #309 / token commit deployed to `edit.chaxus.com`)
- [x] Production `curl -sI https://edit.chaxus.com/editor` shows `Origin-Trial`
(verified 2026-11-22). Console `modelContext` still needs a Chrome ≥ 149
hand check on `/editor?new=docx`.
Loading
Loading