refactor(settings): relocate profile-path + secret-backend diagnostics into Data tab
Profile path and secret backend are **read-only diagnostic facts** — they tell you which directory the profile lives in and which keystore ciphertexts are stored against. They are not preferences; they do not belong in the General tab alongside the theme / language / auto-update controls. Moved both into a new "Profile" group inside the Data tab, rendered via a small `ReadOnlyRow` helper so both pieces of information share consistent bordered-card styling and get a clear label/value split. General tab now contains only the three actual preferences (theme, language, updater) + the inline updater hint. The previous General rendering dropped profile path as raw mono text under the updater checkbox — visually tangled with the preference control. With diagnostics in Data and preferences in General, each tab reads with a single purpose. No new i18n keys required — reused `exec.profile` / `exec.profilePath` / `exec.secretBackend`, which were already translated in zh + en. Follow-up polish; no behavioral change. Typecheck + lint pass.
This commit is contained in:
1 parent
03bcc8a8f0
commit
1933fd6192
3 files changed
+13
-9
No files matched your search
@@ -96,7 +96,6 @@ export function SettingsShell({ snapshot, secrets, companyId, onSaved }: Setting
|
||||
<div>
|
||||
{activeTab === "general" ? (
|
||||
<GeneralSection
|
||||
snapshot={snapshot}
|
||||
theme={theme}
|
||||
setTheme={setTheme}
|
||||
selectedLocale={selectedLocale}
|
||||
|
||||
@@ -113,11 +113,21 @@ export function DataSection({ snapshot, onSaved }: DataSectionProps) {
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Eyebrow className="mb-3">{t("exec.secretBackend")}</Eyebrow>
|
||||
<div className="rounded-lg border border-border bg-card px-3 py-2 text-[13px] text-muted-foreground">
|
||||
{snapshot.backend.secretBackend}
|
||||
<Eyebrow className="mb-3">{t("exec.profile")}</Eyebrow>
|
||||
<div className="space-y-2">
|
||||
<ReadOnlyRow label={t("exec.profilePath")} value={snapshot.profilePath} mono />
|
||||
<ReadOnlyRow label={t("exec.secretBackend")} value={snapshot.backend.secretBackend} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ReadOnlyRow({ label, value, mono }: { label: string; value: string; mono?: boolean }) {
|
||||
return (
|
||||
<div className="flex items-center justify-between gap-3 rounded-lg border border-border bg-card px-3 py-2 text-[12px]">
|
||||
<span className="text-muted-foreground">{label}</span>
|
||||
<span className={`truncate text-foreground ${mono ? "font-mono text-[11px]" : ""}`}>{value}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import { Eyebrow, Select } from "../../ui";
|
||||
import { useT } from "../../../i18n";
|
||||
|
||||
interface GeneralSectionProps {
|
||||
snapshot: ProfileSnapshot;
|
||||
theme: ProfileSnapshot["theme"];
|
||||
setTheme: (theme: ProfileSnapshot["theme"]) => void;
|
||||
selectedLocale: AppLocale;
|
||||
@@ -22,7 +21,6 @@ interface GeneralSectionProps {
|
||||
* individually as soon as the user changes it.
|
||||
*/
|
||||
export function GeneralSection({
|
||||
snapshot,
|
||||
theme,
|
||||
setTheme,
|
||||
selectedLocale,
|
||||
@@ -84,9 +82,6 @@ export function GeneralSection({
|
||||
className="h-4 w-4 accent-[color:var(--primary)]"
|
||||
/>
|
||||
</label>
|
||||
<div className="mt-2 font-mono truncate text-[11px] text-muted-foreground">
|
||||
{t("exec.profilePath")}: {snapshot.profilePath}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user