Skip to content

Commit 55778d5

Browse files
codewizdaveclaude
andcommitted
fix(ui): fix z-order - panel must be above overlay
Critical fix: The slide-in panel was appearing behind the overlay, causing a black screen with only a weird card visible. The problem was widget creation order: - Before: Overlay created first, then panel - After: Panel positioned first, then overlay, then panel lifted Changes: - Position panel BEFORE creating overlay - Create overlay AFTER panel is positioned - Call lift() AFTER both are created to ensure panel is on top This ensures proper z-order where: - Overlay is at the bottom (dims background) - Panel is above overlay (visible and interactive) Fixes: Black screen covering entire application Related: #14 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent f26835f commit 55778d5

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

src/ui_ctk/components/slide_in_panel.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,21 @@ def show(self):
110110
if self._visible:
111111
return # Already visible
112112

113-
# Create overlay (dims the background)
113+
# Position panel FIRST (before overlay)
114+
# This ensures panel is in the widget hierarchy
115+
parent_width = self.parent.winfo_width()
116+
panel_width = self.cget('width')
117+
118+
# Position panel at right edge
119+
self.place(
120+
relx=1.0, # Right edge of parent
121+
x=-panel_width, # Move left by panel width
122+
y=60, # Below navigation bar
123+
relheight=1.0,
124+
anchor="nw", # Northwest anchor (top-left of panel)
125+
)
126+
127+
# THEN create overlay (dims the background)
114128
self.overlay = ctk.CTkFrame(
115129
self.parent,
116130
fg_color=("gray20", "#101010"),
@@ -128,26 +142,12 @@ def show(self):
128142
# Escape key binding not available, that's OK
129143
self._esc_binding = None
130144

131-
# Position panel on the right side
132-
# We place it at the right edge with fixed width
133-
parent_width = self.parent.winfo_width()
134-
panel_width = self.cget('width')
135-
136-
# Position panel at right edge (anchor northeast means x,y is the northeast corner)
137-
self.place(
138-
relx=1.0, # Right edge of parent
139-
x=-panel_width, # Move left by panel width
140-
y=60, # Below navigation bar
141-
relheight=1.0,
142-
anchor="nw", # Northwest anchor (top-left of panel)
143-
)
145+
# CRITICAL: Lift panel ABOVE overlay
146+
self.lift()
144147

145148
# Mark as visible
146149
self._visible = True
147150

148-
# Bring to front
149-
self.lift()
150-
151151
def close(self):
152152
"""Close the panel and remove overlay.
153153

0 commit comments

Comments
 (0)