From fcd6ea46ce5fb9fb098a615514a7b0d012d41f17 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sat, 29 Aug 2026 11:00:47 -0700 Subject: [PATCH] refactor(ui): keep the log drawer's trace sidebar in flow as a collapsed rail The toggle was absolutely positioned over the drawer's flex row, owned by neither column. That forced two coupled workarounds: a stacking level so it could beat whatever it landed on, and pl-12 on the sidebar header to reserve space for a button that was not its child. The sidebar column now always renders, at 224px expanded and a 40px rail collapsed, and the toggle is a normal in-flow child of the column it controls. No absolute, no z-index, no reserved padding, and nothing that can paint over the button. It also stops the toggle from clipping the provider logo, which it did in the collapsed state even before the z-index scale landed. Costs 40px of drawer width while collapsed. --- .../LogDetailsDrawer/LogDetailsDrawer.tsx | 181 +++++++++--------- 1 file changed, 94 insertions(+), 87 deletions(-) diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx index c1e01d4d0ba..511e1a18253 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/LogDetailsDrawer.tsx @@ -30,6 +30,7 @@ export interface LogDetailsDrawerProps { } const SIDEBAR_WIDTH_PX = 224; +const SIDEBAR_RAIL_WIDTH_PX = 40; // Session logs are fetched page-by-page from the paginated backend and // accumulated so the drawer can show the whole session. page_size is the @@ -312,98 +313,104 @@ export function LogDetailsDrawer({ {logEntry?.request_id ? `Request ${logEntry.request_id} details` : "Request details"} -
- - {!isSidebarCollapsed && ( -
-
-
-
-
- {isSessionMode ? "Session" : "Trace"} -
-
- {leftPanelDisplayId} - -
+
+ + {!isSidebarCollapsed && ( +
+
+ {isSessionMode ? "Session" : "Trace"}
-
-
- {logsForList.length} req - {[ - isSessionMode - ? llmCount - : logsForList.filter( - (row) => !MCP_CALL_TYPES.includes(row.call_type) && !AGENT_CALL_TYPES.includes(row.call_type), - ).length, - isSessionMode - ? agentCount - : logsForList.filter((row) => AGENT_CALL_TYPES.includes(row.call_type)).length, - isSessionMode - ? mcpCount - : logsForList.filter((row) => MCP_CALL_TYPES.includes(row.call_type)).length, - ].map((count, i) => { - const label = [" LLM", " Agent", " MCP"][i]; - return count > 0 ? ( - +
+ {leftPanelDisplayId} + +
+
+ {logsForList.length} req + {[ + isSessionMode + ? llmCount + : logsForList.filter( + (row) => + !MCP_CALL_TYPES.includes(row.call_type) && !AGENT_CALL_TYPES.includes(row.call_type), + ).length, + isSessionMode + ? agentCount + : logsForList.filter((row) => AGENT_CALL_TYPES.includes(row.call_type)).length, + isSessionMode + ? mcpCount + : logsForList.filter((row) => MCP_CALL_TYPES.includes(row.call_type)).length, + ].map((count, i) => { + const label = [" LLM", " Agent", " MCP"][i]; + return count > 0 ? ( + + · + {count} + {label} + + ) : null; + })} + · + {isSessionMode ? getSpendString(totalSessionCost) : getSpendString(currentLog.spend || 0)} + {isSessionMode && ( + <> · - {count} - {label} - - ) : null; - })} - · - {isSessionMode ? getSpendString(totalSessionCost) : getSpendString(currentLog.spend || 0)} + {sessionDurationSeconds}s + + )} +
{isSessionMode && ( - <> - · - {sessionDurationSeconds}s - +
+ {cacheHitCount}/{logsForList.length} cached +
+ )} + {isSessionMode && sessionTruncated && ( +
+ Showing most recent {logsForList.length} of {sessionTotalCount} +
+ )} + {isSessionMode && ( + setSessionSortMode(value as SessionLogSortMode)} + > + + + Duration + + + Start time + + + )}
- {isSessionMode && ( -
- {cacheHitCount}/{logsForList.length} cached -
- )} - {isSessionMode && sessionTruncated && ( -
- Showing most recent {logsForList.length} of {sessionTotalCount} -
- )} - {isSessionMode && ( - setSessionSortMode(value as SessionLogSortMode)} - > - - - Duration - - - Start time - - - - )} -
+ )} +
+ {!isSidebarCollapsed && (
{normalizeGuardrailEntries(metadata?.guardrail_information).length > 0 && (
@@ -447,8 +454,8 @@ export function LogDetailsDrawer({
)}
-
- )} + )} +