From 4da07c1b2697eef34fc5753aec4273ee00719de0 Mon Sep 17 00:00:00 2001 From: cflmy Date: Sun, 18 Oct 2026 13:59:24 +0800 Subject: [PATCH] fix(view): do not turn documentation tables into call chips MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep descriptive table labels non-callable and suppress call annotations on table blocks. This removes the collapsed call {步骤...} chip while preserving the table and the return 950 chips at the actual foreign/writeback calls. --- public/features/21-persistence.mq.md | 4 ++-- public/features/21-持久化.mq.md | 4 ++-- src/view/document.rs | 10 ++++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/public/features/21-persistence.mq.md b/public/features/21-persistence.mq.md index e0071e2..af85d59 100644 --- a/public/features/21-persistence.mq.md +++ b/public/features/21-persistence.mq.md @@ -25,8 +25,8 @@ For an exploratory or audit document, pair `foreign` with `lib/writeback`. `writ | Step | What it does | |------|--------------| -| foreign.run / foreign.session | Execute the foreign code and return a Marqdo value | -| writeback.record | Persist that value in a named slot | +| Foreign run / Foreign session | Execute the foreign code and return a Marqdo value | +| Writeback record | Persist that value in a named slot | | git diff | Review the changed result like any other document change | A real writeback in this page. diff --git a/public/features/21-持久化.mq.md b/public/features/21-持久化.mq.md index 6a751de..8036fd4 100644 --- a/public/features/21-持久化.mq.md +++ b/public/features/21-持久化.mq.md @@ -25,8 +25,8 @@ import writeback:lib/writeback.mq.md | 步骤 | 作用 | |------|------| -| 外联.运行 / 外联.会话 | 执行外联代码并返回 Marqdo 值 | -| writeback.record | 把该值持久化到命名槽位 | +| 外联执行 / 外联会话 | 执行外联代码并返回 Marqdo 值 | +| 写回记录 | 把该值持久化到命名槽位 | | git diff | 像审阅普通文档改动一样审阅结果 | 这一页本身就是完整示例。 diff --git a/src/view/document.rs b/src/view/document.rs index 43c7d92..96c225d 100644 --- a/src/view/document.rs +++ b/src/view/document.rs @@ -342,8 +342,14 @@ fn render_table_block( html.push_str(""); // Annots on first table line (bind of collection). if let Some(list) = by_line.get(&first_line) { - if !list.is_empty() { - let owned: Vec = list.iter().map(|a| (*a).clone()).collect(); + // A table is already its own readable value; a call chip would collapse + // the whole collection into an ellipsis. Keep only non-call chips. + let owned: Vec = list + .iter() + .filter(|a| a.kind != crate::view::annot::AnnotKind::Call) + .map(|a| (*a).clone()) + .collect(); + if !owned.is_empty() { html.push_str(&render_annot_band(&owned, MAX_VISIBLE_ANNOTS)); } }