From 58791fc7d98217fba80a5ada31382754f4f83194 Mon Sep 17 00:00:00 2001 From: cflmy Date: Fri, 30 Oct 2026 11:41:49 +0800 Subject: [PATCH] release: v2.2.1 fix view outline rail under document Occlusion left .doc-block open and mid-width CSS stacked the Functions/Variables rail below Structure; close the block and stack by panel container width instead. Co-authored-by: Cursor --- .github/workflows/release.yml | 3 ++ CHANGELOG.md | 13 ++++++++ Cargo.lock | 4 +-- Cargo.toml | 2 +- README.md | 11 ++++--- crates/marqdo-wasm/Cargo.toml | 2 +- debian/changelog | 7 +++++ ext/VERSION | 2 +- src/view/document.rs | 57 +++++++++++++++++++++++++++++++++++ src/view/html.rs | 36 ++++++++++++++++++++-- 10 files changed, 125 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1afa319..2e7ccb2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -126,6 +126,9 @@ jobs: ## Marqdo ${{ github.ref_name }} ### 亮点 / Highlights + - **v2.2.1**:view / 静态导出——修复 occlusion 与中等宽度下大纲侧栏掉到正文下方 + - **v2.2.1**: view / static export — fix outline rail nested under document (occlusion + mid-width layout) + - **v2.2.1 ext**:扩展包同步 2.2.1 / Ext pack 2.2.1 - **v2.2.0**:函数级调用 `marqdo call`——同一份 .mq.md 就是文档、知识和工具;Tree/Bytecode 执行被点名的函数;外部调用默认只跑纯函数 - **v2.2.0**: `marqdo call` runs one function in any .mq.md — the file is the document, the knowledge and the tool; Tree and Bytecode execute that function; external calls stay pure - **v2.2.0 ext**:扩展包同步 2.2.0 / Ext pack 2.2.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b4bfca..508580a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,19 @@ ### Changed +## v2.2.1 — 2026-10-30 + +### Highlights + +**view / 静态导出大纲侧栏修复**:带遮蔽(occlusion)语句的文档页里,Functions / Variables 右侧栏会掉到正文下面;中等窗口宽度下也会被错误叠成单列。CLI · wasm · ext **2.2.1**。 + +**核心表面 Δ(Core surface Δ)**:**无增删**(仍 19 个构造)——布局与 HTML 闭合修复,不改 Markdown 标记。 + +### Fixed + +- **`marqdo view` / `view output`**:occlusion 行提前返回时未关闭 `.doc-block`,把 `#outline-rail` 嵌进 `document-surface`,侧栏排到文档下方;现已闭合并保留标注带。 +- **view 壳 CSS**:大纲折叠改为按主栏 `@container mq-panel` 宽度(32rem),不再用视口 `960px` 媒体查询把右侧栏压到正文下;极窄时大纲上移到文档上方。 + ## v2.2.0 — 2026-10-30 ### Highlights diff --git a/Cargo.lock b/Cargo.lock index d4eb0b2..e3e37a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,7 +572,7 @@ checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "marqdo" -version = "2.2.0" +version = "2.2.1" dependencies = [ "anyhow", "assert_cmd", @@ -611,7 +611,7 @@ dependencies = [ [[package]] name = "marqdo-wasm" -version = "2.2.0" +version = "2.2.1" dependencies = [ "marqdo", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 2ed01e4..62f00d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "marqdo" -version = "2.2.0" +version = "2.2.1" edition = "2021" license = "Apache-2.0" description = "Marqdo — Markdown markers as an interpreted programming language" diff --git a/README.md b/README.md index 976c527..e68dc91 100644 --- a/README.md +++ b/README.md @@ -284,9 +284,10 @@ marqdo catalog public -o .marqdo --- -## 现状(v2.2.0) +## 现状(v2.2.1) -- **函数级调用(v2.2.0)**:`marqdo call <文件.mq.md> <函数> 名字=值`。同一份文档给人读,也按函数执行;Tree 与 Bytecode 都跑被点名的函数,不回退到 `# main`。默认只执行纯函数。`--json` 给 Agent 读取结果或诊断。说明与价值见 [22-函数调用](public/features/22-函数调用.mq.md)。示例:`marqdo call examples/calculator.mq.md 计算器.加法 a=2 b=3` → `5`。扩展包同步 **2.2.0** +- **view 大纲侧栏(v2.2.1)**:修复 occlusion 文档与中等宽度下 Functions / Variables 掉到正文下方的问题;静态 `view output` 同源。 +- **函数级调用(v2.2.0)**:`marqdo call <文件.mq.md> <函数> 名字=值`。同一份文档给人读,也按函数执行;Tree 与 Bytecode 都跑被点名的函数,不回退到 `# main`。默认只执行纯函数。`--json` 给 Agent 读取结果或诊断。说明与价值见 [22-函数调用](public/features/22-函数调用.mq.md)。示例:`marqdo call examples/calculator.mq.md 计算器.加法 a=2 b=3` → `5`。扩展包同步 **2.2.1** - **Agent 可靠工作台(v2.1.5)**:ResourceView(JSON/CSV/PDF/image)· ToolSpec 授权先于调用 · CheckpointV2 / EffectLedger / ContextPackV2 · EKC `ir.json` 暖机与 `--refresh` · Web 短读/控制与 execute 槽隔离;扩展包同步 **2.1.5** - **默认隔离 HTTP execute(v2.1.4 · ADR 0009)**:`execute` / `sse-live` / `stream:true` → Supervisor worker 池(`--call-lib-path`);父进程不再占 `INVOKE_LOCK`;`/_runtime/*`;`runtime.isolated_execution=1`;MR-01 金样例 - **知识工作台运行时(v2.1.3)**:ModelSelection / RunContext / usage null≠0 · `view document` 只读嵌入 · LLM selection/messages/cancel · agent.step selection e2e · live smoke(设计 Partial:原生适配器 unavailable) @@ -329,7 +330,7 @@ marqdo catalog public -o .marqdo - **浏览器 Marqdo(WASM)**:`marqdo wasm build` + 官方 bridge 自启(作者零业务 JS;桥内可含列表/路由/storage/ws/文件/Canvas/音频/Observer/拖放);`lib/browser` + GFM;`web.client_embed`;示例 [browser-hello](examples/browser-hello/) · [browser-app](examples/browser-app/) · [browser-media](examples/browser-media/) · [web-client-site](examples/web-client-site/)([ADR 0002](doc/adr/0002-browser-marqdo-wasm.md) · [D](doc/roadmap/browser-wasm-d.md) · [E](doc/roadmap/browser-wasm-e.md) · [F](doc/roadmap/browser-wasm-f.md)) - 选型:[ADR 0001 — Rust](doc/adr/0001-implementation-language.md) · [ADR 0002 — 浏览器 WASM](doc/adr/0002-browser-marqdo-wasm.md)(C0–C5 完结,见 [roadmap/browser-wasm.md](doc/roadmap/browser-wasm.md))· [ADR 0003 — 异步效应](doc/adr/0003-browser-async-effects.md) -### 如何使用最新 Marqdo(v2.2.0) +### 如何使用最新 Marqdo(v2.2.1) **安装解释器(任选其一)** @@ -344,7 +345,7 @@ marqdo catalog public -o .marqdo ```bash # 1) 源码安装(跟 tag 或 main) git clone https://github.com/cflmy/marqdo.git && cd marqdo -git checkout v2.2.0 # 或留在 main +git checkout v2.2.1 # 或留在 main cargo build --release export PATH="$PWD/target/release:$PATH" marqdo version @@ -385,7 +386,7 @@ marqdo wasm build # → dist/wasm/ … 见 examples/browser-hello/ # 6) Releases:Windows exe/zip/vsix;Linux CLI zip + native `.so` zip -# https://github.com/cflmy/marqdo/releases/tag/v2.2.0 +# https://github.com/cflmy/marqdo/releases/tag/v2.2.1 ``` 开发期也可用 `cargo run -- …` 代替已安装的 `marqdo`: diff --git a/crates/marqdo-wasm/Cargo.toml b/crates/marqdo-wasm/Cargo.toml index c302846..45bef61 100644 --- a/crates/marqdo-wasm/Cargo.toml +++ b/crates/marqdo-wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "marqdo-wasm" -version = "2.2.0" +version = "2.2.1" edition = "2021" license = "Apache-2.0" description = "Marqdo interpreter as WebAssembly (browser host bridge)" diff --git a/debian/changelog b/debian/changelog index acfdffd..d36f1aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +marqdo (2.2.1-1ppa1) noble; urgency=medium + + * Marqdo 2.2.1: fix view/static-export outline rail under document + (occlusion doc-block close + panel container query layout). + + -- Marqdo Maintainers Fri, 30 Oct 2026 11:45:00 +0800 + marqdo (2.2.0-1ppa1) noble; urgency=medium * Marqdo 2.2.0: marqdo call runs one named function in any .mq.md. diff --git a/ext/VERSION b/ext/VERSION index ccbccc3..c043eea 100644 --- a/ext/VERSION +++ b/ext/VERSION @@ -1 +1 @@ -2.2.0 +2.2.1 diff --git a/src/view/document.rs b/src/view/document.rs index 22a4805..5e110eb 100644 --- a/src/view/document.rs +++ b/src/view/document.rs @@ -916,6 +916,17 @@ fn render_line_block( if let Some(body) = writeback_body { s.push_str(&crate::view::render::render_output_card(line_no, body)); } + // Must close `.doc-block` — an early return left the wrapper open and + // nested the Functions/Variables outline under the document surface. + let band_annots: Vec = annots + .iter() + .filter(|a| !is_noisy_result_chip(a)) + .map(|a| (*a).clone()) + .collect(); + if !band_annots.is_empty() { + s.push_str(&render_annot_band(&band_annots, MAX_VISIBLE_ANNOTS)); + } + s.push_str(""); return s; } if bits.is_empty() { @@ -1545,6 +1556,52 @@ When we meet `who`, we **print text="Hi, `who`!"** and close with*None*. } } +#[cfg(test)] +mod occl_render_tests { + use super::render_module_document; + + fn div_balance(html: &str) -> i32 { + let mut depth = 0i32; + let b = html.as_bytes(); + let mut i = 0usize; + while i + 3 < b.len() { + if b[i] == b'<' { + if i + 4 <= b.len() && &b[i..i + 4] == b"')) { + depth += 1; + } else if i + 6 <= b.len() && &b[i..i + 6] == b"" { + depth -= 1; + } + } + i += 1; + } + depth + } + + #[test] + fn occlusion_line_closes_doc_block() { + let src = r#"--- +markup: occlusion +--- + +# main + +`v` = [描述](1) +"#; + let module = crate::parse::parse_source(src).unwrap(); + let html = render_module_document(&module, src, &[]); + assert!(html.contains("doc-occl"), "{html}"); + assert_eq!( + div_balance(&html), + 0, + "occlusion must not leave .doc-block open: {html}" + ); + assert!( + html.contains("doc-occl") && html.contains(""), + "doc-block around occlusion must close: {html}" + ); + } +} + #[cfg(test)] mod occl_split_tests { use super::split_occlusion; diff --git a/src/view/html.rs b/src/view/html.rs index b74d6e5..bb9694d 100644 --- a/src/view/html.rs +++ b/src/view/html.rs @@ -237,6 +237,11 @@ a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; } min-width: 0; overflow: auto; background: var(--bg); + /* Content-pane width (excludes file nav) drives outline stacking — not the + * viewport. A 960px viewport media query wrongly put Functions/Variables + * under a tall Structure while the left nav was still visible. */ + container-type: inline-size; + container-name: mq-panel; } main.panel { padding: 2rem 2.25rem 3.5rem; @@ -719,9 +724,17 @@ body.notebook-page .exec-clear:hover { border-color: var(--nb-accent); color: va gap: 0.75rem; align-items: start; } -@media (max-width: 960px) { +/* Stack only when the *panel* is too narrow for Structure + outline rail. + * Prefer keeping the rail beside the doc at tablet widths (matches ≤800px + * shell collapse in doc/design/view.md). When stacked, pull the rail above + * so it is not buried under a long document. */ +@container mq-panel (max-width: 32rem) { .struct-wrap { grid-template-columns: 1fr; } - .outline-rail, .outline-panel { position: static; } + .outline-rail { + order: -1; + position: static; + } + .outline-panel { position: static; } } .outline-rail { position: sticky; @@ -4527,6 +4540,25 @@ mod plan_card_tests { mod tests { use super::*; + #[test] + fn outline_rail_stacks_by_panel_container_not_960_viewport() { + let css = stylesheet(); + assert!( + css.contains("container-name: mq-panel"), + "panel-wrap should be a size container for outline layout" + ); + assert!( + css.contains("@container mq-panel (max-width: 32rem)"), + "outline must stack from panel width, not a mid-width viewport media query" + ); + assert!( + !css.contains("@media (max-width: 960px) {\n .struct-wrap"), + "960px viewport media wrongly buried the outline under Structure" + ); + let html = layout("t", "

nav

", "

main

"); + assert!(html.contains("container-name: mq-panel"), "{html}"); + } + #[test] fn notebook_ui_has_controls() { let ui = notebook_ui();