From 5ad1eb7f88ffbae804de378e3b57442170fbf038 Mon Sep 17 00:00:00 2001 From: "smart-ssh-coder[bot]" <338317697+smart-ssh-coder[bot]@users.noreply.github.com> Date: Sat, 21 Nov 2026 01:10:16 +0000 Subject: [PATCH 1/9] feat(frontend): redesign server form Connection tab (#1380) Co-Authored-By: Claude Sonnet 5.5 --- ...server-form-connection-screenshots.spec.ts | 15 + .../components/ServerForm.android.test.tsx | 6 +- .../src/components/ServerForm.test.tsx | 41 +-- .../src/components/TestResultBadge.test.tsx | 28 +- .../serverForm/AuthKindSegments.test.tsx | 36 +++ .../serverForm/AuthKindSegments.tsx | 52 ++++ .../serverForm/AuthMethodFields.tsx | 77 +++--- .../components/serverForm/ConnectionTab.tsx | 261 +++++++++--------- .../serverForm/IdentityFileFacts.tsx | 30 +- .../components/serverForm/TestResultBadge.tsx | 61 ++-- .../frontend/src/locales/cs/common.json | 1 + .../frontend/src/locales/da/common.json | 1 + .../frontend/src/locales/de/common.json | 1 + .../frontend/src/locales/el/common.json | 1 + .../frontend/src/locales/en/common.json | 1 + .../frontend/src/locales/es/common.json | 1 + .../frontend/src/locales/fi/common.json | 1 + .../frontend/src/locales/fr/common.json | 1 + .../frontend/src/locales/hi/common.json | 1 + .../frontend/src/locales/hu/common.json | 1 + .../frontend/src/locales/id/common.json | 1 + .../src/locales/identicalAllowlist.json | 69 +++-- .../frontend/src/locales/it/common.json | 1 + .../frontend/src/locales/ja/common.json | 1 + .../frontend/src/locales/ko/common.json | 1 + .../src/locales/localeKeyParity.test.ts | 2 +- .../frontend/src/locales/nb/common.json | 1 + .../frontend/src/locales/nl/common.json | 1 + .../frontend/src/locales/pl/common.json | 1 + .../frontend/src/locales/pt-BR/common.json | 1 + .../frontend/src/locales/ro/common.json | 1 + .../frontend/src/locales/ru/common.json | 1 + .../frontend/src/locales/sv/common.json | 1 + .../frontend/src/locales/tr/common.json | 1 + .../frontend/src/locales/uk/common.json | 1 + .../frontend/src/locales/vi/common.json | 1 + .../frontend/src/locales/zh-Hans/common.json | 1 + .../issue-1380-server-form-connection-tab.md | 2 + docs/specs/0008-server-management-ui.md | 19 +- 39 files changed, 484 insertions(+), 240 deletions(-) create mode 100644 apps/smart-ssh-community/frontend/e2e/tests/server-form-connection-screenshots.spec.ts create mode 100644 apps/smart-ssh-community/frontend/src/components/serverForm/AuthKindSegments.test.tsx create mode 100644 apps/smart-ssh-community/frontend/src/components/serverForm/AuthKindSegments.tsx create mode 100644 changelog.d/issue-1380-server-form-connection-tab.md diff --git a/apps/smart-ssh-community/frontend/e2e/tests/server-form-connection-screenshots.spec.ts b/apps/smart-ssh-community/frontend/e2e/tests/server-form-connection-screenshots.spec.ts new file mode 100644 index 000000000..706f17f64 --- /dev/null +++ b/apps/smart-ssh-community/frontend/e2e/tests/server-form-connection-screenshots.spec.ts @@ -0,0 +1,15 @@ +// Issue #1380: review screenshots of the server form's Connection tab +// (SCREENSHOT_LABEL=before|after, SCREENSHOT_SCHEME=dark) at every screenshot size. +import { expect, test } from "../support/app"; +import { populated } from "../support/data"; +import { captureScreen } from "../support/screenshots"; + +test("Connection tab screenshots", async ({ app }) => { + await app.launch(populated()); + if (process.env.SCREENSHOT_SCHEME === "dark") await app.page.emulateMedia({ colorScheme: "dark" }); + await app.page.getByRole("button", { name: "Manage", exact: true }).click(); + await app.page.getByRole("treeitem", { name: /^web-1\b/ }).click(); + await app.page.getByRole("tab", { name: "Connection", exact: true }).click(); + await expect(app.page.getByRole("button", { name: "Test Connection", exact: true })).toBeVisible(); + await captureScreen(app.page, "server-form-connection"); +}); diff --git a/apps/smart-ssh-community/frontend/src/components/ServerForm.android.test.tsx b/apps/smart-ssh-community/frontend/src/components/ServerForm.android.test.tsx index baeb75c16..aa573e02d 100644 --- a/apps/smart-ssh-community/frontend/src/components/ServerForm.android.test.tsx +++ b/apps/smart-ssh-community/frontend/src/components/ServerForm.android.test.tsx @@ -62,14 +62,14 @@ describe("ServerForm on Android (issue #679)", () => { it("does not offer 'Key file' for a new server but keeps 'Private key'", async () => { renderNew(); fireEvent.click(await screen.findByRole("tab", { name: "Verbindung" })); - await screen.findByRole("option", { name: "Private Key" }); - expect(screen.queryByRole("option", { name: "Schlüsseldatei" })).not.toBeInTheDocument(); + await screen.findByRole("radio", { name: "Private Key" }); + expect(screen.queryByRole("radio", { name: "Schlüsseldatei" })).not.toBeInTheDocument(); }); it("offers 'Key file' on desktop", async () => { vi.spyOn(navigator, "userAgent", "get").mockReturnValue("Mozilla/5.0 (X11; Linux x86_64)"); renderNew(); fireEvent.click(await screen.findByRole("tab", { name: "Verbindung" })); - expect(await screen.findByRole("option", { name: "Schlüsseldatei" })).toBeInTheDocument(); + expect(await screen.findByRole("radio", { name: "Schlüsseldatei" })).toBeInTheDocument(); }); }); diff --git a/apps/smart-ssh-community/frontend/src/components/ServerForm.test.tsx b/apps/smart-ssh-community/frontend/src/components/ServerForm.test.tsx index 56a49038d..a9653540f 100644 --- a/apps/smart-ssh-community/frontend/src/components/ServerForm.test.tsx +++ b/apps/smart-ssh-community/frontend/src/components/ServerForm.test.tsx @@ -132,12 +132,13 @@ function openTab(name: string) { fireEvent.click(screen.getByRole("tab", { name })); } -function authKindSelect(): HTMLSelectElement { - const select = screen - .getAllByRole("combobox") - .find((el) => within(el).queryByText("Private Key") !== null); - if (!select) throw new Error("Anmeldeart-Auswahl nicht gefunden"); - return select as HTMLSelectElement; +// The authentication choice is a segmented radio group (issue #1380). +function selectAuthKind(kind: string) { + const radio = screen + .getAllByRole("radio") + .find((el) => (el as HTMLInputElement).value === kind); + if (!radio) throw new Error(`Anmeldeart-Option ${kind} nicht gefunden`); + fireEvent.click(radio); } const ED25519_HINT = @@ -165,7 +166,7 @@ describe("ServerForm Ed25519 recommendation (Spec 0069, Teil C2)", () => { renderNewServerForm(); openTab("Verbindung"); - fireEvent.change(authKindSelect(), { target: { value: "privateKey" } }); + selectAuthKind("privateKey"); expect(screen.getByText(ED25519_HINT)).toBeInTheDocument(); }); @@ -174,10 +175,10 @@ describe("ServerForm Ed25519 recommendation (Spec 0069, Teil C2)", () => { renderNewServerForm(); openTab("Verbindung"); - fireEvent.change(authKindSelect(), { target: { value: "privateKey" } }); + selectAuthKind("privateKey"); expect(screen.getByText(ED25519_HINT)).toBeInTheDocument(); - fireEvent.change(authKindSelect(), { target: { value: "agent" } }); + selectAuthKind("agent"); expect(screen.queryByText(ED25519_HINT)).not.toBeInTheDocument(); }); @@ -185,7 +186,7 @@ describe("ServerForm Ed25519 recommendation (Spec 0069, Teil C2)", () => { renderNewServerForm(); openTab("Verbindung"); - fireEvent.change(authKindSelect(), { target: { value: "certificate" } }); + selectAuthKind("certificate"); expect(screen.queryByText(ED25519_HINT)).not.toBeInTheDocument(); }); @@ -329,7 +330,7 @@ describe("ServerForm — Anmeldeart Schlüsseldatei (Spec 0076, B-1..B-4)", () = renderNewServerForm(); openTab("Verbindung"); - fireEvent.change(authKindSelect(), { target: { value: "identityFile" } }); + selectAuthKind("identityFile"); expect(screen.getByPlaceholderText("~/.ssh/id_ed25519")).toBeInTheDocument(); expect(screen.getByText("Datei wählen…")).toBeInTheDocument(); @@ -339,7 +340,7 @@ describe("ServerForm — Anmeldeart Schlüsseldatei (Spec 0076, B-1..B-4)", () = vi.mocked(pickFilePath).mockResolvedValue(IDENTITY_PATH); renderNewServerForm(); openTab("Verbindung"); - fireEvent.change(authKindSelect(), { target: { value: "identityFile" } }); + selectAuthKind("identityFile"); fireEvent.click(screen.getByText("Datei wählen…")); @@ -364,7 +365,7 @@ describe("ServerForm — Anmeldeart Schlüsseldatei (Spec 0076, B-1..B-4)", () = }); renderNewServerForm(); openTab("Verbindung"); - fireEvent.change(authKindSelect(), { target: { value: "identityFile" } }); + selectAuthKind("identityFile"); fireEvent.change(screen.getByPlaceholderText("~/.ssh/id_ed25519"), { target: { value: "/tmp/nope" }, }); @@ -400,7 +401,7 @@ describe("ServerForm — Anmeldeart Schlüsseldatei (Spec 0076, B-1..B-4)", () = vi.mocked(inspectKeyFile).mockRejectedValue(new Error("IPC kaputt")); renderNewServerForm(); openTab("Verbindung"); - fireEvent.change(authKindSelect(), { target: { value: "identityFile" } }); + selectAuthKind("identityFile"); fireEvent.change(screen.getByPlaceholderText("~/.ssh/id_ed25519"), { target: { value: IDENTITY_PATH }, }); @@ -433,7 +434,7 @@ describe("ServerForm — Anmeldeart Schlüsseldatei (Spec 0076, B-1..B-4)", () = }); renderNewServerForm(); openTab("Verbindung"); - fireEvent.change(authKindSelect(), { target: { value: "identityFile" } }); + selectAuthKind("identityFile"); fireEvent.change(screen.getByPlaceholderText("~/.ssh/id_ed25519"), { target: { value: IDENTITY_PATH }, }); @@ -479,7 +480,7 @@ describe("ServerForm — Anmeldeart Schlüsseldatei (Spec 0076, B-1..B-4)", () = }); renderNewServerForm(); openTab("Verbindung"); - fireEvent.change(authKindSelect(), { target: { value: "identityFile" } }); + selectAuthKind("identityFile"); fireEvent.change(screen.getByPlaceholderText("~/.ssh/id_ed25519"), { target: { value: IDENTITY_PATH }, }); @@ -521,7 +522,7 @@ describe("ServerForm — Anmeldeart Schlüsseldatei (Spec 0076, B-1..B-4)", () = }); renderNewServerForm(); openTab("Verbindung"); - fireEvent.change(authKindSelect(), { target: { value: "identityFile" } }); + selectAuthKind("identityFile"); fireEvent.change(screen.getByPlaceholderText("~/.ssh/id_ed25519"), { target: { value: IDENTITY_PATH }, }); @@ -551,7 +552,7 @@ describe("ServerForm — Anmeldeart Schlüsseldatei (Spec 0076, B-1..B-4)", () = vi.mocked(inspectKeyFile).mockResolvedValue(validKeyFacts()); renderNewServerForm(); openTab("Verbindung"); - fireEvent.change(authKindSelect(), { target: { value: "identityFile" } }); + selectAuthKind("identityFile"); const input = screen.getByPlaceholderText("~/.ssh/id_ed25519"); fireEvent.change(input, { target: { value: IDENTITY_PATH } }); @@ -942,7 +943,7 @@ describe("ServerForm — Schlüssel importieren oder Pfad behalten (Issue #667)" ); expect(await screen.findByDisplayValue("web-01")).toBeInTheDocument(); openTab("Verbindung"); - fireEvent.change(authKindSelect(), { target: { value: "identityFile" } }); + selectAuthKind("identityFile"); fireEvent.change(screen.getByPlaceholderText("~/.ssh/id_ed25519"), { target: { value: NEW_PATH } }); fireEvent.click(screen.getByRole("button", { name: "Speichern" })); return onSaved; @@ -998,7 +999,7 @@ describe("ServerForm — Schlüssel importieren oder Pfad behalten (Issue #667)" ); expect(await screen.findByDisplayValue("web-01")).toBeInTheDocument(); openTab("Verbindung"); - fireEvent.change(authKindSelect(), { target: { value: "identityFile" } }); + selectAuthKind("identityFile"); fireEvent.change(screen.getByPlaceholderText("~/.ssh/id_ed25519"), { target: { value: NEW_PATH } }); const saveButton = screen.getByRole("button", { name: "Speichern" }); saveButton.focus(); diff --git a/apps/smart-ssh-community/frontend/src/components/TestResultBadge.test.tsx b/apps/smart-ssh-community/frontend/src/components/TestResultBadge.test.tsx index c787d04cd..a2f32cc7c 100644 --- a/apps/smart-ssh-community/frontend/src/components/TestResultBadge.test.tsx +++ b/apps/smart-ssh-community/frontend/src/components/TestResultBadge.test.tsx @@ -6,10 +6,10 @@ import { render, screen } from "@testing-library/react"; import { I18nextProvider } from "react-i18next"; import { describe, expect, it } from "vitest"; import { testI18n } from "../testI18n"; -import type { TestConnectionResult } from "../api/types"; +import type { ConnectStepRecord, TestConnectionResult } from "../api/types"; import { TestResultBadge } from "./ServerForm"; -function renderBadge(result: TestConnectionResult) { +function renderBadge(result: TestConnectionResult & { steps?: ConnectStepRecord[] }) { return render( @@ -73,4 +73,28 @@ describe("TestResultBadge (Spec 0069, Teil A5)", () => { expect(screen.getByText("Verbindung erfolgreich")).toBeInTheDocument(); }); + + // Issue #1380: the success badge shows the sum of the step durations. + const stepWith = (durationMs: number | null): ConnectStepRecord => ({ + hopIndex: 0, + hop: "deploy@example.invalid:22", + step: { kind: "sessionReady" }, + status: { state: "ok" }, + durationMs, + }); + + it("shows 'OK · ms' for a successful test with measured steps", () => { + renderBadge({ kind: "success", steps: [stepWith(100), stepWith(42), stepWith(null)] }); + expect(screen.getByText("OK · 142 ms")).toBeInTheDocument(); + }); + + it("keeps the plain success text when no step has a duration", () => { + renderBadge({ kind: "success" }); + expect(screen.getByText("Verbindung erfolgreich")).toBeInTheDocument(); + }); + + it("shows a failure with its existing message", () => { + renderBadge({ kind: "timeout" }); + expect(screen.getByText(/antwortet nicht/)).toBeInTheDocument(); + }); }); diff --git a/apps/smart-ssh-community/frontend/src/components/serverForm/AuthKindSegments.test.tsx b/apps/smart-ssh-community/frontend/src/components/serverForm/AuthKindSegments.test.tsx new file mode 100644 index 000000000..15e6cdb14 --- /dev/null +++ b/apps/smart-ssh-community/frontend/src/components/serverForm/AuthKindSegments.test.tsx @@ -0,0 +1,36 @@ +import { fireEvent, render, screen } from "@testing-library/react"; +import { I18nextProvider } from "react-i18next"; +import { describe, expect, it, vi } from "vitest"; +import { testI18n } from "../../testI18n"; +import { AuthKindSegments } from "./AuthKindSegments"; + +const OPTIONS = [ + { kind: "password", label: "Passwort" }, + { kind: "privateKey", label: "Private Key" }, +] as const; + +function renderSegments(onChange = vi.fn()) { + render( + + + , + ); + return onChange; +} + +describe("AuthKindSegments (issue #1380)", () => { + it("is a radio group with one radio per option and the current one checked", () => { + renderSegments(); + expect(screen.getByRole("radiogroup")).toBeInTheDocument(); + expect(screen.getByRole("radio", { name: "Passwort" })).toBeChecked(); + expect(screen.getByRole("radio", { name: "Private Key" })).not.toBeChecked(); + }); + + it("reports a switch once and does not fire for the already selected option", () => { + const onChange = renderSegments(); + fireEvent.click(screen.getByRole("radio", { name: "Passwort" })); + expect(onChange).not.toHaveBeenCalled(); + fireEvent.click(screen.getByRole("radio", { name: "Private Key" })); + expect(onChange).toHaveBeenCalledExactlyOnceWith("privateKey"); + }); +}); diff --git a/apps/smart-ssh-community/frontend/src/components/serverForm/AuthKindSegments.tsx b/apps/smart-ssh-community/frontend/src/components/serverForm/AuthKindSegments.tsx new file mode 100644 index 000000000..1947cc374 --- /dev/null +++ b/apps/smart-ssh-community/frontend/src/components/serverForm/AuthKindSegments.tsx @@ -0,0 +1,52 @@ +import { useId } from "react"; +import { useTranslation } from "react-i18next"; +import type { AuthFormState } from "./serverFormModel"; + +export interface AuthKindOption { + kind: AuthFormState["kind"]; + label: string; +} + +/** Authentication choice as a segmented radio group. Native radio inputs + * give the arrow-key behaviour (and the roving tab stop) for free; a + * change goes through the same `onChange` as the former select. */ +export function AuthKindSegments({ + value, + options, + onChange, +}: { + value: AuthFormState["kind"]; + options: AuthKindOption[]; + onChange: (kind: AuthFormState["kind"]) => void; +}) { + const { t } = useTranslation(); + const name = useId(); + return ( +
+ {options.map((o) => ( + + ))} +
+ ); +} diff --git a/apps/smart-ssh-community/frontend/src/components/serverForm/AuthMethodFields.tsx b/apps/smart-ssh-community/frontend/src/components/serverForm/AuthMethodFields.tsx index 900ed0fda..34cff8f3e 100644 --- a/apps/smart-ssh-community/frontend/src/components/serverForm/AuthMethodFields.tsx +++ b/apps/smart-ssh-community/frontend/src/components/serverForm/AuthMethodFields.tsx @@ -5,43 +5,45 @@ import { detectFallbackPlatform, platformCapabilities } from "../../lib/platform import { Button } from "../ui"; import { Field, FIELD_CONTROL_CLASS } from "../ui/Field"; import type { IdentityFileState, ServerModel } from "./formTypes"; +import { AuthKindSegments } from "./AuthKindSegments"; import { IdentityFileFacts } from "./IdentityFileFacts"; import { authKindLabels, authStateFromKind, type AuthFormState } from "./serverFormModel"; interface Props { + idBase: string; isCreate: boolean; model: ServerModel; identity: IdentityFileState; } /** The authentication fieldset: method select plus the fields of the method. */ -export function AuthMethodFields({ isCreate, model, identity }: Props) { +export function AuthMethodFields({ idBase, isCreate, model, identity }: Props) { const { t } = useTranslation(); const AUTH_KIND_LABELS = authKindLabels(t); const { auth, setAuth, loaded } = model; + const keyFileOffered = + platformCapabilities(detectFallbackPlatform()).keyFilePath || auth.kind === "identityFile"; + // Issue #679: a file path cannot be kept on Android (the picker returns a + // content URI), so "Key file" is only offered for a server that already + // uses it; new keys go in via "Private key", which imports the content. + const authOptions: { kind: AuthFormState["kind"]; label: string }[] = [ + { kind: "password", label: AUTH_KIND_LABELS.password }, + { kind: "privateKey", label: AUTH_KIND_LABELS.privateKey }, + { kind: "agent", label: AUTH_KIND_LABELS.agent }, + { kind: "certificate", label: AUTH_KIND_LABELS.certificate }, + ...(keyFileOffered + ? [{ kind: "identityFile" as const, label: AUTH_KIND_LABELS.identityFile }] + : []), + ]; const { identityFacts, identityFactsLoading, identityFactsError } = identity; return ( -
- {t("serverForm.authFieldset")} - + options={authOptions} + onChange={(kind) => setAuth(authStateFromKind(kind))} + /> {auth.kind === "password" && (
@@ -110,7 +112,7 @@ export function AuthMethodFields({ isCreate, model, identity }: Props) { value={auth.keyContent} onChange={(e) => setAuth({ ...auth, keyContent: e.target.value })} rows={4} - className="mt-1 w-full rounded border border-border-strong bg-surface px-2 py-1.5 font-mono text-xs text-fg" + className={`${FIELD_CONTROL_CLASS} mt-1 w-full font-mono text-xs`} /> {/* Spec 0069, Teil C2 (BL-0110): reiner Hinweistext — keine * Prüfung des Inhalts, keine Sperre, kein Einfluss auf @@ -162,7 +164,7 @@ export function AuthMethodFields({ isCreate, model, identity }: Props) { value={auth.certContent} onChange={(e) => setAuth({ ...auth, certContent: e.target.value })} rows={3} - className="mt-1 w-full rounded border border-border-strong bg-surface px-2 py-1.5 font-mono text-xs text-fg" + className={`${FIELD_CONTROL_CLASS} mt-1 w-full font-mono text-xs`} />
@@ -186,7 +188,7 @@ export function AuthMethodFields({ isCreate, model, identity }: Props) { value={auth.keyContent} onChange={(e) => setAuth({ ...auth, keyContent: e.target.value })} rows={3} - className="mt-1 w-full rounded border border-border-strong bg-surface px-2 py-1.5 font-mono text-xs text-fg" + className={`${FIELD_CONTROL_CLASS} mt-1 w-full font-mono text-xs`} />
@@ -195,9 +197,21 @@ export function AuthMethodFields({ isCreate, model, identity }: Props) { {auth.kind === "identityFile" && (
-
- {t("serverForm.identityFilePathLabel")} -
- setAuth({ ...auth, path: e.target.value })} - placeholder={t("serverForm.identityFilePathPlaceholder")} - className="mt-1 w-full rounded border border-border-strong bg-surface px-2 py-1.5 font-mono text-xs text-fg" - /> {/* Spec 0076, B-3: Vorab-Befund — hindert das Speichern * nicht, die Datei darf erst später entstehen. */} -
- - {(control) => ( - setHost(e.target.value)} - className={`${FIELD_CONTROL_CLASS} w-full`} - /> - )} - - - {(control) => ( - setPort(e.target.value)} - className={`${FIELD_CONTROL_CLASS} w-full`} - /> - )} - + +
+
+
+ + {(control) => ( + setHost(e.target.value)} + className={`${FIELD_CONTROL_CLASS} ${MONO_INPUT}`} + /> + )} + + + {(control) => ( + setPort(e.target.value)} + className={`${FIELD_CONTROL_CLASS} ${MONO_INPUT}`} + /> + )} + +
{(control) => ( setUsername(e.target.value)} - className={`${FIELD_CONTROL_CLASS} w-full`} + className={`${FIELD_CONTROL_CLASS} ${MONO_INPUT}`} /> )} -
- - - {(control) => ( - - )} - - - - - {importDialog} - - {/* Spec 0076, C-1/C-2/C-7 (BL-0222): only for a saved server whose - * stored auth kind (not just the draft) is a key file — the button acts - * on the saved server, not on the open draft. */} - {!isCreate && loaded && loaded.authKind === "identity_file" && ( - - )} -
- {t("serverForm.sudoFieldset")} -

