From a23cd5abfe5909016b059bb67631b4a5deccf5f6 Mon Sep 17 00:00:00 2001 From: landon Date: Wed, 26 Aug 2026 19:53:27 -0500 Subject: [PATCH] Lay the preview pane out down the page, not across it The preview rendered the whole document as one clipped line running off the right edge. An egui child `Ui` inherits its parent's layout, and `ScrollArea` passes that layout straight through to its content. Both columns were allocated with `allocate_ui` inside `horizontal_top`, so the preview's content ui was left-to-right: every `ui.label` in `render_preview` was placed beside the previous one instead of below it. The editor escaped notice because it is a single `TextEdit` widget, so a horizontal layout looks the same. Allocate both columns with an explicit top-down layout instead. The editor did not need it, but leaving one column implicit is how this would come back. Verified by running the app against an isolated config before and after: the old binary shows "Title: The Opening Slug: opening Rough Dra..." on one line; the new one wraps paragraphs to the column and sizes headings. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_017GLYKcrX18ytCCuKozDXk6 --- src/app/ui.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/ui.rs b/src/app/ui.rs index 7975863..0e5fb06 100644 --- a/src/app/ui.rs +++ b/src/app/ui.rs @@ -546,13 +546,18 @@ impl App { if self.config.show_preview { // Editor + read-only source-ish preview side by side. let full = ui.available_size(); + // Both columns need an explicit top-down layout: a child + // `Ui` inherits its parent's, and inside `horizontal_top` + // that is left-to-right, which would run every paragraph + // of the preview onto one line. + let down = egui::Layout::top_down(egui::Align::Min); ui.horizontal_top(|ui| { let col_w = full.x / 2.0 - 6.0; - ui.allocate_ui(egui::vec2(col_w, full.y), |ui| { + ui.allocate_ui_with_layout(egui::vec2(col_w, full.y), down, |ui| { self.editor(ui); }); ui.separator(); - ui.allocate_ui(egui::vec2(col_w, full.y), |ui| { + ui.allocate_ui_with_layout(egui::vec2(col_w, full.y), down, |ui| { egui::ScrollArea::vertical() .id_salt("preview") .auto_shrink([false, false])