fix: unify dialog layout and fix content padding issues

- Fix negative margin overflow in all dialog content areas
- Standardize dialog structure with flex-col layout
- Add consistent py-4 spacing to all content areas
- Ensure proper spacing between header, content, and footer

Affected components:
- AddProviderDialog, EditProviderDialog
- McpFormModal, McpPanel
- UsageScriptModal
- SettingsDialog

All dialogs now follow unified layout pattern:
- DialogContent: flex flex-col max-h-[90vh]
- Content area: flex-1 overflow-y-auto px-6 py-4
- No negative margins that cause content overflow
This commit is contained in:
Jason
2025-10-18 16:52:02 +08:00
parent 404297cd30
commit 57552b3159
31 changed files with 306 additions and 208 deletions

View File

@@ -66,10 +66,9 @@ export function useMcpActions(appType: AppType): UseMcpActionsResult {
try {
await mcpApi.setEnabled(appType, id, enabled);
toast.success(
enabled ? t("mcp.msg.enabled") : t("mcp.msg.disabled"),
{ duration: 1500 },
);
toast.success(enabled ? t("mcp.msg.enabled") : t("mcp.msg.disabled"), {
duration: 1500,
});
} catch (error) {
// Rollback on failure
setServers(previousServers);

View File

@@ -4,10 +4,7 @@ import { toast } from "sonner";
import { settingsApi, type AppType } from "@/lib/api";
import { useSettingsQuery, useSaveSettingsMutation } from "@/lib/query";
import type { Settings } from "@/types";
import {
useSettingsForm,
type SettingsFormState,
} from "./useSettingsForm";
import { useSettingsForm, type SettingsFormState } from "./useSettingsForm";
import {
useDirectorySettings,
type ResolvedDirectories,

View File

@@ -33,10 +33,7 @@ export function useSettingsMetadata(): UseSettingsMetadataResult {
setIsPortable(portable);
} catch (error) {
console.error(
"[useSettingsMetadata] Failed to load metadata",
error,
);
console.error("[useSettingsMetadata] Failed to load metadata", error);
} finally {
if (active) {
setIsLoading(false);