{t("serverForm.sudoHint")}

- - {t("serverForm.sudoLabel")}{" "} - - {sudoPasswordUnknown - ? t("serverForm.sudoUnchangedUnknown") - : hasSudoPassword - ? t("serverForm.sudoUnchangedStored") - : t("serverForm.sudoUnchanged")} - - - } - > + {(control) => ( - setSudoPassword(e.target.value)} - className={`${FIELD_CONTROL_CLASS} w-full`} - /> + value={jumpHost ?? ""} + onChange={(e) => setJumpHost(e.target.value || null)} + className={`${FIELD_CONTROL_CLASS} w-full narrow:min-h-11`} + > + + {possibleJumpHosts.map((s) => ( + + ))} + )} - {(hasSudoPassword || sudoPasswordUnknown) && ( - + {testResult && } +
+ {/* Issue #51: Schritt-Protokoll des letzten Tests, zugeklappt — + * bei Erfolg wie bei Fehlschlag. */} + {testResult?.steps && testResult.steps.length > 0 && ( + )} -
+ - - {(control) => ( - setStartDirectory(e.target.value)} - placeholder={t("serverForm.startDirectoryPlaceholder")} - className={`${FIELD_CONTROL_CLASS} w-full font-mono`} - /> +
+
+ {t("serverForm.sudoFieldset")} +

{t("serverForm.sudoHint")}

+ + {t("serverForm.sudoLabel")}{" "} + + {sudoPasswordUnknown + ? t("serverForm.sudoUnchangedUnknown") + : hasSudoPassword + ? t("serverForm.sudoUnchangedStored") + : t("serverForm.sudoUnchanged")} + + + } + > + {(control) => ( + setSudoPassword(e.target.value)} + className={`${FIELD_CONTROL_CLASS} ${MONO_INPUT}`} + /> + )} + + {(hasSudoPassword || sudoPasswordUnknown) && ( + )} - +
-
- - {t("serverForm.advanced")} - -
+ {/* "Advanced" is always shown open in the redesign (start + * directory, elevation, SFTP path). */} +
+ {t("serverForm.advanced")} + + {(control) => ( + setStartDirectory(e.target.value)} + placeholder={t("serverForm.startDirectoryPlaceholder")} + className={`${FIELD_CONTROL_CLASS} ${MONO_INPUT}`} + /> + )} + +
- - -
- - {testResult && } +
- {/* Issue #51: Schritt-Protokoll des letzten Tests, zugeklappt — - * bei Erfolg wie bei Fehlschlag. */} - {testResult?.steps && testResult.steps.length > 0 && ( - - )} +
); } diff --git a/apps/smart-ssh-community/frontend/src/components/serverForm/IdentityFileFacts.tsx b/apps/smart-ssh-community/frontend/src/components/serverForm/IdentityFileFacts.tsx index 545f872e9..48c941a27 100644 --- a/apps/smart-ssh-community/frontend/src/components/serverForm/IdentityFileFacts.tsx +++ b/apps/smart-ssh-community/frontend/src/components/serverForm/IdentityFileFacts.tsx @@ -1,6 +1,18 @@ +import type { ReactNode } from "react"; import { useTranslation } from "react-i18next"; import { translateErrorCode } from "../../api/errorCodes"; import type { KeyFileFactsDto } from "../../api/types"; +import { Icon, type IconName } from "../ui"; + +/** One finding line with its status icon (check / warn / info). */ +function Finding({ icon, className, children }: { icon: IconName; className: string; children: ReactNode }) { + return ( +
  • + + {children} +
  • + ); +} /** Spec 0076, B-3: zeigt den Vorab-Befund über eine Schlüsseldatei — * existiert sie, passen die Rechte, sieht sie wie ein OpenSSH-Schlüssel @@ -28,23 +40,23 @@ export function IdentityFileFacts({ const { t } = useTranslation(); if (emptyPath) return null; if (error) { - return

    {t("serverForm.identityFile.checkFailed")}

    ; + return
      {t("serverForm.identityFile.checkFailed")}
    ; } if (facts === null) { return loading ? ( -

    {t("serverForm.identityFile.checking")}

    +
      {t("serverForm.identityFile.checking")}
    ) : null; } const problemLine = facts.problem ? ( -
  • + {/* Issue #667 / Spec 0109 C3: the file is missing on this device. */} {facts.problem.code === "KEY_FILE_NOT_FOUND" ? `${t("errors.KEY_FILE_NOT_FOUND_ON_DEVICE")}: ${path}` : translateErrorCode(t, facts.problem.code, facts.problem.message)} -
  • + ) : ( -
  • {t("serverForm.identityFile.looksValid")}
  • + {t("serverForm.identityFile.looksValid")} ); // B-3 verlangt Existenz, Rechte, Gültigkeit UND Verschlüsselung — auch @@ -74,19 +86,19 @@ export function IdentityFileFacts({ {problemLine} {permissionsAreKnown && (facts.permissionsTooOpen ? ( -
  • {t("serverForm.identityFile.permissionsTooOpen")}
  • + {t("serverForm.identityFile.permissionsTooOpen")} ) : ( -
  • {t("serverForm.identityFile.permissionsOk")}
  • + {t("serverForm.identityFile.permissionsOk")} ))} {/* `encrypted` ist nur aussagekräftig, wenn der Schlüssel überhaupt * gültig ist (bei einem Problem steht das Feld immer auf `false`, * s. `crate::dto::KeyFileFactsDto::from`). */} {!facts.problem && ( -
  • + {facts.encrypted ? t("serverForm.identityFile.encrypted") : t("serverForm.identityFile.notEncrypted")} -
  • + )} ); diff --git a/apps/smart-ssh-community/frontend/src/components/serverForm/TestResultBadge.tsx b/apps/smart-ssh-community/frontend/src/components/serverForm/TestResultBadge.tsx index 2262b84f4..c2f25b6f7 100644 --- a/apps/smart-ssh-community/frontend/src/components/serverForm/TestResultBadge.tsx +++ b/apps/smart-ssh-community/frontend/src/components/serverForm/TestResultBadge.tsx @@ -1,38 +1,59 @@ import { useTranslation } from "react-i18next"; -import { Icon } from "../ui"; +import { Badge, type BadgeTone } from "../ui"; import { translateErrorCode } from "../../api/errorCodes"; -import type { TestConnectionResult } from "../../api/types"; +import type { ConnectStepRecord, TestConnectionResult } from "../../api/types"; // Spec 0069, Teil A5, Test 20: exportiert (statt modulprivat), damit sich // die code->Übersetzung ohne einen vollständigen `ServerForm`-Render // testen lässt. -export function TestResultBadge({ result }: { result: TestConnectionResult }) { +export function TestResultBadge({ result }: { result: TestConnectionResult & { steps?: ConnectStepRecord[] } }) { const { t } = useTranslation(); + let tone: BadgeTone = "danger"; + let text: string; switch (result.kind) { - case "success": - return {t("serverForm.testResult.success")}; + case "success": { + tone = "success"; + // Sum of the step durations; without any measured step the plain + // success text stays. + const timed = (result.steps ?? []).filter((s) => s.durationMs !== null); + text = + timed.length > 0 + ? t("serverForm.testResult.successTimed", { + ms: timed.reduce((sum, s) => sum + (s.durationMs ?? 0), 0), + }) + : t("serverForm.testResult.success"); + break; + } case "authenticationFailed": - return {t("serverForm.testResult.authFailed")}; + text = t("serverForm.testResult.authFailed"); + break; case "hostKeyUnknown": - return ( - {t("serverForm.testResult.hostKeyUnknown")} - ); + tone = "warning"; + text = t("serverForm.testResult.hostKeyUnknown"); + break; case "hostKeyMismatch": - return {t("serverForm.testResult.hostKeyMismatch")}; + text = t("serverForm.testResult.hostKeyMismatch"); + break; case "networkError": // Spec 0069, Teil A5: bekannter Code → übersetzte Meldung; ohne // Code → wie bisher der rohe Backend-Text. - return ( - - - {translateErrorCode( - t, - result.code, - t("serverForm.testResult.networkError", { message: result.message }), - )} - + text = translateErrorCode( + t, + result.code, + t("serverForm.testResult.networkError", { message: result.message }), ); + break; case "timeout": - return {t("serverForm.testResult.timeout")}; + text = t("serverForm.testResult.timeout"); + break; } + return ( + + {text} + + ); } diff --git a/apps/smart-ssh-community/frontend/src/locales/cs/common.json b/apps/smart-ssh-community/frontend/src/locales/cs/common.json index 88cd35d36..a8fed23ab 100644 --- a/apps/smart-ssh-community/frontend/src/locales/cs/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/cs/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Smazat trvale", "testResult": { "success": "Připojení úspěšné", + "successTimed": "OK · {{ms}} ms", "authFailed": "Přihlášení odmítnuto. Zkontrolujte uživatelské jméno a heslo nebo klíč.", "hostKeyUnknown": "Klíč hostitele neznámý — vyžadováno potvrzení", "hostKeyMismatch": "Klíč hostitele se změnil", diff --git a/apps/smart-ssh-community/frontend/src/locales/da/common.json b/apps/smart-ssh-community/frontend/src/locales/da/common.json index 5fb4f512f..086dcb61a 100644 --- a/apps/smart-ssh-community/frontend/src/locales/da/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/da/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Slet permanent", "testResult": { "success": "Forbindelse oprettet", + "successTimed": "OK · {{ms}} ms", "authFailed": "Login afvist. Kontrollér brugernavn og adgangskode eller nøgle.", "hostKeyUnknown": "Værtsnøgle ukendt – bekræftelse kræves", "hostKeyMismatch": "Værtsnøglen er ændret", diff --git a/apps/smart-ssh-community/frontend/src/locales/de/common.json b/apps/smart-ssh-community/frontend/src/locales/de/common.json index 2f5304123..98897aa9e 100644 --- a/apps/smart-ssh-community/frontend/src/locales/de/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/de/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Endgültig löschen", "testResult": { "success": "Verbindung erfolgreich", + "successTimed": "OK · {{ms}} ms", "authFailed": "Anmeldung abgelehnt. Benutzername und Passwort bzw. Schlüssel prüfen.", "hostKeyUnknown": "Host-Key unbekannt — Bestätigung nötig", "hostKeyMismatch": "Host-Key hat sich geändert", diff --git a/apps/smart-ssh-community/frontend/src/locales/el/common.json b/apps/smart-ssh-community/frontend/src/locales/el/common.json index 4fa0621b5..cedcefdbe 100644 --- a/apps/smart-ssh-community/frontend/src/locales/el/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/el/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Οριστική διαγραφή", "testResult": { "success": "Επιτυχής σύνδεση", + "successTimed": "OK · {{ms}} ms", "authFailed": "Η σύνδεση απορρίφθηκε. Ελέγξτε το όνομα χρήστη και τον κωδικό ή το κλειδί.", "hostKeyUnknown": "Άγνωστο κλειδί κεντρικού υπολογιστή — απαιτείται επιβεβαίωση", "hostKeyMismatch": "Το κλειδί κεντρικού υπολογιστή άλλαξε", diff --git a/apps/smart-ssh-community/frontend/src/locales/en/common.json b/apps/smart-ssh-community/frontend/src/locales/en/common.json index 9451a2668..5e3869a12 100644 --- a/apps/smart-ssh-community/frontend/src/locales/en/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/en/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Delete permanently", "testResult": { "success": "Connection successful", + "successTimed": "OK · {{ms}} ms", "authFailed": "Login rejected. Check the user name and password or key.", "hostKeyUnknown": "Host key unknown — confirmation required", "hostKeyMismatch": "Host key has changed", diff --git a/apps/smart-ssh-community/frontend/src/locales/es/common.json b/apps/smart-ssh-community/frontend/src/locales/es/common.json index d4e606d9e..6472f628b 100644 --- a/apps/smart-ssh-community/frontend/src/locales/es/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/es/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Eliminar definitivamente", "testResult": { "success": "Conexión correcta", + "successTimed": "OK · {{ms}} ms", "authFailed": "Inicio de sesión rechazado. Compruebe el usuario y la contraseña o la clave.", "hostKeyUnknown": "Clave de host desconocida: se requiere confirmación", "hostKeyMismatch": "La clave de host ha cambiado", diff --git a/apps/smart-ssh-community/frontend/src/locales/fi/common.json b/apps/smart-ssh-community/frontend/src/locales/fi/common.json index 27ad4aea6..b715e3847 100644 --- a/apps/smart-ssh-community/frontend/src/locales/fi/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/fi/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Poista pysyvästi", "testResult": { "success": "Yhteys onnistui", + "successTimed": "OK · {{ms}} ms", "authFailed": "Kirjautuminen hylättiin. Tarkista käyttäjätunnus ja salasana tai avain.", "hostKeyUnknown": "Isäntäavain tuntematon – vahvistus tarvitaan", "hostKeyMismatch": "Isäntäavain on muuttunut", diff --git a/apps/smart-ssh-community/frontend/src/locales/fr/common.json b/apps/smart-ssh-community/frontend/src/locales/fr/common.json index 1da339d00..42760f301 100644 --- a/apps/smart-ssh-community/frontend/src/locales/fr/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/fr/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Supprimer définitivement", "testResult": { "success": "Connexion réussie", + "successTimed": "OK · {{ms}} ms", "authFailed": "Connexion refusée. Vérifiez le nom d’utilisateur et le mot de passe ou la clé.", "hostKeyUnknown": "Clé d’hôte inconnue — confirmation requise", "hostKeyMismatch": "La clé d’hôte a changé", diff --git a/apps/smart-ssh-community/frontend/src/locales/hi/common.json b/apps/smart-ssh-community/frontend/src/locales/hi/common.json index d18bb80f0..9c7c24dfb 100644 --- a/apps/smart-ssh-community/frontend/src/locales/hi/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/hi/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "स्थायी रूप से हटाएँ", "testResult": { "success": "कनेक्शन सफल", + "successTimed": "OK · {{ms}} ms", "authFailed": "लॉगिन अस्वीकृत। उपयोगकर्ता नाम और पासवर्ड या कुंजी जाँचें।", "hostKeyUnknown": "होस्ट कुंजी अज्ञात — पुष्टि आवश्यक", "hostKeyMismatch": "होस्ट कुंजी बदल गई है", diff --git a/apps/smart-ssh-community/frontend/src/locales/hu/common.json b/apps/smart-ssh-community/frontend/src/locales/hu/common.json index 3a80b2589..96177d692 100644 --- a/apps/smart-ssh-community/frontend/src/locales/hu/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/hu/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Végleges törlés", "testResult": { "success": "A kapcsolat sikeres", + "successTimed": "OK · {{ms}} ms", "authFailed": "A bejelentkezés elutasítva. Ellenőrizze a felhasználónevet és a jelszót vagy kulcsot.", "hostKeyUnknown": "Ismeretlen gazdakulcs – megerősítés szükséges", "hostKeyMismatch": "A gazdakulcs megváltozott", diff --git a/apps/smart-ssh-community/frontend/src/locales/id/common.json b/apps/smart-ssh-community/frontend/src/locales/id/common.json index a19f19c90..c16407e0a 100644 --- a/apps/smart-ssh-community/frontend/src/locales/id/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/id/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Hapus permanen", "testResult": { "success": "Koneksi berhasil", + "successTimed": "OK · {{ms}} ms", "authFailed": "Login ditolak. Periksa nama pengguna dan kata sandi atau kunci.", "hostKeyUnknown": "Kunci host tidak dikenal — konfirmasi diperlukan", "hostKeyMismatch": "Kunci host telah berubah", diff --git a/apps/smart-ssh-community/frontend/src/locales/identicalAllowlist.json b/apps/smart-ssh-community/frontend/src/locales/identicalAllowlist.json index 94649cadf..2f177c4b6 100644 --- a/apps/smart-ssh-community/frontend/src/locales/identicalAllowlist.json +++ b/apps/smart-ssh-community/frontend/src/locales/identicalAllowlist.json @@ -35,7 +35,8 @@ "elevatedIdle.minutes30": "same word in this language (number plus \"minutes\")", "elevatedIdle.minutes60": "same word in this language (number plus \"minutes\")", "chat.messageLabel": "same word in this language", - "mainScreen.localBadge": "same word in this language" + "mainScreen.localBadge": "same word in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "es": { "common.ok": "same word in this language", @@ -57,7 +58,8 @@ "unusableServer.host": "same word in this language", "serverForm.tabs.general": "same word in this language", "actionCard.autoRanScopeGlobal": "same word in this language", - "mainScreen.localBadge": "same word in this language" + "mainScreen.localBadge": "same word in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "it": { "authPrompt.password": "same word in this language", @@ -96,7 +98,8 @@ "backup.passphrase.label": "same word in this language", "backup.import.usePassphrase": "same word in this language", "backup.import.passphraseLabel": "same word in this language", - "chat.headerProviderTooltip": "same word in this language" + "chat.headerProviderTooltip": "same word in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "pl": { "common.ok": "same word in this language", @@ -124,7 +127,8 @@ "session.terminalTab": "same word in this language", "unusableServer.host": "same word in this language", "session.aiTab": "abbreviation AI is used as is in this language", - "actionCard.autoRanScopeTag": "same word in this language" + "actionCard.autoRanScopeTag": "same word in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "cs": { "common.ok": "same word in this language", @@ -151,7 +155,8 @@ "connectLog.detail.mac": "technical acronym; not translated", "notes.editedByAi": "technical acronym; not translated", "session.aiTab": "abbreviation AI is used as is in this language", - "actionCard.autoRanScopeServer": "same word in this language" + "actionCard.autoRanScopeServer": "same word in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "uk": { "common.ok": "same word in this language", @@ -163,7 +168,8 @@ "aiProvider.providerTypes.anthropic": "product name, protocol or path placeholder; not translated (glossary)", "aiProvider.providerTypes.ollama": "product name, protocol or path placeholder; not translated (glossary)", "connectLog.status.ok": "same word in this language", - "connectLog.detail.mac": "technical acronym; not translated" + "connectLog.detail.mac": "technical acronym; not translated", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "ru": { "common.ok": "same word in this language", @@ -175,7 +181,8 @@ "aiProvider.providerTypes.anthropic": "product name, protocol or path placeholder; not translated (glossary)", "aiProvider.providerTypes.ollama": "product name, protocol or path placeholder; not translated (glossary)", "connectLog.status.ok": "same word in this language", - "connectLog.detail.mac": "technical acronym; not translated" + "connectLog.detail.mac": "technical acronym; not translated", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "ja": { "serverForm.identityFilePathPlaceholder": "product name, protocol or path placeholder; not translated (glossary)", @@ -187,7 +194,8 @@ "aiProvider.providerTypes.ollama": "product name, protocol or path placeholder; not translated (glossary)", "common.ok": "same word in this language", "connectLog.status.ok": "same word in this language", - "session.aiTab": "abbreviation AI is used as is in this language" + "session.aiTab": "abbreviation AI is used as is in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "zh-Hans": { "serverForm.identityFilePathPlaceholder": "product name, protocol or path placeholder; not translated (glossary)", @@ -197,7 +205,8 @@ "aiProvider.providerTypes.openai": "product name, protocol or path placeholder; not translated (glossary)", "aiProvider.providerTypes.anthropic": "product name, protocol or path placeholder; not translated (glossary)", "aiProvider.providerTypes.ollama": "product name, protocol or path placeholder; not translated (glossary)", - "session.aiTab": "abbreviation AI is used as is in this language" + "session.aiTab": "abbreviation AI is used as is in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "ko": { "serverForm.identityFilePathPlaceholder": "product name, protocol or path placeholder; not translated (glossary)", @@ -211,7 +220,8 @@ "connectLog.status.ok": "same word in this language", "connectLog.detail.mac": "protocol term plus placeholder; not translated", "notes.editedByAi": "'AI' is written the same in Korean; rest is placeholders", - "session.aiTab": "abbreviation AI is used as is in this language" + "session.aiTab": "abbreviation AI is used as is in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "sv": { "common.ok": "the word is spelled the same in Swedish", @@ -241,7 +251,8 @@ "session.terminalTab": "the word is spelled the same in Swedish", "session.aiTab": "abbreviation AI is used as is in this language", "actionCard.autoRanScopeGlobal": "same word in this language", - "actionCard.autoRanScopeServer": "same word in this language" + "actionCard.autoRanScopeServer": "same word in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "da": { "common.ok": "the word is spelled the same in Danish", @@ -286,7 +297,8 @@ "session.aiTab": "abbreviation AI is used as is in this language", "actionCard.autoRanScopeGlobal": "same word in this language", "actionCard.autoRanScopeServer": "same word in this language", - "actionCard.autoRanScopeTag": "same word in this language" + "actionCard.autoRanScopeTag": "same word in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "nb": { "common.ok": "the word is spelled the same in Norwegian", @@ -319,7 +331,8 @@ "notes.editedByAi": "product or protocol name, or placeholder-led string", "session.terminalTab": "the word is spelled the same in Norwegian", "actionCard.autoRanScopeGlobal": "same word in this language", - "actionCard.autoRanScopeServer": "same word in this language" + "actionCard.autoRanScopeServer": "same word in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "fi": { "common.ok": "the word is spelled the same in Finnish", @@ -331,7 +344,8 @@ "aiProvider.providerTypes.anthropic": "product or protocol name, or placeholder-led string", "aiProvider.providerTypes.ollama": "product or protocol name, or placeholder-led string", "connectLog.status.ok": "the word is spelled the same in Finnish", - "connectLog.detail.mac": "product or protocol name, or placeholder-led string" + "connectLog.detail.mac": "product or protocol name, or placeholder-led string", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "tr": { "serverForm.identityFilePathPlaceholder": "product name, protocol or path placeholder; not translated (glossary)", @@ -344,7 +358,8 @@ "aiProvider.providerTypes.anthropic": "product name, protocol or path placeholder; not translated (glossary)", "aiProvider.providerTypes.ollama": "product name, protocol or path placeholder; not translated (glossary)", "connectLog.detail.mac": "product name, protocol or path placeholder; not translated (glossary)", - "session.terminalTab": "same word in this language" + "session.terminalTab": "same word in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "el": { "serverForm.identityFilePathPlaceholder": "product name, protocol or path placeholder; not translated (glossary)", @@ -355,7 +370,8 @@ "aiProvider.providerTypes.anthropic": "product name, protocol or path placeholder; not translated (glossary)", "aiProvider.providerTypes.ollama": "product name, protocol or path placeholder; not translated (glossary)", "connectLog.detail.mac": "product name, protocol or path placeholder; not translated (glossary)", - "notes.editedByAi": "same word in this language" + "notes.editedByAi": "same word in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "hu": { "common.ok": "same word in this language", @@ -371,7 +387,8 @@ "sshConfigImport.field.port": "same word in this language", "connectLog.status.ok": "same word in this language", "connectLog.detail.mac": "product name, protocol or path placeholder; not translated (glossary)", - "notes.editedByAi": "same word in this language" + "notes.editedByAi": "same word in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" }, "ro": { "common.ok": "same word in this language", @@ -409,6 +426,22 @@ "unusableServer.host": "same word in this language", "serverForm.tabs.general": "same word in this language", "actionCard.autoRanScopeServer": "same word in this language", - "mainScreen.localBadge": "same word in this language" + "mainScreen.localBadge": "same word in this language", + "serverForm.testResult.successTimed": "status word and unit, same in every language" + }, + "hi": { + "serverForm.testResult.successTimed": "status word and unit, same in every language" + }, + "id": { + "serverForm.testResult.successTimed": "status word and unit, same in every language" + }, + "nl": { + "serverForm.testResult.successTimed": "status word and unit, same in every language" + }, + "pt-BR": { + "serverForm.testResult.successTimed": "status word and unit, same in every language" + }, + "vi": { + "serverForm.testResult.successTimed": "status word and unit, same in every language" } } diff --git a/apps/smart-ssh-community/frontend/src/locales/it/common.json b/apps/smart-ssh-community/frontend/src/locales/it/common.json index 41287d6e9..a1e171cfe 100644 --- a/apps/smart-ssh-community/frontend/src/locales/it/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/it/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Elimina definitivamente", "testResult": { "success": "Connessione riuscita", + "successTimed": "OK · {{ms}} ms", "authFailed": "Accesso rifiutato. Verifichi nome utente e password o chiave.", "hostKeyUnknown": "Chiave host sconosciuta: conferma necessaria", "hostKeyMismatch": "La chiave host è cambiata", diff --git a/apps/smart-ssh-community/frontend/src/locales/ja/common.json b/apps/smart-ssh-community/frontend/src/locales/ja/common.json index a9e650ec0..9ae6bc3b3 100644 --- a/apps/smart-ssh-community/frontend/src/locales/ja/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/ja/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "完全に削除", "testResult": { "success": "接続に成功しました", + "successTimed": "OK · {{ms}} ms", "authFailed": "ログインが拒否されました。ユーザー名とパスワードまたは鍵を確認してください。", "hostKeyUnknown": "ホストキーが不明です — 確認が必要です", "hostKeyMismatch": "ホストキーが変更されました", diff --git a/apps/smart-ssh-community/frontend/src/locales/ko/common.json b/apps/smart-ssh-community/frontend/src/locales/ko/common.json index d30eb7fb6..f55da5812 100644 --- a/apps/smart-ssh-community/frontend/src/locales/ko/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/ko/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "영구 삭제", "testResult": { "success": "연결 성공", + "successTimed": "OK · {{ms}} ms", "authFailed": "로그인이 거부되었습니다. 사용자 이름과 비밀번호 또는 키를 확인하십시오.", "hostKeyUnknown": "알 수 없는 호스트 키 — 확인이 필요합니다", "hostKeyMismatch": "호스트 키가 변경되었습니다", diff --git a/apps/smart-ssh-community/frontend/src/locales/localeKeyParity.test.ts b/apps/smart-ssh-community/frontend/src/locales/localeKeyParity.test.ts index afa1c3686..395b55b4e 100644 --- a/apps/smart-ssh-community/frontend/src/locales/localeKeyParity.test.ts +++ b/apps/smart-ssh-community/frontend/src/locales/localeKeyParity.test.ts @@ -124,7 +124,7 @@ const SAME_WORDS: Record = { ], }; // Produktnamen sind in allen Sprachen gleich (Glossar: bleiben unübersetzt). -const PRODUCT_WORDS = ["openai", "anthropic", "ollama", "mcp", "ok"]; +const PRODUCT_WORDS = ["openai", "anthropic", "ollama", "mcp", "ok", "ms"]; function isAllowedSame(code: string, value: string): boolean { if (/^(https?:|~\/|\/)/.test(value.trim())) return true; const words = stripped(value) diff --git a/apps/smart-ssh-community/frontend/src/locales/nb/common.json b/apps/smart-ssh-community/frontend/src/locales/nb/common.json index b77b9a975..113c83622 100644 --- a/apps/smart-ssh-community/frontend/src/locales/nb/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/nb/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Slett permanent", "testResult": { "success": "Tilkobling vellykket", + "successTimed": "OK · {{ms}} ms", "authFailed": "Pålogging avvist. Sjekk brukernavn og passord eller nøkkel.", "hostKeyUnknown": "Vertsnøkkel ukjent – bekreftelse kreves", "hostKeyMismatch": "Vertsnøkkelen er endret", diff --git a/apps/smart-ssh-community/frontend/src/locales/nl/common.json b/apps/smart-ssh-community/frontend/src/locales/nl/common.json index f8386315b..4a152ef45 100644 --- a/apps/smart-ssh-community/frontend/src/locales/nl/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/nl/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Definitief verwijderen", "testResult": { "success": "Verbinding geslaagd", + "successTimed": "OK · {{ms}} ms", "authFailed": "Aanmelding geweigerd. Controleer de gebruikersnaam en het wachtwoord of de sleutel.", "hostKeyUnknown": "Hostsleutel onbekend — bevestiging vereist", "hostKeyMismatch": "Hostsleutel is gewijzigd", diff --git a/apps/smart-ssh-community/frontend/src/locales/pl/common.json b/apps/smart-ssh-community/frontend/src/locales/pl/common.json index 35cddbc33..7ed324bc3 100644 --- a/apps/smart-ssh-community/frontend/src/locales/pl/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/pl/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Usuń na stałe", "testResult": { "success": "Połączenie udane", + "successTimed": "OK · {{ms}} ms", "authFailed": "Logowanie odrzucone. Sprawdź nazwę użytkownika oraz hasło lub klucz.", "hostKeyUnknown": "Nieznany klucz hosta — wymagane potwierdzenie", "hostKeyMismatch": "Klucz hosta się zmienił", diff --git a/apps/smart-ssh-community/frontend/src/locales/pt-BR/common.json b/apps/smart-ssh-community/frontend/src/locales/pt-BR/common.json index c60632180..a3350ecb5 100644 --- a/apps/smart-ssh-community/frontend/src/locales/pt-BR/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/pt-BR/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Excluir permanentemente", "testResult": { "success": "Conexão bem-sucedida", + "successTimed": "OK · {{ms}} ms", "authFailed": "Login recusado. Verifique o nome de usuário e a senha ou chave.", "hostKeyUnknown": "Chave de host desconhecida — confirmação necessária", "hostKeyMismatch": "A chave de host mudou", diff --git a/apps/smart-ssh-community/frontend/src/locales/ro/common.json b/apps/smart-ssh-community/frontend/src/locales/ro/common.json index da5ac7be7..152984ee9 100644 --- a/apps/smart-ssh-community/frontend/src/locales/ro/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/ro/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Șterge definitiv", "testResult": { "success": "Conectare reușită", + "successTimed": "OK · {{ms}} ms", "authFailed": "Autentificare respinsă. Verificați numele de utilizator și parola sau cheia.", "hostKeyUnknown": "Cheie de host necunoscută — este necesară confirmarea", "hostKeyMismatch": "Cheia de host s-a schimbat", diff --git a/apps/smart-ssh-community/frontend/src/locales/ru/common.json b/apps/smart-ssh-community/frontend/src/locales/ru/common.json index 2005d79ce..2976918e4 100644 --- a/apps/smart-ssh-community/frontend/src/locales/ru/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/ru/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Удалить безвозвратно", "testResult": { "success": "Подключение успешно", + "successTimed": "OK · {{ms}} ms", "authFailed": "Вход отклонён. Проверьте имя пользователя и пароль или ключ.", "hostKeyUnknown": "Ключ хоста неизвестен — требуется подтверждение", "hostKeyMismatch": "Ключ хоста изменился", diff --git a/apps/smart-ssh-community/frontend/src/locales/sv/common.json b/apps/smart-ssh-community/frontend/src/locales/sv/common.json index fd3a252d5..23e15b45e 100644 --- a/apps/smart-ssh-community/frontend/src/locales/sv/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/sv/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Ta bort permanent", "testResult": { "success": "Anslutningen lyckades", + "successTimed": "OK · {{ms}} ms", "authFailed": "Inloggningen avvisades. Kontrollera användarnamn och lösenord eller nyckel.", "hostKeyUnknown": "Värdnyckeln är okänd — bekräftelse krävs", "hostKeyMismatch": "Värdnyckeln har ändrats", diff --git a/apps/smart-ssh-community/frontend/src/locales/tr/common.json b/apps/smart-ssh-community/frontend/src/locales/tr/common.json index c055bb4ca..b0517703c 100644 --- a/apps/smart-ssh-community/frontend/src/locales/tr/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/tr/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Kalıcı olarak sil", "testResult": { "success": "Bağlantı başarılı", + "successTimed": "OK · {{ms}} ms", "authFailed": "Oturum açma reddedildi. Kullanıcı adını ve parolayı ya da anahtarı denetleyin.", "hostKeyUnknown": "Ana makine anahtarı bilinmiyor — onay gerekli", "hostKeyMismatch": "Ana makine anahtarı değişti", diff --git a/apps/smart-ssh-community/frontend/src/locales/uk/common.json b/apps/smart-ssh-community/frontend/src/locales/uk/common.json index f725454fe..2899eb1ae 100644 --- a/apps/smart-ssh-community/frontend/src/locales/uk/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/uk/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Видалити назавжди", "testResult": { "success": "Підключення успішне", + "successTimed": "OK · {{ms}} ms", "authFailed": "Вхід відхилено. Перевірте ім'я користувача та пароль або ключ.", "hostKeyUnknown": "Ключ хоста невідомий — потрібне підтвердження", "hostKeyMismatch": "Ключ хоста змінився", diff --git a/apps/smart-ssh-community/frontend/src/locales/vi/common.json b/apps/smart-ssh-community/frontend/src/locales/vi/common.json index 299a58e64..6fb2e77e5 100644 --- a/apps/smart-ssh-community/frontend/src/locales/vi/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/vi/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "Xóa vĩnh viễn", "testResult": { "success": "Kết nối thành công", + "successTimed": "OK · {{ms}} ms", "authFailed": "Đăng nhập bị từ chối. Kiểm tra tên người dùng và mật khẩu hoặc khóa.", "hostKeyUnknown": "Khóa máy chủ chưa biết — cần xác nhận", "hostKeyMismatch": "Khóa máy chủ đã thay đổi", diff --git a/apps/smart-ssh-community/frontend/src/locales/zh-Hans/common.json b/apps/smart-ssh-community/frontend/src/locales/zh-Hans/common.json index d6e2f70f7..f0a2920ad 100644 --- a/apps/smart-ssh-community/frontend/src/locales/zh-Hans/common.json +++ b/apps/smart-ssh-community/frontend/src/locales/zh-Hans/common.json @@ -283,6 +283,7 @@ "confirmDeleteServer": "永久删除", "testResult": { "success": "连接成功", + "successTimed": "OK · {{ms}} ms", "authFailed": "登录被拒绝。请检查用户名以及密码或密钥。", "hostKeyUnknown": "主机密钥未知——需要确认", "hostKeyMismatch": "主机密钥已更改", diff --git a/changelog.d/issue-1380-server-form-connection-tab.md b/changelog.d/issue-1380-server-form-connection-tab.md new file mode 100644 index 000000000..7cb187d0b --- /dev/null +++ b/changelog.d/issue-1380-server-form-connection-tab.md @@ -0,0 +1,2 @@ +### Changed +- The Connection tab of the server form now uses two columns on wide windows, a segmented authentication choice, key-file findings with icons and a test result badge such as "OK · 142 ms". diff --git a/docs/specs/0008-server-management-ui.md b/docs/specs/0008-server-management-ui.md index 2df0228dc..290cd3cbd 100644 --- a/docs/specs/0008-server-management-ui.md +++ b/docs/specs/0008-server-management-ui.md @@ -65,10 +65,21 @@ vier Reiter verteilt: **Allgemein**, **Verbindung**, **Sicherheit** und - *Allgemein*: Name, Gruppe, Tags, danach die Abschnitte von Erweiterungen und am Ende „Server löschen" samt Auswirkungs-Vorschau. -- *Verbindung*: Host, Port, Benutzername, Jump-Host, Anmeldung (alle Arten, - Schlüsselprüfung, Übernahme in den Schlüsselbund), Sudo-Passwort, - Startverzeichnis, „Erweitert" (SFTP-Server-Pfad) sowie „Verbindung testen" - mit Ergebnis und Schritt-Protokoll. +- *Verbindung*: Auf breitem Fenster zwei Spalten, auf schmalem eine Spalte in + derselben Reihenfolge (erst links, dann rechts). Links: Host und Port + (schmal, in einer Zeile), Benutzername, Jump-Host, Anmeldung, „Verbindung + testen" mit Ergebnis und Schritt-Protokoll. Die Anmeldeart ist eine + segmentierte Auswahl (Radiogruppe, Pfeiltasten) mit denselben Arten wie + zuvor; „Schlüsseldatei" erscheint unter denselben Bedingungen (Spec 0076). + Beim Pfad der Schlüsseldatei steht „Datei wählen …" neben dem Feld; die + Schlüsselprüfung zeigt jeden Befund mit Symbol (Haken, Warnung, Info), danach + Passphrase und ggf. die Übernahme in den Schlüsselbund. Rechts: der Abschnitt + „Sudo-Passwort" (Hinweis, Feld, „Sudo-Passwort entfernen" als Gefahr-Knopf) + und der immer geöffnete Abschnitt „Erweitert" (Startverzeichnis mit Hinweis, + Erhöhte-Rechte-Option mit Hinweis, SFTP-Server-Pfad). Technische Werte + (Host, Port, Benutzer, Pfade) stehen in Festbreitenschrift. Das Testergebnis + ist eine umrandete Marke mit Statusquadrat: „OK · 142 ms" (Summe der + Schrittdauern) bei Erfolg, sonst die bisherige Fehlermeldung. - *Sicherheit*: Bestätigung nach Serverzugriff (Spec 0039), KI-Prüfung auf Prompt-Injection und die gespeicherten Host-Keys. - *Notizen*: Notizen und Kontext-Vorschau. Die Notizen haben wie bisher ihren From b274a5e715bbc64eb2aa952c25206e13613e9a23 Mon Sep 17 00:00:00 2001 From: "smart-ssh-coder[bot]" <338317697+smart-ssh-coder[bot]@users.noreply.github.com> Date: Sat, 21 Nov 2026 02:07:28 +0000 Subject: [PATCH 2/9] fix(frontend): keep auth segments on one row, restyle keychain legend, 44px key path input (#1380) Co-Authored-By: Claude Sonnet 5.5 --- .../e2e/tests/server-form-connection-screenshots.spec.ts | 4 ++++ .../frontend/src/components/serverForm/AuthKindSegments.tsx | 4 ++-- .../frontend/src/components/serverForm/AuthMethodFields.tsx | 2 +- .../frontend/src/components/serverForm/ConnectionTab.tsx | 2 +- .../src/components/serverForm/ConvertToKeychainFieldset.tsx | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/smart-ssh-community/frontend/e2e/tests/server-form-connection-screenshots.spec.ts b/apps/smart-ssh-community/frontend/e2e/tests/server-form-connection-screenshots.spec.ts index 706f17f64..64e903bb0 100644 --- a/apps/smart-ssh-community/frontend/e2e/tests/server-form-connection-screenshots.spec.ts +++ b/apps/smart-ssh-community/frontend/e2e/tests/server-form-connection-screenshots.spec.ts @@ -11,5 +11,9 @@ test("Connection tab screenshots", async ({ app }) => { await app.page.getByRole("treeitem", { name: /^web-1\b/ }).click(); await app.page.getByRole("tab", { name: "Connection", exact: true }).click(); await expect(app.page.getByRole("button", { name: "Test Connection", exact: true })).toBeVisible(); + // Review: the segmented control stays on one row (no wrapped labels). + const group = app.page.getByRole("radiogroup").first(); + const rows = await group.locator("label").evaluateAll((els) => new Set(els.map((e) => Math.round(e.getBoundingClientRect().top))).size); + expect(rows).toBe(1); await captureScreen(app.page, "server-form-connection"); }); diff --git a/apps/smart-ssh-community/frontend/src/components/serverForm/AuthKindSegments.tsx b/apps/smart-ssh-community/frontend/src/components/serverForm/AuthKindSegments.tsx index 1947cc374..0d54a4a54 100644 --- a/apps/smart-ssh-community/frontend/src/components/serverForm/AuthKindSegments.tsx +++ b/apps/smart-ssh-community/frontend/src/components/serverForm/AuthKindSegments.tsx @@ -25,12 +25,12 @@ export function AuthKindSegments({
    {options.map((o) => (