Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ui/goose2/scripts/check-file-sizes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const EXCEPTIONS = {
justification:
"Workspace widget integration tests cover branch switching, worktree creation, dirty-state dialogs, and picker interactions.",
},
"src/features/settings/ui/ModelProviderRow.tsx": {
limit: 515,
justification:
"Multi-line i18n calls for error messages (fieldsMissing interpolation, exhaustive useCallback deps) push marginally past 500. Splitting would create a thin wrapper with no structural benefit.",
},
"src/features/sidebar/ui/Sidebar.tsx": {
limit: 580,
justification:
Expand Down
10 changes: 5 additions & 5 deletions ui/goose2/src/features/settings/ui/ModelProviderPanels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export function ConnectedFieldsPanel({
className="text-muted-foreground"
>
{resolveFieldValue(field, fieldValueMap).isSet
? "Edit"
: "Add"}
? t("common:actions.edit")
: t("common:actions.add")}
</Button>
)}
</div>
Expand Down Expand Up @@ -287,9 +287,9 @@ export function SetupFieldsPanel({
<AsyncButton
type="button"
state={saving ? "pending" : showSavedState ? "success" : "idle"}
idleLabel="Save"
pendingLabel="Saving..."
successLabel="Saved"
idleLabel={t("common:actions.save")}
pendingLabel={t("common:actions.saving")}
successLabel={t("common:actions.saved")}
pendingVisual="text"
pendingDelayMs={250}
size="sm"
Expand Down
32 changes: 22 additions & 10 deletions ui/goose2/src/features/settings/ui/ModelProviderRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function ModelProviderRow({
inventorySyncing = false,
inventoryWarning = null,
}: ModelProviderRowProps) {
const { t } = useTranslation("settings");
const { t } = useTranslation(["settings", "common"]);
const [expanded, setExpanded] = useState(false);
const [configValues, setConfigValues] = useState<ProviderFieldValue[]>([]);
const [draftValues, setDraftValues] = useState<Record<string, string>>({});
Expand Down Expand Up @@ -110,15 +110,15 @@ export function ModelProviderRow({
setError(
nextError instanceof Error
? nextError.message
: "Failed to load provider settings",
: t("providers.errors.loadFailed"),
);
} finally {
if (showSkeleton) {
setLoadingConfig(false);
}
}
},
[fields, hasFields, onGetConfig, provider.id],
[fields, hasFields, onGetConfig, provider.id, t],
);

useEffect(() => {
Expand Down Expand Up @@ -181,7 +181,7 @@ export function ModelProviderRow({
setSetupError(
nextError instanceof Error
? nextError.message
: "Failed to complete sign-in",
: t("providers.errors.signInFailed"),
);
} finally {
unlisten();
Expand Down Expand Up @@ -226,7 +226,7 @@ export function ModelProviderRow({
async function handleSaveField(field: ProviderField) {
const nextValue = draftValues[field.key]?.trim() ?? "";
if (!nextValue) {
setError(`Enter a value for ${field.label}`);
setError(t("providers.errors.fieldRequired", { label: field.label }));
return;
}
setError("");
Expand All @@ -240,7 +240,9 @@ export function ModelProviderRow({
setShowSavedState(true);
} catch (nextError) {
setError(
nextError instanceof Error ? nextError.message : "Failed to save",
nextError instanceof Error
? nextError.message
: t("providers.errors.saveFailed"),
);
}
}
Expand All @@ -258,7 +260,11 @@ export function ModelProviderRow({
.map((field) => field.label);

if (missingLabels.length > 0) {
setError(`Fill in ${missingLabels.join(", ")}`);
setError(
t("providers.errors.fieldsMissing", {
fields: missingLabels.join(", "),
}),
);
return;
}

Expand Down Expand Up @@ -295,7 +301,9 @@ export function ModelProviderRow({
setShowSavedState(false);
} catch (nextError) {
setError(
nextError instanceof Error ? nextError.message : "Failed to save",
nextError instanceof Error
? nextError.message
: t("providers.errors.saveFailed"),
);
}
}
Expand All @@ -310,7 +318,9 @@ export function ModelProviderRow({
setShowSavedState(false);
} catch (nextError) {
setError(
nextError instanceof Error ? nextError.message : "Failed to remove",
nextError instanceof Error
? nextError.message
: t("providers.errors.removeFailed"),
);
}
}
Expand Down Expand Up @@ -369,7 +379,9 @@ export function ModelProviderRow({
{authenticating ? (
<Spinner className="size-3.5 text-current" />
) : null}
{setupError ? "Retry" : "Connect"}
{setupError
? t("common:actions.retry")
: t("common:actions.connect")}
</Button>
</div>
) : (
Expand Down
4 changes: 4 additions & 0 deletions ui/goose2/src/shared/i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
"remove": "Remove",
"rename": "Rename",
"restore": "Restore",
"add": "Add",
"connect": "Connect",
"retry": "Retry",
"run": "Run",
"running": "Running",
"save": "Save",
"saved": "Saved",
"saving": "Saving...",
"saveChanges": "Save changes",
"search": "Search",
"select": "Select",
Expand Down
8 changes: 8 additions & 0 deletions ui/goose2/src/shared/i18n/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@
"title": "Agent harnesses"
},
"disconnect": "Disconnect",
"errors": {
"fieldRequired": "Enter a value for {{label}}",
"fieldsMissing": "Fill in {{fields}}",
"loadFailed": "Failed to load provider settings",
"removeFailed": "Failed to remove",
"saveFailed": "Failed to save",
"signInFailed": "Failed to complete sign-in"
},
"models": {
"description": "AI models power your agents. Goose requires one to work, but some agents bring their own.",
"notSet": "Not set",
Expand Down
4 changes: 4 additions & 0 deletions ui/goose2/src/shared/i18n/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@
"remove": "Quitar",
"rename": "Renombrar",
"restore": "Restaurar",
"add": "Agregar",
"connect": "Conectar",
"retry": "Reintentar",
"run": "Ejecutar",
"running": "Ejecutando",
"save": "Guardar",
"saved": "Guardado",
"saving": "Guardando...",
"saveChanges": "Guardar cambios",
"search": "Buscar",
"select": "Seleccionar",
Expand Down
8 changes: 8 additions & 0 deletions ui/goose2/src/shared/i18n/locales/es/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@
"title": "Arneses de agentes"
},
"disconnect": "Desconectar",
"errors": {
"fieldRequired": "Ingresa un valor para {{label}}",
"fieldsMissing": "Completa los campos: {{fields}}",
"loadFailed": "No se pudo cargar la configuración del proveedor",
"removeFailed": "Error al eliminar",
"saveFailed": "Error al guardar",
"signInFailed": "No se pudo completar el inicio de sesión"
},
"models": {
"description": "Necesitas al menos un proveedor de modelos para usar el agente Goose. Algunos agentes pueden traer sus propias conexiones de modelo.",
"notSet": "No configurado",
Expand Down
Loading