fix(view): group and theme writeback blocks

Render contiguous writeback comment lines as one block, and map output-card/writeback tokens to the View dark theme. Static and live pages no longer show three dashed fragments or light output cards on dark.
This commit is contained in:
cflmy committed 2026-10-18 13:51:11 +08:00
1 parent ab6648ae0e
commit 92b91ffc81
2 files changed
+43 -9

No files matched your search

+10 -3
View File
@@ -101,11 +101,18 @@ pub fn render_module_document(module: &Module, source: &str, annots: &[ViewAnnot
}
LineKind::Writeback => {
flush_para(&mut para, &mut out);
let start_line = l.line_no;
let mut block = String::new();
while i < lines.len() && matches!(lines[i].kind, LineKind::Writeback) {
if !block.is_empty() {
block.push('\n');
}
block.push_str(lines[i].text.trim_end_matches(['\r', '\n']));
i += 1;
}
out.push_str(&crate::view::render::render_writeback_source_line(
l.line_no,
l.text.trim_end_matches(['\r', '\n']),
start_line, &block,
));
i += 1;
}
LineKind::Comment => {
let text = l.text.trim_end_matches(['\r', '\n']);