Compare commits

...
1 Commits
Author SHA1 Message Date
Hunter Bown 84f731c38d fix: Black text on black background (#7043)
Produced by CodeWhale running in a Boat VM. Untested.
2026-10-24 22:29:51 -07:00
3 changed files with 41 additions and 2 deletions

No files matched your search

+1
View File
@@ -487,6 +487,7 @@ impl HistoryCell {
} else {
options.thinking_preview_lines
},
options.palette_mode,
);
fold_action = expandable.then_some(if collapsed {
CellFoldAction::Expand
+19 -2
View File
@@ -116,6 +116,7 @@ pub(crate) fn render_thinking_with_analysis(
highlight,
Locale::En,
THINKING_COMPLETED_PREVIEW_LINE_LIMIT,
palette::PaletteMode::detect(),
)
}
@@ -130,6 +131,7 @@ pub(crate) fn render_thinking_with_preview_limit(
highlight: bool,
locale: Locale,
completed_preview_lines: usize,
palette_mode: palette::PaletteMode,
) -> (Vec<Line<'static>>, bool) {
let state = thinking_visual_state(streaming, duration_secs);
let style = thinking_style();
@@ -173,11 +175,17 @@ pub(crate) fn render_thinking_with_preview_limit(
streaming,
body_style,
completed_preview_lines,
palette_mode,
)
} else if content.trim().is_empty() {
(Vec::new(), false)
} else {
let body = markdown_render::render_markdown(content, content_width, body_style);
let body = markdown_render::render_markdown_with_palette(
content,
content_width,
body_style,
palette_mode,
);
// The collapse affordance mirrors the collapsed preview's "more than
// the preview would show" test, derived from this single render
// instead of rendering the preview too: streaming content outgrows
@@ -233,6 +241,7 @@ fn collapsed_thinking_body(
streaming: bool,
style: Style,
completed_preview_lines: usize,
palette_mode: palette::PaletteMode,
) -> (Vec<Line<'static>>, bool) {
if !streaming && completed_preview_lines == 0 {
return (Vec::new(), !content.trim().is_empty());
@@ -271,7 +280,12 @@ fn collapsed_thinking_body(
let mut lines = if render_source.trim().is_empty() {
Vec::new()
} else {
markdown_render::render_markdown(render_source, width.saturating_sub(3).max(1), style)
markdown_render::render_markdown_with_palette(
render_source,
width.saturating_sub(3).max(1),
style,
palette_mode,
)
};
let truncated = lines.len() > limit;
if truncated {
@@ -479,6 +493,7 @@ mod tests {
false,
Locale::En,
THINKING_COMPLETED_PREVIEW_LINE_LIMIT,
palette::PaletteMode::Dark,
);
assert!(expandable, "a long streaming body must offer expand");
// header (including the affordance) + three preview rows
@@ -509,6 +524,7 @@ mod tests {
false,
Locale::En,
THINKING_COMPLETED_PREVIEW_LINE_LIMIT,
palette::PaletteMode::Dark,
);
// Code rows carry the two-space code prefix after the rail; if the
// tail slice started inside the open fence they would render as
@@ -540,6 +556,7 @@ mod tests {
false,
Locale::En,
THINKING_COMPLETED_PREVIEW_LINE_LIMIT,
palette::PaletteMode::Dark,
);
assert_eq!(
markdown_render::parse_invocation_count(),
+21
View File
@@ -965,6 +965,27 @@ pub fn render_markdown(content: &str, width: u16, base_style: Style) -> Vec<Line
render_parsed(&parsed, width, base_style)
}
/// Convenience wrapper: parse + render with an explicit UI palette mode.
///
/// The live transcript's reasoning/thinking and archived-context bodies use
/// this so a code fence inside those cells follows the selected theme rather
/// than terminal/OS auto-detection. On a dark community theme (Shoreline) the
/// auto-detected mode can be Light, which would otherwise select a light
/// syntax theme and paint dark code text onto the dark surface.
#[must_use]
pub(crate) fn render_markdown_with_palette(
content: &str,
width: u16,
base_style: Style,
palette_mode: palette::PaletteMode,
) -> Vec<Line<'static>> {
let parsed = parse(content);
render_parsed_tagged_with_palette(&parsed, width, base_style, palette_mode)
.into_iter()
.map(|line| line.line)
.collect()
}
/// Convenience wrapper: parse + render while keeping per-line source metadata.
#[cfg(test)]
#[must_use]