Skip to content

Commit d567876

Browse files
guidooswaldDBclaude
andcommitted
Fix Load All button disappearing on second Execute
Remove clientside reparenting callback that moved Load All into response-container (destroyed on re-render). Button now uses absolute positioning in response-panel so it survives content replacements. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ee21d89 commit d567876

3 files changed

Lines changed: 6 additions & 21 deletions

File tree

app.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,6 @@ def build_response_panel(result: Dict[str, Any], chips: Optional[List] = None) -
546546
color=status_color, className="status-badge"),
547547
html.Span(f"{ms:,}ms", className="timing-label font-mono ms-2"),
548548
html.Span(item_count, className="timing-label") if item_count else None,
549-
# Anchor point for the absolutely-positioned Load All button
550-
html.Span(id="load-all-anchor", className="load-all-anchor"),
551549
html.Span(result.get("url", ""), className="response-url ms-auto"),
552550
], className="response-meta"),
553551
html.Div(body_children, className="response-body"),
@@ -2237,23 +2235,6 @@ def update_curl_display(last_req, conn_config):
22372235
)
22382236

22392237

2240-
# Reparent the Load All button into the response-meta bar after each render
2241-
app.clientside_callback(
2242-
"""
2243-
function(children, style) {
2244-
var anchor = document.getElementById('load-all-anchor');
2245-
var btn = document.getElementById('sp-load-all-btn');
2246-
if (anchor && btn) {
2247-
anchor.appendChild(btn);
2248-
}
2249-
return window.dash_clientside.no_update;
2250-
}
2251-
""",
2252-
Output("sp-load-all-btn", "className"),
2253-
Input("response-container", "children"),
2254-
Input("sp-load-all-btn", "style"),
2255-
prevent_initial_call=True,
2256-
)
22572238

22582239

22592240
# ── Entry point ───────────────────────────────────────────────────────────────

assets/style.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,11 @@ body {
614614
border-radius: 3px;
615615
}
616616
.sp-toggle:hover { color: var(--cyan); background: rgba(0,212,255,0.08); }
617-
.load-all-anchor { display: inline; }
618617
.sp-load-all-btn {
618+
position: absolute;
619+
top: 8px;
620+
left: 220px;
621+
z-index: 5;
619622
background: rgba(0,212,255,0.1);
620623
border: 1px solid rgba(0,212,255,0.25);
621624
color: var(--cyan);
@@ -626,6 +629,7 @@ body {
626629
border-radius: 3px;
627630
white-space: nowrap;
628631
transition: all 0.15s;
632+
display: flex;
629633
align-items: center;
630634
}
631635
.sp-load-all-btn:hover {

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
382
1+
385

0 commit comments

Comments
 (0)