git.lucas.co / cce-files
file manager
git clone https://git.lucas.co/cce-files.git

commit261b3b7ee902589775212f04b4f38663b9979638
parent9706c7359c
authorLucas Galante <[email protected]>
date2026-07-07 17:33
fix: stop breadcrumb double-render leaking behind the view dropdown

BrowseContainer painted the breadcrumb at full width in the container/root_window pass while pages/browse::view re-renders it narrower (with the view dropdown beside it) on top — so the container's copy leaked a dark strip behind the dropdown and page margins. Position the container's breadcrumb to match browse::view's layout so it sits fully occluded.

Stop-gap ahead of the single paint path (see cce-ui docs/rfc-core-rebuild.md, Phase 3).

Co-Authored-By: Claude Opus 4.8 <[email protected]>

 src/main.rs | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs
index 20d9211..be4cb08 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -201,7 +201,19 @@ impl cce_ui::widget::Element for BrowseContainer {
         let textbox_h = 24.0;
 
         unsafe {
-            (*self.breadcrumb).set_rect(x, y, w, breadcrumb_h);
+            // pages/browse::view re-renders the breadcrumb and the view dropdown on top of this
+            // container's paint. Position the breadcrumb here to EXACTLY match that layout
+            // (inset by the page margin, reserving the dropdown's width beside it) so this
+            // container's copy sits fully behind the page copy instead of leaking a dark strip
+            // behind the dropdown and margins. Keep these constants in sync with pages/browse.rs.
+            let page_margin = 12.0;
+            let dropdown_w = 120.0;
+            let page_breadcrumb_h = 24.0;
+            let inner_x = x + page_margin;
+            let inner_y = y + page_margin;
+            let inner_w = w - 2.0 * page_margin;
+            let bc_w = inner_w - dropdown_w - gap;
+            (*self.breadcrumb).set_rect(inner_x, inner_y, bc_w, page_breadcrumb_h);
             let list_h = if self.select_mode {
                 h - breadcrumb_h - textbox_h - 2.0 * gap
             } else {