refactor: remove config file location display feature

Remove the config file location display from settings dialog to simplify
the user interface. Users who need to access the config file can still do
so through the advanced settings section.

Changes:
- Removed ConfigPathDisplay component and its usage
- Removed configPath and openConfigFolder from useSettings hook
- Removed configPath and openConfigFolder from useSettingsMetadata hook
- Removed related i18n keys: configFileLocation, openFolder
- Updated settings dialog to remove the config path display section

This simplifies the settings UI while maintaining access to config
directory management through the advanced settings tab.
This commit is contained in:
Jason
2025-10-17 23:46:44 +08:00
parent e6b66f425a
commit 5ebe23abc8
6 changed files with 1 additions and 90 deletions

View File

@@ -1,41 +0,0 @@
import { FolderOpen } from "lucide-react";
import { Button } from "@/components/ui/button";
import { useTranslation } from "react-i18next";
interface ConfigPathDisplayProps {
path: string;
onOpen: () => Promise<void> | void;
}
export function ConfigPathDisplay({ path, onOpen }: ConfigPathDisplayProps) {
const { t } = useTranslation();
return (
<section className="space-y-2">
<header className="space-y-1">
<h3 className="text-sm font-medium">
{t("settings.configFileLocation")}
</h3>
<p className="text-xs text-muted-foreground">
{t("settings.configFileLocationHint", {
defaultValue: "显示当前使用的配置文件路径。",
})}
</p>
</header>
<div className="flex items-center gap-2">
<span className="flex-1 truncate rounded-md border border-dashed border-border bg-muted/40 px-3 py-2 text-xs font-mono">
{path || t("common.loading")}
</span>
<Button
type="button"
variant="outline"
size="icon"
onClick={onOpen}
title={t("settings.openFolder")}
>
<FolderOpen className="h-4 w-4" />
</Button>
</div>
</section>
);
}

View File

@@ -13,7 +13,6 @@ import { Button } from "@/components/ui/button";
import { settingsApi } from "@/lib/api";
import { LanguageSettings } from "@/components/settings/LanguageSettings";
import { WindowSettings } from "@/components/settings/WindowSettings";
import { ConfigPathDisplay } from "@/components/settings/ConfigPathDisplay";
import { DirectorySettings } from "@/components/settings/DirectorySettings";
import { ImportExportSection } from "@/components/settings/ImportExportSection";
import { AboutSection } from "@/components/settings/AboutSection";
@@ -38,7 +37,6 @@ export function SettingsDialog({
isLoading,
isSaving,
isPortable,
configPath,
appConfigDir,
resolvedDirs,
updateSettings,
@@ -48,7 +46,6 @@ export function SettingsDialog({
browseAppConfigDir,
resetDirectory,
resetAppConfigDir,
openConfigFolder,
saveSettings,
resetSettings,
requiresRestart,
@@ -208,10 +205,6 @@ export function SettingsDialog({
settings={settings}
onChange={updateSettings}
/>
<ConfigPathDisplay
path={configPath}
onOpen={openConfigFolder}
/>
</>
) : null}
</TabsContent>