fix(ui): prevent header layout shift when switching views

Add min-height to right-side button container and ml-auto to add buttons
in MCP/Prompts views to maintain consistent header height and button
position across all views.
This commit is contained in:
Jason
2025-12-21 16:23:47 +08:00
parent 26c3f05daf
commit bf570b6d2a
+3 -3
View File
@@ -496,14 +496,14 @@ function App() {
</div> </div>
<div <div
className="flex items-center gap-2" className="flex items-center gap-2 min-h-[40px]"
style={{ WebkitAppRegion: "no-drag" } as any} style={{ WebkitAppRegion: "no-drag" } as any}
> >
{currentView === "prompts" && ( {currentView === "prompts" && (
<Button <Button
size="icon" size="icon"
onClick={() => promptPanelRef.current?.openAdd()} onClick={() => promptPanelRef.current?.openAdd()}
className={addActionButtonClass} className={`ml-auto ${addActionButtonClass}`}
title={t("prompts.add")} title={t("prompts.add")}
> >
<Plus className="w-5 h-5" /> <Plus className="w-5 h-5" />
@@ -513,7 +513,7 @@ function App() {
<Button <Button
size="icon" size="icon"
onClick={() => mcpPanelRef.current?.openAdd()} onClick={() => mcpPanelRef.current?.openAdd()}
className={addActionButtonClass} className={`ml-auto ${addActionButtonClass}`}
title={t("mcp.unifiedPanel.addServer")} title={t("mcp.unifiedPanel.addServer")}
> >
<Plus className="w-5 h-5" /> <Plus className="w-5 h-5" />