From 2ccbd0bbea8bdeefd13b5790bd25efcac34f6e2f Mon Sep 17 00:00:00 2001 From: can1357 Date: Wed, 17 Jun 2026 09:24:19 +0200 Subject: [PATCH] fix: skipped oversized spans while continuing BFS summary unfolding - Changed `select_folded_spans` to skip an unfold candidate that exceeded `unfold_limit` and continue processing the remaining BFS queue instead of breaking. - Added a regression test in `summary.rs` proving a large `\n\n\n
\n{sections}\n
\n\n\n" + ); + + let result = summarize_with_unfold(&code, "page.html", 50, 100); + assert!(result.parsed); + assert!(result.elided); + let kept_text = result + .segments + .iter() + .filter(|s| s.kind == "kept") + .filter_map(|s| s.text.as_deref()) + .collect::>() + .join("\n"); + // The body div was unfolded: its child
structure is visible. + assert!( + kept_text.contains("
"), + "body div should unfold to show sections" + ); + assert!( + kept_text.contains("
"), + "all sibling sections should surface" + ); + // The ` plus `
...
`, collapsing the document body into one dead `...`. An overflowing span is now skipped (left folded, its subtree unexplored) and the BFS keeps unfolding the remaining queued siblings, so structured siblings like the `` DOM are revealed up to `unfoldLimit` while the oversized leaf stays folded. + ## [16.0.2] - 2026-06-16 ### Added