From 01b9adfcd93347cfab3ce8b981452a311fc3c3a2 Mon Sep 17 00:00:00 2001 From: NaeemDosh Date: Fri, 7 Aug 2026 13:38:15 +0500 Subject: [PATCH] i18n: re-sync German UI overlay onto Onyx v4.5.2 + lock to release tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Client is moving to release v4.5.2 (from the ~v4.3 the overlay was built on) and wants the pin on a release NUMBER, not a raw commit. - Re-synced end-user-i18n.patch: cherry-picked PR #12558 onto v4.5.2 and resolved the ~25 conflicts from upstream's own refactors. Strategy = never break the UI: kept v4.5.2's version for tangled components (they stay English) and hand-merged only the two that matter — AppProvider (i18n init + I18nextProvider) and SettingsPage (language selector). New i18n infra + all 5 locale dicts merged cleanly. 4 files upstream relocated were dropped (no dangling imports — verified). - Pin to release tag: upstream.pinnedCommit + i18n.baseCommit = v4.5.2 (make setup checks out the tag). Regenerated patch applies to pristine v4.5.2 with zero conflicts. - apply-branding.mjs: idempotent i18n step via a sentinel file (src/lib/i18n.ts), so re-running make apply no longer errors once branding has edited the patched files. - DHI base-image swap now also triggers on v4.5.2 (its Dockerfile uses dhi.io/node). - README: tag-pin model, coverage caveat, per-release re-sync guidance. Verified: patch applies clean to v4.5.2; full make apply green (i18n + 201 code + 376 locale replacements); selector + init wired; no leaked conflict markers. Image build to be run on a stable connection (local build blocked by network). --- README.md | 26 +- branding/apply-branding.mjs | 27 +- branding/branding.config.json | 6 +- branding/i18n/end-user-i18n.patch | 2134 ++++------------------------- 4 files changed, 274 insertions(+), 1919 deletions(-) diff --git a/README.md b/README.md index 3f4c41e..d213584 100644 --- a/README.md +++ b/README.md @@ -167,11 +167,19 @@ language switcher under Settings → Appearance and **instant** switching. It co It's wired into the overlay, config-driven from `branding.config.json → i18n`: -- `make apply` `git apply`s `branding/i18n/end-user-i18n.patch` onto the pinned checkout +- **Locked to a release tag** — `upstream.pinnedCommit` and `i18n.baseCommit` are both + set to the same Onyx **release** (currently **`v4.5.2`**), not a raw commit. +- `make apply` `git apply`s `branding/i18n/end-user-i18n.patch` onto that checkout **before** the branding codemod, then rebrands `Onyx`→`AIDO` inside every bundled dictionary (`web/public/locales/{de,en,es,fr,pt}/common.json`). -- Because the patch is pinned to its exact base commit - (`i18n.baseCommit == upstream.pinnedCommit`), it applies with **zero conflicts**. +- Because the patch is **re-synced against that exact release** (`i18n.baseCommit`), it + applies with **zero conflicts**. It will *not* apply to a different Onyx version — that's + why the deployment must run the pinned release (see the re-sync note below). + +> **Coverage:** most end-user components are translated. Where v4.5.2 refactored a +> component the PR also touched, that component keeps its English text (rather than risk a +> broken UI) — so translation coverage grows over time / with each re-sync, and the app is +> always guaranteed to build and run. ### Editing the German translations @@ -186,10 +194,14 @@ Set `i18n.enabled: false` in `branding.config.json`, bump `upstream.pinnedCommit forward, and re-run `make setup && make apply`. Your `de/common.json` carries over to the official feature, so migration is essentially free. -> **Upgrade note:** this is a large feature patch pinned to one commit. Moving to a much -> newer Onyx before official i18n lands needs a re-sync of the patch (regenerate it -> against the new base). `make apply` fails loudly with a clear message if the checkout -> isn't at `i18n.baseCommit`, so it never applies half-way. +> **Upgrade / re-sync note:** this is a large feature patch pinned to one release. To move +> to a newer Onyx while official i18n isn't out yet, the patch must be **re-synced** onto +> the new release tag (cherry-pick PR #12558 onto the tag, resolve conflicts against +> upstream's refactors, regenerate `end-user-i18n.patch`, bump both pins). This is the +> per-release maintenance step — cheapest done **one release at a time** rather than +> skipping several. `make apply` fails loudly if the checkout isn't at `i18n.baseCommit`, +> so it never applies half-way. **Lock your image tags to the pinned release** and only +> move after the re-sync is prepared. --- diff --git a/branding/apply-branding.mjs b/branding/apply-branding.mjs index 10bdb82..c0245c0 100644 --- a/branding/apply-branding.mjs +++ b/branding/apply-branding.mjs @@ -63,19 +63,22 @@ if (CONFIG.i18n && CONFIG.i18n.enabled) { warn(`i18n patch not found at ${patchPath} — skipping`); } else { const gitApply = (extra) => execFileSync("git", ["apply", "-p1", ...extra, patchPath], { cwd: ROOT, stdio: "pipe" }); - let already = false, ok2 = true; - try { gitApply(["--check"]); } - catch { - try { gitApply(["--reverse", "--check"]); already = true; } - catch { ok2 = false; } + // Idempotency sentinel: the patch adds this file. If it exists the overlay was + // already applied (a later branding pass may have edited the patched files, so a + // reverse-check is unreliable) — skip re-applying. + const sentinel = path.join(WEB, "src/lib/i18n.ts"); + if (existsSync(sentinel)) { + ok("i18n patch already applied (found src/lib/i18n.ts) — skipping"); + } else { + let applies = true; + try { gitApply(["--check"]); } catch { applies = false; } + if (!applies) { + console.error(`${c.red}✗ i18n patch does not apply. The checkout must be at i18n.baseCommit (${CONFIG.i18n.baseCommit}). Run \`make setup\` (pinnedCommit is set to that tag), or set i18n.enabled=false.${c.reset}`); + process.exit(1); + } + if (DRY) ok("i18n patch applies cleanly (dry-run, not written)"); + else { gitApply([]); ok(`applied i18n patch — react-i18next, user UI only (Admin stays English); default language ${CONFIG.i18n.defaultLanguage}`); } } - if (!ok2) { - console.error(`${c.red}✗ i18n patch does not apply. The checkout must be at i18n.baseCommit (${CONFIG.i18n.baseCommit}). Run \`make setup\` (pinnedCommit is set to that commit), or set i18n.enabled=false.${c.reset}`); - process.exit(1); - } - if (already) ok("i18n patch already applied — skipping"); - else if (DRY) ok("i18n patch applies cleanly (dry-run, not written)"); - else { gitApply([]); ok(`applied i18n patch — react-i18next, user UI only (Admin stays English); default language ${CONFIG.i18n.defaultLanguage}`); } } } diff --git a/branding/branding.config.json b/branding/branding.config.json index efa13a0..a3d5bdb 100644 --- a/branding/branding.config.json +++ b/branding/branding.config.json @@ -9,9 +9,9 @@ }, "upstream": { - "$comment": "Pin the exact Onyx commit/tag this overlay is authored against. Pinned to the base commit of the end-user i18n PR (#12558) so its patch applies cleanly (see i18n below). `make setup` checks out this commit. When Onyx merges official i18n, bump this forward and set i18n.enabled=false.", + "$comment": "Pin the exact Onyx release tag this overlay is authored against. `make setup` checks this out. Locked to a release NUMBER (e.g. v4.5.2), not a raw commit. The i18n patch below is re-synced against this exact tag, so it applies cleanly (see i18n). To move to a newer Onyx: re-sync the i18n patch onto the new tag, then bump this. When Onyx ships official i18n, bump this and set i18n.enabled=false.", "repo": "https://github.com/onyx-dot-app/onyx", - "pinnedCommit": "727e096de85680416bd8d5af0daec3a4f5b407d2", + "pinnedCommit": "v4.5.2", "webSrcRoot": "web" }, @@ -19,7 +19,7 @@ "$comment": "TEMPORARY end-user internationalization, backported from Onyx PR #12558 (react-i18next; user UI only, Admin stays English) until the official feature ships. apply-branding.mjs git-applies `patch` onto the pinned checkout BEFORE the branding string codemod, then the codemod also rebrands Onyx->AIDO inside the bundled locale dictionaries. Fill/refine translations in web/public/locales//common.json. Set enabled=false to drop it once official i18n lands.", "enabled": true, "patch": "branding/i18n/end-user-i18n.patch", - "baseCommit": "727e096de85680416bd8d5af0daec3a4f5b407d2", + "baseCommit": "v4.5.2", "defaultLanguage": "de", "rebrandLocales": true }, diff --git a/branding/i18n/end-user-i18n.patch b/branding/i18n/end-user-i18n.patch index b48e412..17086df 100644 --- a/branding/i18n/end-user-i18n.patch +++ b/branding/i18n/end-user-i18n.patch @@ -1,25 +1,25 @@ diff --git a/web/bun.lock b/web/bun.lock -index f83c54ca..3963ff0e 100644 +index 2927d138..e49acd34 100644 --- a/web/bun.lock +++ b/web/bun.lock -@@ -42,6 +42,8 @@ +@@ -43,6 +43,8 @@ "formik": "^2.2.9", "highlight.js": "^11.11.1", "highlightjs-sap-abap": "^0.3.0", + "i18next": "^26.3.4", + "i18next-browser-languagedetector": "^8.2.1", "js-cookie": "^3.0.5", - "katex": "^0.16.38", + "katex": "^0.17.0", "linguist-languages": "^9.3.1", -@@ -58,6 +60,7 @@ +@@ -59,6 +61,7 @@ "react-day-picker": "^9.13.0", "react-dom": "19.2.4", "react-dropzone": "^14.2.3", + "react-i18next": "^17.0.8", "react-icons": "^4.8.0", "react-markdown": "^9.0.1", - "recharts": "^2.13.1", -@@ -1464,6 +1467,8 @@ + "recharts": "^3.9.2", +@@ -1667,6 +1670,8 @@ "html-escaper": ["html-escaper@2.0.2", "", {}, "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg=="], @@ -28,7 +28,7 @@ index f83c54ca..3963ff0e 100644 "html-url-attributes": ["html-url-attributes@3.0.1", "", {}, "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ=="], "html-void-elements": ["html-void-elements@3.0.0", "", {}, "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg=="], -@@ -1476,6 +1481,10 @@ +@@ -1679,6 +1684,10 @@ "hyperdyperid": ["hyperdyperid@1.2.0", "", {}, "sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A=="], @@ -39,7 +39,7 @@ index f83c54ca..3963ff0e 100644 "iconv-lite": ["iconv-lite@0.6.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw=="], "identity-obj-proxy": ["identity-obj-proxy@3.0.0", "", { "dependencies": { "harmony-reflect": "^1.4.6" } }, "sha512-00n6YnVHKrinT9t0d9+5yZC6UBNJANpYEQvL2LlX6Ab9lnmxzIRcEmTPuyGScvl1+jKuCICX1Z0Ab1pPKKdikA=="], -@@ -2002,6 +2011,8 @@ +@@ -2193,6 +2202,8 @@ "react-fast-compare": ["react-fast-compare@2.0.4", "", {}, "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw=="], @@ -48,7 +48,7 @@ index f83c54ca..3963ff0e 100644 "react-icons": ["react-icons@4.12.0", "", { "peerDependencies": { "react": "*" } }, "sha512-IBaDuHiShdZqmfc/TwHu6+d6k2ltNCf3AszxNmjJc1KUfXdEeRJOKyNvLmAHaarhzGmTSVygNdyu8/opXv2gaw=="], "react-is": ["react-is@19.2.7", "", {}, "sha512-kZFnouyVv7eP/Phmrlo9FK+zcAdriZJvzxXHF1Sl1P377WSGe2G/JxVolhTrB/jeV47lKImhNUsijjHAAbcl/A=="], -@@ -2302,6 +2313,8 @@ +@@ -2499,6 +2510,8 @@ "vite": ["vite@6.4.3", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", "tinyglobby": "^0.2.13" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A=="], @@ -57,6 +57,36 @@ index f83c54ca..3963ff0e 100644 "w3c-xmlserializer": ["w3c-xmlserializer@5.0.0", "", { "dependencies": { "xml-name-validator": "^5.0.0" } }, "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA=="], "walker": ["walker@1.0.8", "", { "dependencies": { "makeerror": "1.0.12" } }, "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ=="], +diff --git a/web/lib/opal/src/components/inputs/password-input-type-in/components.tsx b/web/lib/opal/src/components/inputs/password-input-type-in/components.tsx +index 23fa6d67..fbe48141 100644 +--- a/web/lib/opal/src/components/inputs/password-input-type-in/components.tsx ++++ b/web/lib/opal/src/components/inputs/password-input-type-in/components.tsx +@@ -9,6 +9,7 @@ import { + } from "@opal/components"; + import { cn } from "@opal/utils"; + import { SvgEye, SvgEyeClosed } from "@opal/icons"; ++import { useTranslation } from "react-i18next"; + + // Backend placeholder pattern - indicates a stored value that can't be revealed + const BACKEND_PLACEHOLDER_PATTERN = /^•+$/; // All bullet characters (U+2022) +@@ -108,11 +109,14 @@ function PasswordInputTypeIn({ + + const showToggleButton = hasValue || isFocused; + const isRevealed = isPasswordVisible && !effectiveNonRevealable; ++ const { t } = useTranslation(); + const toggleLabel = effectiveNonRevealable +- ? "Value cannot be revealed" ++ ? t("auth.value_cannot_be_revealed", { ++ defaultValue: "Value cannot be revealed", ++ }) + : isPasswordVisible +- ? "Hide password" +- : "Show password"; ++ ? t("auth.hide_password", { defaultValue: "Hide password" }) ++ : t("auth.show_password", { defaultValue: "Show password" }); + + const isNativeMask = mask === "native"; + // The ✱ presentation only draws while idle. Focus anywhere in the field diff --git a/web/lib/opal/src/layouts/settings/components.tsx b/web/lib/opal/src/layouts/settings/components.tsx index 9ccfc31a..029d4a9d 100644 --- a/web/lib/opal/src/layouts/settings/components.tsx @@ -148,110 +178,27 @@ index 9ccfc31a..029d4a9d 100644 sizePreset="headline" variant="heading" /> -diff --git a/web/lib/opal/src/layouts/sidebar/components.tsx b/web/lib/opal/src/layouts/sidebar/components.tsx -index 280260b4..16821d5a 100644 ---- a/web/lib/opal/src/layouts/sidebar/components.tsx -+++ b/web/lib/opal/src/layouts/sidebar/components.tsx -@@ -1,4 +1,4 @@ --"use client"; -+"use client"; - - import "@opal/layouts/sidebar/styles.css"; - import { -@@ -17,6 +17,7 @@ import { SvgSidebar } from "@opal/icons"; - import type { RichStr } from "@opal/types"; - import { useSidebarState } from "@opal/layouts/root/components"; - import useScreenSize from "@opal/hooks/useScreenSize"; -+import { useTranslation } from "react-i18next"; - - // --------------------------------------------------------------------------- - // Constants -@@ -110,7 +111,7 @@ function SidebarRoot({ foldable = false, children }: SidebarRootProps) { - } - - // --------------------------------------------------------------------------- --// Header — topbar (logo + fold button) with optional pinned content below -+// Header ÔÇö topbar (logo + fold button) with optional pinned content below - // --------------------------------------------------------------------------- - - interface SidebarHeaderProps { -@@ -129,6 +130,7 @@ function SidebarHeader({ - showLogoWhenFolded = true, - children, - }: SidebarHeaderProps) { -+ const { t } = useTranslation(); - const foldable = useContext(SidebarFoldableContext); - const { folded, setFolded } = useSidebarState(); - const toggleFolded = useCallback( -@@ -142,14 +144,18 @@ function SidebarHeader({ - { - }; - - /** -- * Get a human-readable title for a given error code -+ * Get a human-readable translation key for a given error code - */ - export const getErrorTitle = (errorCode?: string) => { - switch (errorCode) { - case "RATE_LIMIT": -- return "Rate Limit Exceeded"; -+ return "chat.errors.rate_limit"; - case "AUTH_ERROR": -- return "Authentication Error"; -+ return "chat.errors.auth_error"; - case "PERMISSION_DENIED": -- return "Permission Denied"; -+ return "chat.errors.permission_denied"; - case "CONTEXT_TOO_LONG": -- return "Message Too Long"; -+ return "chat.errors.context_too_long"; - case "TOOL_CALL_FAILED": -- return "Tool Error"; -+ return "chat.errors.tool_call_failed"; - case "CONNECTION_ERROR": -- return "Connection Error"; -+ return "chat.errors.connection_error"; - case "SERVICE_UNAVAILABLE": -- return "Service Unavailable"; -+ return "chat.errors.service_unavailable"; - case "INIT_FAILED": -- return "Initialization Error"; -+ return "chat.errors.init_failed"; - case "VALIDATION_ERROR": -- return "Validation Error"; -+ return "chat.errors.validation_error"; - case "BUDGET_EXCEEDED": -- return "Budget Exceeded"; -+ return "chat.errors.budget_exceeded"; - case "CONTENT_POLICY": -- return "Content Policy Violation"; -+ return "chat.errors.content_policy"; - case "BAD_REQUEST": -- return "Invalid Request"; -+ return "chat.errors.bad_request"; - case "NOT_FOUND": -- return "Resource Not Found"; -+ return "chat.errors.not_found"; - case "API_ERROR": -- return "API Error"; -+ return "chat.errors.api_error"; - default: -- return "Error"; -+ return "chat.errors.generic_error"; - } - }; diff --git a/web/src/app/app/message/messageComponents/AgentMessage.tsx b/web/src/app/app/message/messageComponents/AgentMessage.tsx -index 7de28271..0aeb043d 100644 +index c1dc6462..bd4c2330 100644 --- a/web/src/app/app/message/messageComponents/AgentMessage.tsx +++ b/web/src/app/app/message/messageComponents/AgentMessage.tsx @@ -7,6 +7,7 @@ import React, { @@ -11235,7 +11029,7 @@ index 7de28271..0aeb043d 100644 )} diff --git a/web/src/app/app/message/messageComponents/MessageToolbar.tsx b/web/src/app/app/message/messageComponents/MessageToolbar.tsx -index ee33292a..7a5b33ff 100644 +index f60f4b58..a61bc2be 100644 --- a/web/src/app/app/message/messageComponents/MessageToolbar.tsx +++ b/web/src/app/app/message/messageComponents/MessageToolbar.tsx @@ -1,6 +1,7 @@ @@ -11246,7 +11040,7 @@ index ee33292a..7a5b33ff 100644 import { Packet, StreamingCitation } from "@/app/app/services/streamingModels"; import { FeedbackType, Message } from "@/app/app/interfaces"; import { OnyxDocument } from "@/lib/search/interfaces"; -@@ -51,6 +52,7 @@ const SourcesTagWrapper = React.memo(function SourcesTagWrapper({ +@@ -52,6 +53,7 @@ const SourcesTagWrapper = React.memo(function SourcesTagWrapper({ updateCurrentDocumentSidebarVisible, updateCurrentSelectedNodeForDocDisplay, }: SouurcesTagWrapperProps) { @@ -11254,7 +11048,7 @@ index ee33292a..7a5b33ff 100644 // Convert citations to SourceInfo array const sources = useMemo( () => citationsToSourceInfoArray(citations, documentMap), -@@ -79,7 +81,7 @@ const SourcesTagWrapper = React.memo(function SourcesTagWrapper({ +@@ -80,7 +82,7 @@ const SourcesTagWrapper = React.memo(function SourcesTagWrapper({ return ( -@@ -279,8 +284,8 @@ export default function MessageToolbar({ +@@ -284,8 +289,8 @@ export default function MessageToolbar({ state={isFeedbackTransient("dislike") ? "selected" : "empty"} tooltip={ currentFeedback === "dislike" @@ -11294,7 +11088,7 @@ index ee33292a..7a5b33ff 100644 data-testid="AgentMessage/dislike-button" /> diff --git a/web/src/app/app/message/messageComponents/timeline/headers/CompletedHeader.tsx b/web/src/app/app/message/messageComponents/timeline/headers/CompletedHeader.tsx -index 3f82e60a..a7cc3147 100644 +index 78e152c3..ea5cd57a 100644 --- a/web/src/app/app/message/messageComponents/timeline/headers/CompletedHeader.tsx +++ b/web/src/app/app/message/messageComponents/timeline/headers/CompletedHeader.tsx @@ -1,6 +1,7 @@ @@ -11419,262 +11213,6 @@ index 64dfae54..f45c92cc 100644 )} -diff --git a/web/src/app/app/message/messageComponents/timeline/hooks/useTimelineHeader.ts b/web/src/app/app/message/messageComponents/timeline/hooks/useTimelineHeader.ts -index beab5cb9..c9125c04 100644 ---- a/web/src/app/app/message/messageComponents/timeline/hooks/useTimelineHeader.ts -+++ b/web/src/app/app/message/messageComponents/timeline/hooks/useTimelineHeader.ts -@@ -1,4 +1,5 @@ - import { useMemo } from "react"; -+import { useTranslation } from "react-i18next"; - import { TurnGroup } from "../transformers"; - import { - PacketType, -@@ -26,33 +27,55 @@ export function useTimelineHeader( - stopReason?: StopReason, - isGeneratingImage?: boolean - ): TimelineHeaderResult { -+ const { t } = useTranslation(); -+ - return useMemo(() => { - const hasPackets = turnGroups.length > 0; - const userStopped = stopReason === StopReason.USER_CANCELLED; - - // If generating image with no tool packets, show image generation header - if (isGeneratingImage && !hasPackets) { -- return { headerText: "Generating image...", hasPackets, userStopped }; -+ return { -+ headerText: t("chat.timeline.generating_image"), -+ hasPackets, -+ userStopped, -+ }; - } - - if (!hasPackets) { -- return { headerText: "Thinking...", hasPackets, userStopped }; -+ return { -+ headerText: t("chat.timeline.thinking"), -+ hasPackets, -+ userStopped, -+ }; - } - - // Get the last (current) turn group - const currentTurn = turnGroups[turnGroups.length - 1]; - if (!currentTurn) { -- return { headerText: "Thinking...", hasPackets, userStopped }; -+ return { -+ headerText: t("chat.timeline.thinking"), -+ hasPackets, -+ userStopped, -+ }; - } - - const currentStep = currentTurn.steps[0]; - if (!currentStep?.packets?.length) { -- return { headerText: "Thinking...", hasPackets, userStopped }; -+ return { -+ headerText: t("chat.timeline.thinking"), -+ hasPackets, -+ userStopped, -+ }; - } - - const firstPacket = currentStep.packets[0]; - if (!firstPacket) { -- return { headerText: "Thinking...", hasPackets, userStopped }; -+ return { -+ headerText: t("chat.timeline.thinking"), -+ hasPackets, -+ userStopped, -+ }; - } - - const packetType = firstPacket.obj.type; -@@ -64,36 +87,54 @@ export function useTimelineHeader( - ); - let headerText: string; - if (searchState.hasResults && !searchState.isInternetSearch) { -- headerText = "Reading"; -+ headerText = t("chat.timeline.reading"); - } else if (searchState.isInternetSearch) { -- headerText = "Searching the web"; -+ headerText = t("chat.timeline.searching_web"); - } else { - // A source filter overrides the header with the connector(s). -- headerText = formatSearchHeader(searchState.sourceFilters); -+ headerText = formatSearchHeader(searchState.sourceFilters, t); - } - return { headerText, hasPackets, userStopped }; - } - - if (packetType === PacketType.FETCH_TOOL_START) { -- return { headerText: "Reading", hasPackets, userStopped }; -+ return { -+ headerText: t("chat.timeline.reading"), -+ hasPackets, -+ userStopped, -+ }; - } - - if (packetType === PacketType.PYTHON_TOOL_START) { -- return { headerText: "Executing code", hasPackets, userStopped }; -+ return { -+ headerText: t("chat.timeline.executing_code"), -+ hasPackets, -+ userStopped, -+ }; - } - - if (packetType === PacketType.IMAGE_GENERATION_TOOL_START) { -- return { headerText: "Generating images", hasPackets, userStopped }; -+ return { -+ headerText: t("chat.timeline.generating_images"), -+ hasPackets, -+ userStopped, -+ }; - } - - if (packetType === PacketType.FILE_READER_START) { -- return { headerText: "Reading file", hasPackets, userStopped }; -+ return { -+ headerText: t("chat.timeline.reading_file"), -+ hasPackets, -+ userStopped, -+ }; - } - - if (packetType === PacketType.CUSTOM_TOOL_START) { - const toolName = (firstPacket.obj as CustomToolStart).tool_name; - return { -- headerText: toolName ? `Executing ${toolName}` : "Executing tool", -+ headerText: toolName -+ ? t("chat.timeline.executing_tool_name", { toolName }) -+ : t("chat.timeline.executing_tool"), - hasPackets, - userStopped, - }; -@@ -103,21 +144,37 @@ export function useTimelineHeader( - packetType === PacketType.MEMORY_TOOL_START || - packetType === PacketType.MEMORY_TOOL_NO_ACCESS - ) { -- return { headerText: "Updating memory...", hasPackets, userStopped }; -+ return { -+ headerText: t("chat.timeline.updating_memory"), -+ hasPackets, -+ userStopped, -+ }; - } - - if (packetType === PacketType.REASONING_START) { -- return { headerText: "Thinking", hasPackets, userStopped }; -+ return { -+ headerText: t("chat.timeline.thinking_no_dots"), -+ hasPackets, -+ userStopped, -+ }; - } - - if (packetType === PacketType.DEEP_RESEARCH_PLAN_START) { -- return { headerText: "Generating plan", hasPackets, userStopped }; -+ return { -+ headerText: t("chat.timeline.generating_plan"), -+ hasPackets, -+ userStopped, -+ }; - } - - if (packetType === PacketType.RESEARCH_AGENT_START) { -- return { headerText: "Researching", hasPackets, userStopped }; -+ return { -+ headerText: t("chat.timeline.researching"), -+ hasPackets, -+ userStopped, -+ }; - } - -- return { headerText: "Thinking...", hasPackets, userStopped }; -- }, [turnGroups, stopReason, isGeneratingImage]); -+ return { headerText: t("chat.timeline.thinking"), hasPackets, userStopped }; -+ }, [turnGroups, stopReason, isGeneratingImage, t]); - } -diff --git a/web/src/app/app/message/messageComponents/timeline/renderers/search/InternalSearchToolRenderer.tsx b/web/src/app/app/message/messageComponents/timeline/renderers/search/InternalSearchToolRenderer.tsx -index f99484dc..750425c5 100644 ---- a/web/src/app/app/message/messageComponents/timeline/renderers/search/InternalSearchToolRenderer.tsx -+++ b/web/src/app/app/message/messageComponents/timeline/renderers/search/InternalSearchToolRenderer.tsx -@@ -1,4 +1,5 @@ - import { SvgSearch, SvgSearchMenu } from "@opal/icons"; -+import { useTranslation } from "react-i18next"; - import { SearchToolPacket } from "@/app/app/services/streamingModels"; - import { - MessageRenderer, -@@ -61,6 +62,7 @@ export const InternalSearchToolRenderer: MessageRenderer< - renderType, - children, - }) => { -+ const { t } = useTranslation(); - const searchState = constructCurrentSearchState(packets); - const { queries, results, sourceFilters, isComplete } = searchState; - -@@ -71,7 +73,7 @@ export const InternalSearchToolRenderer: MessageRenderer< - const hasResults = results.length > 0; - - // A source filter overrides the header with the connector(s) it scoped to. -- const queriesHeader = formatSearchHeader(sourceFilters); -+ const queriesHeader = formatSearchHeader(sourceFilters, t); - - if (queries.length === 0) { - return children([ -diff --git a/web/src/app/app/message/messageComponents/timeline/renderers/search/searchStateUtils.ts b/web/src/app/app/message/messageComponents/timeline/renderers/search/searchStateUtils.ts -index c4c09005..4ee5cc74 100644 ---- a/web/src/app/app/message/messageComponents/timeline/renderers/search/searchStateUtils.ts -+++ b/web/src/app/app/message/messageComponents/timeline/renderers/search/searchStateUtils.ts -@@ -45,8 +45,15 @@ export interface SearchState { - */ - const MAX_HEADER_SOURCES = 3; - --export const formatSearchHeader = (sourceFilters: string[]): string => { -- if (sourceFilters.length === 0) return "Searching internal documents"; -+export const formatSearchHeader = ( -+ sourceFilters: string[], -+ t?: any -+): string => { -+ if (sourceFilters.length === 0) { -+ return t -+ ? t("chat.timeline.searching_internal") -+ : "Searching internal documents"; -+ } - const names = sourceFilters.map((source) => - isValidSource(source) - ? getSourceDisplayName(source as ValidSources) -@@ -54,9 +61,25 @@ export const formatSearchHeader = (sourceFilters: string[]): string => { - ); - const shown = names.slice(0, MAX_HEADER_SOURCES); - const overflow = names.length - shown.length; -- const label = -- overflow > 0 ? `${shown.join(", ")} +${overflow} more` : shown.join(", "); -- return `Searching ${label}`; -+ const listStr = shown.join(", "); -+ -+ if (t) { -+ const label = -+ overflow > 0 -+ ? t("chat.timeline.sources_overflow", { -+ list: listStr, -+ count: overflow, -+ defaultValue: `${listStr} +${overflow} more`, -+ }) -+ : listStr; -+ return t("chat.timeline.searching_sources", { -+ sources: label, -+ defaultValue: `Searching ${label}`, -+ }); -+ } else { -+ const label = overflow > 0 ? `${listStr} +${overflow} more` : listStr; -+ return `Searching ${label}`; -+ } - }; - - /** Constructs the current search state from search tool packets. */ diff --git a/web/src/app/app/message/messageComponents/toolDisplayHelpers.tsx b/web/src/app/app/message/messageComponents/toolDisplayHelpers.tsx index e877f6c7..186d0111 100644 --- a/web/src/app/app/message/messageComponents/toolDisplayHelpers.tsx @@ -11741,223 +11279,6 @@ index e877f6c7..186d0111 100644 } } -diff --git a/web/src/app/app/settings/layout.tsx b/web/src/app/app/settings/layout.tsx -index 1932772e..fcc563fa 100644 ---- a/web/src/app/app/settings/layout.tsx -+++ b/web/src/app/app/settings/layout.tsx -@@ -7,6 +7,7 @@ import { SvgSliders } from "@opal/icons"; - import { useUser } from "@/providers/UserProvider"; - import { useAuthType } from "@/lib/hooks"; - import { Section } from "@/layouts/general-layouts"; -+import { useTranslation } from "react-i18next"; - - interface LayoutProps { - children: React.ReactNode; -@@ -16,6 +17,7 @@ export default function Layout({ children }: LayoutProps) { - const pathname = usePathname(); - const { user } = useUser(); - const authType = useAuthType(); -+ const { t } = useTranslation(); - - const showPasswordSection = Boolean(user?.password_configured); - const showTokensSection = authType !== null; -@@ -23,7 +25,11 @@ export default function Layout({ children }: LayoutProps) { - - return ( - -- -+ - - -
-- General -+ {t("settings.tabs.general", "General")} - - -- Chat Preferences -+ {t("settings.tabs.chat_preferences", "Chat Preferences")} - - {showAccountsAccessTab && ( - -- Accounts & Access -+ {t("settings.tabs.accounts_access", "Accounts & Access")} - - )} - -- Connectors -+ {t("settings.tabs.connectors", "Connectors")} - - - -diff --git a/web/src/app/auth/login/EmailPasswordForm.test.tsx b/web/src/app/auth/login/EmailPasswordForm.test.tsx -index a2c46a98..a273f199 100644 ---- a/web/src/app/auth/login/EmailPasswordForm.test.tsx -+++ b/web/src/app/auth/login/EmailPasswordForm.test.tsx -@@ -143,7 +143,7 @@ describe("Email/Password Signup Workflow", () => { - - // User submits the signup form - const signupButton = screen.getByRole("button", { -- name: /create account/i, -+ name: /create an? account/i, - }); - await user.click(signupButton); - -@@ -209,7 +209,7 @@ describe("Email/Password Signup Workflow", () => { - - // User submits - const signupButton = screen.getByRole("button", { -- name: /create account/i, -+ name: /create an? account/i, - }); - await user.click(signupButton); - -@@ -244,7 +244,7 @@ describe("Email/Password Signup Workflow", () => { - - // User submits - const signupButton = screen.getByRole("button", { -- name: /create account/i, -+ name: /create an? account/i, - }); - await user.click(signupButton); - -diff --git a/web/src/app/auth/login/EmailPasswordForm.tsx b/web/src/app/auth/login/EmailPasswordForm.tsx -index bcfee123..46204ea0 100644 ---- a/web/src/app/auth/login/EmailPasswordForm.tsx -+++ b/web/src/app/auth/login/EmailPasswordForm.tsx -@@ -19,6 +19,7 @@ import { APIFormFieldState } from "@/refresh-components/form/types"; - import { SvgArrowRightCircle } from "@opal/icons"; - import { useCaptcha } from "@/lib/hooks/useCaptcha"; - import { Spacer } from "@opal/components"; -+import { useTranslation } from "react-i18next"; - - interface EmailPasswordFormProps { - isSignup?: boolean; -@@ -37,6 +38,7 @@ export default function EmailPasswordForm({ - defaultEmail, - isJoin = false, - }: EmailPasswordFormProps) { -+ const { t } = useTranslation(); - const { user, authTypeMetadata } = useUser(); - const passwordMinLength = authTypeMetadata?.passwordMinLength ?? 8; - const [isWorking, setIsWorking] = useState(false); -@@ -49,15 +51,15 @@ export default function EmailPasswordForm({ - () => ({ - loading: isSignup - ? isJoin -- ? "Joining..." -- : "Creating account..." -- : "Signing in...", -+ ? t("auth.joining") -+ : t("auth.creating_account") -+ : t("auth.signing_in"), - success: isSignup -- ? "Account created. Signing in..." -- : "Signed in successfully.", -+ ? t("auth.account_created_signing_in") -+ : t("auth.signed_in_successfully"), - error: errorMessage, - }), -- [isSignup, isJoin, errorMessage] -+ [isSignup, isJoin, errorMessage, t] - ); - - return ( -@@ -159,9 +161,9 @@ export default function EmailPasswordForm({ - const errorDetail: any = (await loginResponse.json()).detail; - let errorMsg: string = "Unknown error"; - if (errorDetail === "LOGIN_BAD_CREDENTIALS") { -- errorMsg = "Invalid email or password"; -+ errorMsg = t("auth.invalid_email_or_password"); - } else if (errorDetail === "NO_WEB_LOGIN_AND_HAS_NO_PASSWORD") { -- errorMsg = "Create an account to set a password"; -+ errorMsg = t("auth.create_an_account_to_set_password"); - } else if (typeof errorDetail === "string") { - errorMsg = errorDetail; - } -@@ -181,7 +183,7 @@ export default function EmailPasswordForm({ - name="email" - render={(field, helper, meta, state) => ( - -- Email Address -+ {t("auth.email_address")} - - ( - -- Password -+ {t("auth.password")} - - - )} -@@ -254,7 +262,11 @@ export default function EmailPasswordForm({ - width="full" - rightIcon={SvgArrowRightCircle} - > -- {isJoin ? "Join" : isSignup ? "Create Account" : "Sign In"} -+ {isJoin -+ ? t("auth.join") -+ : isSignup -+ ? t("auth.create_account") -+ : t("auth.sign_in")} - - {user?.is_anonymous_user && ( - - -- or continue as guest -+ {t("auth.or_continue_as_guest")} - - - )} diff --git a/web/src/app/auth/login/LoginText.tsx b/web/src/app/auth/login/LoginText.tsx index 6be13325..ef787fac 100644 --- a/web/src/app/auth/login/LoginText.tsx @@ -12008,32 +11329,6 @@ index 00000000..9857f634 + + ); +} -diff --git a/web/src/app/auth/signup/page.tsx b/web/src/app/auth/signup/page.tsx -index a92fe888..304ca341 100644 ---- a/web/src/app/auth/signup/page.tsx -+++ b/web/src/app/auth/signup/page.tsx -@@ -14,6 +14,7 @@ import AuthErrorDisplay from "@/components/auth/AuthErrorDisplay"; - import Text from "@/refresh-components/texts/Text"; - import { cn } from "@opal/utils"; - import { AuthType } from "@/lib/constants"; -+import SignupText from "./SignupText"; - - const Page = async (props: { - searchParams?: Promise<{ [key: string]: string | string[] | undefined }>; -@@ -73,12 +74,7 @@ const Page = async (props: { - )} - > -
-- -- {cloud ? "Complete your sign up" : "Create account"} -- -- -- Get started with Onyx -- -+ -
- {cloud && authUrl && ( -
diff --git a/web/src/components/auth/AuthFlowContainer.tsx b/web/src/components/auth/AuthFlowContainer.tsx index 505057e9..339b68ba 100644 --- a/web/src/components/auth/AuthFlowContainer.tsx @@ -12175,131 +11470,6 @@ index 28d376ef..4df8a551 100644 ); -diff --git a/web/src/layouts/chromes/AppChrome.tsx b/web/src/layouts/chromes/AppChrome.tsx -index 9b57e36f..5fe073c1 100644 ---- a/web/src/layouts/chromes/AppChrome.tsx -+++ b/web/src/layouts/chromes/AppChrome.tsx -@@ -2,13 +2,13 @@ - - import { - useCallback, -- useEffect, -- useLayoutEffect, - useMemo, - useRef, - useState, -+ useEffect, - type ReactNode, - } from "react"; -+import { useTranslation } from "react-i18next"; - import { RootLayout, RootLayoutRightPanelSlotContext } from "@opal/layouts"; - import { cn, markdown } from "@opal/utils"; - import { INTERACTIVE_SELECTOR, noProp } from "@/lib/utils"; -@@ -66,6 +66,7 @@ import { useFullWidthChat } from "@/providers/FullWidthChatProvider"; - // --------------------------------------------------------------------------- - - function Header() { -+ const { t } = useTranslation(); - const appFocus = useAppFocus(); - const businessTier = useTierAtLeast(Tier.BUSINESS); - const { state, setAppMode } = useQueryController(); -@@ -219,7 +220,7 @@ function Header() { - sizePreset="main-ui" - rounding="sm" - icon={SvgFolderIn} -- title="Move to Project" -+ title={t("projects.move_to_project")} - onClick={noProp(() => setShowMoveOptions(true))} - />, - setDeleteConfirmationModalOpen(true))} - />, - ]; -@@ -240,6 +241,7 @@ function Header() { - currentChatSession, - setDeleteConfirmationModalOpen, - handleMoveClick, -+ t, - ]); - - return ( -@@ -270,17 +272,16 @@ function Header() { - - {deleteModalOpen && ( - setDeleteModalOpen(false)} - submit={ - - } - > -- Are you sure you want to delete this chat? This action cannot be -- undone. -+ {t("projects.delete_chat_confirm")} - - )} - -@@ -397,7 +398,7 @@ function Header() { - onClick={() => setShowShareModal(true)} - aria-label="share-chat-button" - > -- Share -+ {t("projects.share")} - - - )} - {submit} diff --git a/web/src/refresh-components/modals/MemoriesModal.tsx b/web/src/refresh-components/modals/MemoriesModal.tsx -index dc857ba3..4da74c08 100644 +index 8def9724..6ee00137 100644 --- a/web/src/refresh-components/modals/MemoriesModal.tsx +++ b/web/src/refresh-components/modals/MemoriesModal.tsx -@@ -12,6 +12,7 @@ import TextSeparator from "@/refresh-components/TextSeparator"; - import { toast } from "@/hooks/useToast"; - import { useModalClose } from "@/refresh-components/contexts/ModalContext"; +@@ -11,6 +11,7 @@ import TextSeparator from "@/refresh-components/TextSeparator"; + import { toast } from "@opal/layouts"; + import { useModalClose } from "@opal/components"; import { SvgAddLines, SvgMinusCircle, SvgPlusCircle } from "@opal/icons"; +import { useTranslation } from "react-i18next"; import { useMemoryManager, MAX_MEMORY_LENGTH, -@@ -50,6 +51,7 @@ function MemoryItem({ +@@ -49,6 +50,7 @@ function MemoryItem({ const [isHighlighting, setIsHighlighting] = useState(false); const textareaRef = useRef(null); const wrapperRef = useRef(null); @@ -12668,7 +11799,7 @@ index dc857ba3..4da74c08 100644 useEffect(() => { if (shouldFocus && textareaRef.current) { -@@ -91,7 +93,10 @@ function MemoryItem({ +@@ -90,7 +92,10 @@ function MemoryItem({
onUpdate(originalIndex, e.target.value)} onFocus={() => setIsFocused(true)} -@@ -121,8 +126,8 @@ function MemoryItem({ +@@ -119,8 +124,8 @@ function MemoryItem({ prominence="tertiary" icon={SvgMinusCircle} onClick={() => void onRemove(originalIndex)} @@ -12691,7 +11822,7 @@ index dc857ba3..4da74c08 100644 />
(null); @@ -12699,7 +11830,7 @@ index dc857ba3..4da74c08 100644 // Self-fetching: when no props provided, fetch from UserProvider const { user, refreshUser, updateUserPersonalization } = useUser(); -@@ -179,8 +185,14 @@ export default function MemoriesModal({ +@@ -177,8 +183,14 @@ export default function MemoriesModal({ user, updateUserPersonalization, { @@ -12716,7 +11847,7 @@ index dc857ba3..4da74c08 100644 } ); -@@ -239,7 +251,22 @@ export default function MemoriesModal({ +@@ -237,7 +249,22 @@ export default function MemoriesModal({ } = useMemoryManager({ memories: effectiveMemories, onSaveMemories: effectiveSave, @@ -12740,7 +11871,7 @@ index dc857ba3..4da74c08 100644 }); // Always start with an empty card; optionally focus it (View/Add button) -@@ -267,13 +294,16 @@ export default function MemoriesModal({ +@@ -265,13 +292,16 @@ export default function MemoriesModal({ setSearchQuery(e.target.value)} searchIcon -@@ -285,11 +315,14 @@ export default function MemoriesModal({ +@@ -283,11 +313,14 @@ export default function MemoriesModal({ rightIcon={SvgPlusCircle} title={ !canAddMemory @@ -12777,7 +11908,7 @@ index dc857ba3..4da74c08 100644
-@@ -299,8 +332,14 @@ export default function MemoriesModal({ +@@ -297,8 +330,14 @@ export default function MemoriesModal({
{searchQuery.trim() @@ -12794,7 +11925,7 @@ index dc857ba3..4da74c08 100644
) : ( -@@ -329,7 +368,11 @@ export default function MemoriesModal({ +@@ -327,7 +366,11 @@ export default function MemoriesModal({ )} diff --git a/web/src/refresh-components/popovers/ActionsPopover/ActionLineItem.tsx b/web/src/refresh-components/popovers/ActionsPopover/ActionLineItem.tsx -index e2b724bc..bfb4fbec 100644 +index ec3163e2..e2b8dc10 100644 --- a/web/src/refresh-components/popovers/ActionsPopover/ActionLineItem.tsx +++ b/web/src/refresh-components/popovers/ActionsPopover/ActionLineItem.tsx @@ -18,6 +18,8 @@ import { useRouter } from "next/navigation"; @@ -12837,7 +11968,7 @@ index e2b724bc..bfb4fbec 100644 } const isSearchToolWithNoConnectors = -@@ -184,8 +187,11 @@ export default function ActionLineItem({ +@@ -185,8 +188,11 @@ export default function ActionLineItem({ -diff --git a/web/src/sections/modals/CreateProjectModal.tsx b/web/src/sections/modals/CreateProjectModal.tsx -index b819f593..d1ace6ba 100644 ---- a/web/src/sections/modals/CreateProjectModal.tsx -+++ b/web/src/sections/modals/CreateProjectModal.tsx -@@ -2,6 +2,8 @@ - - import { Formik, Form } from "formik"; - import * as Yup from "yup"; -+import { useMemo } from "react"; -+import { useTranslation } from "react-i18next"; - import { Button } from "@opal/components"; - import { useProjectsContext } from "@/providers/ProjectsContext"; - import { InputVertical } from "@opal/layouts"; -@@ -11,10 +13,15 @@ import { SvgFolderPlus } from "@opal/icons"; - import Modal from "@/refresh-components/Modal"; - import InputTypeInField from "@/refresh-components/form/InputTypeInField"; - import { toast } from "@/hooks/useToast"; -+import i18n from "@/lib/i18n"; - --const validationSchema = Yup.object({ -- projectName: Yup.string().trim().required("Project name is required"), --}); -+function getValidationSchema() { -+ return Yup.object({ -+ projectName: Yup.string() -+ .trim() -+ .required(i18n.t("projects.project_name_required")), -+ }); -+} - - interface CreateProjectModalProps { - initialProjectName?: string; -@@ -23,17 +30,19 @@ interface CreateProjectModalProps { - export default function CreateProjectModal({ - initialProjectName, - }: CreateProjectModalProps) { -+ const { t } = useTranslation(); - const { createProject } = useProjectsContext(); - const modal = useModal(); - const route = useAppRouter(); -+ const validationSchema = useMemo(() => getValidationSchema(), []); - - return ( - - - modal.toggle(false)} - /> - ( -
- -- -+ - - -@@ -71,10 +83,10 @@ export default function CreateProjectModal({ - type="button" - onClick={() => modal.toggle(false)} - > -- Cancel -+ {t("general.cancel")} - - - - diff --git a/web/src/sections/modals/ShareChatSessionModal.tsx b/web/src/sections/modals/ShareChatSessionModal.tsx -index f6054936..a3ee58ca 100644 +index 66a7a6b1..bc7f79d6 100644 --- a/web/src/sections/modals/ShareChatSessionModal.tsx +++ b/web/src/sections/modals/ShareChatSessionModal.tsx @@ -1,6 +1,7 @@ @@ -13758,9 +12762,9 @@ index f6054936..a3ee58ca 100644 import { useState } from "react"; +import { useTranslation } from "react-i18next"; import { ChatSession, ChatSessionSharedStatus } from "@/app/app/interfaces"; - import { toast } from "@/hooks/useToast"; import { useChatSessionStore } from "@/app/app/stores/useChatSessionStore"; -@@ -97,6 +98,7 @@ export default function ShareChatSessionModal({ + import { copyAll } from "@/app/app/message/copyingUtils"; +@@ -96,6 +97,7 @@ export default function ShareChatSessionModal({ chatSession, onClose, }: ShareChatSessionModalProps) { @@ -13768,7 +12772,7 @@ index f6054936..a3ee58ca 100644 const isCurrentlyPublic = chatSession.shared_status === ChatSessionSharedStatus.Public; -@@ -118,11 +120,11 @@ export default function ShareChatSessionModal({ +@@ -117,11 +119,11 @@ export default function ShareChatSessionModal({ let submitButtonText: string; if (isShared) { @@ -13783,7 +12787,7 @@ index f6054936..a3ee58ca 100644 } const submitDisabled = isLoading || (!isCurrentlyPublic && !wantsPublic); -@@ -137,9 +139,9 @@ export default function ShareChatSessionModal({ +@@ -136,9 +138,9 @@ export default function ShareChatSessionModal({ updateCurrentChatSessionSharedStatus(ChatSessionSharedStatus.Public); await refreshChatSessions(); copyAll(link); @@ -13795,7 +12799,7 @@ index f6054936..a3ee58ca 100644 } } else if (!wantsPublic && isCurrentlyPublic) { const success = await deleteShareLink(chatSession.id); -@@ -147,20 +149,20 @@ export default function ShareChatSessionModal({ +@@ -146,20 +148,20 @@ export default function ShareChatSessionModal({ setShareLink(""); updateCurrentChatSessionSharedStatus(ChatSessionSharedStatus.Private); await refreshChatSessions(); @@ -13820,7 +12824,7 @@ index f6054936..a3ee58ca 100644 } finally { setIsLoading(false); } -@@ -171,8 +173,10 @@ export default function ShareChatSessionModal({ +@@ -170,8 +172,10 @@ export default function ShareChatSessionModal({ -@@ -184,16 +188,16 @@ export default function ShareChatSessionModal({ +@@ -183,16 +187,16 @@ export default function ShareChatSessionModal({ > setSelectedPrivacy("public")} ariaLabel="share-modal-option-public" -@@ -208,7 +212,7 @@ export default function ShareChatSessionModal({ +@@ -207,7 +211,7 @@ export default function ShareChatSessionModal({ rightChildren={ shareLink} @@ -13863,7 +12867,7 @@ index f6054936..a3ee58ca 100644 size="sm" aria-label="share-modal-copy-link" /> -@@ -223,7 +227,7 @@ export default function ShareChatSessionModal({ +@@ -222,7 +226,7 @@ export default function ShareChatSessionModal({ onClick={onClose} aria-label="share-modal-cancel" > @@ -13872,90 +12876,6 @@ index f6054936..a3ee58ca 100644 )} - - } -@@ -127,7 +140,7 @@ export default function NonAdminStep() { - -
{ -@@ -153,7 +166,11 @@ export default function NonAdminStep() { -
- {/* TODO(@raunakab): migrate to opal Button once className/iconClassName is resolved */} - -- -+ - - -
diff --git a/web/src/sections/onboarding/components/OnboardingHeader.tsx b/web/src/sections/onboarding/components/OnboardingHeader.tsx index 6bf2691e..7a01ea51 100644 --- a/web/src/sections/onboarding/components/OnboardingHeader.tsx @@ -14250,160 +13066,8 @@ index 139000c5..d4f82845 100644 } -diff --git a/web/src/sections/onboarding/steps/LLMStep.tsx b/web/src/sections/onboarding/steps/LLMStep.tsx -index 59e847a0..c23f5b04 100644 ---- a/web/src/sections/onboarding/steps/LLMStep.tsx -+++ b/web/src/sections/onboarding/steps/LLMStep.tsx -@@ -9,6 +9,7 @@ import { - OnboardingState, - OnboardingStep, - } from "@/interfaces/onboarding"; -+import { useTranslation } from "react-i18next"; - import { - LLMProviderFormProps, - WellKnownLLMProviderDescriptor, -@@ -92,6 +93,7 @@ const LLMStep = memo( - actions: onboardingActions, - disabled, - }: LLMStepProps) => { -+ const { t } = useTranslation(); - const { llmProviderOptions, isLoading } = useLLMProviderOptions(); - const llmDescriptors = llmProviderOptions ?? []; - -@@ -152,8 +154,14 @@ const LLMStep = memo( - > - -- View in Admin Panel -+ {t("onboarding.llm.btn_view_admin", "View in Admin Panel")} - - } - /> -@@ -215,8 +223,14 @@ const LLMStep = memo( - {/* Custom provider card */} -
- provider === "custom" -@@ -240,7 +254,7 @@ const LLMStep = memo( - onboardingActions.setButtonActive(true); - onboardingActions.goToStep(OnboardingStep.LlmSetup); - }} -- aria-label="Edit LLM providers" -+ aria-label={t("onboarding.llm.edit_providers", "Edit LLM providers")} - > -
- - {onboardingState.data.llmProviders?.length || 0}{" "} - {(onboardingState.data.llmProviders?.length || 0) === 1 -- ? "model" -- : "models"}{" "} -- connected -+ ? t("onboarding.llm.model", "model") -+ : t("onboarding.llm.models", "models")}{" "} -+ {t("onboarding.llm.connected", "connected")} - -
-
-diff --git a/web/src/sections/onboarding/steps/NameStep.tsx b/web/src/sections/onboarding/steps/NameStep.tsx -index f5ebfb10..5ab7bca2 100644 ---- a/web/src/sections/onboarding/steps/NameStep.tsx -+++ b/web/src/sections/onboarding/steps/NameStep.tsx -@@ -14,6 +14,7 @@ import IconButton from "@/refresh-components/buttons/IconButton"; - import { SvgCheckCircle, SvgEdit, SvgUser } from "@opal/icons"; - import { ContentAction } from "@opal/layouts"; - import { Hoverable } from "@opal/core"; -+import { useTranslation } from "react-i18next"; - - export interface NameStepProps { - state: OnboardingState; -@@ -22,6 +23,7 @@ export interface NameStepProps { - - const NameStep = React.memo( - ({ state: onboardingState, actions: onboardingActions }: NameStepProps) => { -+ const { t } = useTranslation(); - const { userName } = onboardingState.data; - const { updateName, goToStep, setButtonActive, nextStep } = - onboardingActions; -@@ -48,15 +50,21 @@ const NameStep = React.memo( - > - updateName(e.target.value)} - onKeyDown={handleKeyDown} -@@ -72,7 +80,7 @@ const NameStep = React.memo( - setButtonActive(true); - goToStep(OnboardingStep.Name); - }} -- aria-label="Edit display name" -+ aria-label={t("onboarding.edit_display_name", "Edit display name")} - role="button" - tabIndex={0} - > -@@ -96,7 +104,11 @@ const NameStep = React.memo( -
- {/* TODO(@raunakab): migrate to opal Button once className/iconClassName is resolved */} - -- -+ - - )} diff --git a/web/src/sections/settings/Memories.tsx b/web/src/sections/settings/Memories.tsx -index 3bbb5b71..3eb8745e 100644 +index b33fcf06..6ec891a0 100644 --- a/web/src/sections/settings/Memories.tsx +++ b/web/src/sections/settings/Memories.tsx @@ -9,6 +9,7 @@ import LineItem from "@/refresh-components/buttons/LineItem"; import { Button } from "@opal/components"; - import { useCreateModal } from "@/refresh-components/contexts/ModalContext"; + import { useCreateModal } from "@opal/components"; import { MemoryItem } from "@/lib/types"; +import { useTranslation } from "react-i18next"; @@ -14577,7 +13241,7 @@ index 3bbb5b71..3eb8745e 100644 onClick={() => { setTargetMemoryId(null); diff --git a/web/src/sections/sidebar/AccountPopover.tsx b/web/src/sections/sidebar/AccountPopover.tsx -index bcb876f9..d4fe3e54 100644 +index 317781d7..0c76859c 100644 --- a/web/src/sections/sidebar/AccountPopover.tsx +++ b/web/src/sections/sidebar/AccountPopover.tsx @@ -1,6 +1,7 @@ @@ -14588,7 +13252,7 @@ index bcb876f9..d4fe3e54 100644 import { LOGOUT_DISABLED } from "@/lib/constants"; import { preload } from "swr"; import { errorHandlingFetcher } from "@/lib/fetcher"; -@@ -45,6 +46,7 @@ function SettingsPopover({ +@@ -44,6 +45,7 @@ function SettingsPopover({ onOpenNotifications, undismissedCount, }: SettingsPopoverProps) { @@ -14596,7 +13260,7 @@ index bcb876f9..d4fe3e54 100644 const { user } = useUser(); const settings = useSettings(); const enterpriseSettings = settings.enterprise; -@@ -68,7 +70,7 @@ function SettingsPopover({ +@@ -67,7 +69,7 @@ function SettingsPopover({ logout() .then((response) => { if (!response?.ok) { @@ -14605,7 +13269,7 @@ index bcb876f9..d4fe3e54 100644 return; } -@@ -84,7 +86,7 @@ function SettingsPopover({ +@@ -81,7 +83,7 @@ function SettingsPopover({ }) .catch(() => { @@ -14614,7 +13278,7 @@ index bcb876f9..d4fe3e54 100644 }); }; -@@ -101,7 +103,7 @@ function SettingsPopover({ +@@ -98,7 +100,7 @@ function SettingsPopover({ variant="section" rounding="sm" icon={SvgSliders} @@ -14623,7 +13287,7 @@ index bcb876f9..d4fe3e54 100644 href="/app/settings" onClick={onUserSettingsClick} /> -@@ -112,7 +114,7 @@ function SettingsPopover({ +@@ -109,7 +111,7 @@ function SettingsPopover({ variant="section" rounding="sm" icon={SvgBell} @@ -14632,7 +13296,7 @@ index bcb876f9..d4fe3e54 100644 onClick={onOpenNotifications} rightChildren={ undismissedCount ? ( -@@ -126,7 +128,7 @@ function SettingsPopover({ +@@ -123,7 +125,7 @@ function SettingsPopover({ variant="section" rounding="sm" icon={SvgHelpCircle} @@ -14641,7 +13305,7 @@ index bcb876f9..d4fe3e54 100644 href="https://docs.onyx.app" target="_blank" />, -@@ -152,7 +154,7 @@ function SettingsPopover({ +@@ -149,7 +151,7 @@ function SettingsPopover({ variant="section" rounding="sm" icon={SvgUser} @@ -14650,7 +13314,7 @@ index bcb876f9..d4fe3e54 100644 onClick={handleLogin} /> ), -@@ -164,7 +166,7 @@ function SettingsPopover({ +@@ -161,7 +163,7 @@ function SettingsPopover({ color="danger" rounding="sm" icon={SvgLogOut} @@ -14659,143 +13323,8 @@ index bcb876f9..d4fe3e54 100644 onClick={handleLogout} /> ), -diff --git a/web/src/sections/sidebar/AppSidebar.tsx b/web/src/sections/sidebar/AppSidebar.tsx -index 8f91c70f..7014227d 100644 ---- a/web/src/sections/sidebar/AppSidebar.tsx -+++ b/web/src/sections/sidebar/AppSidebar.tsx -@@ -80,6 +80,7 @@ import { dismissNotification } from "@/lib/notifications/api"; - import AccountPopover from "@/sections/sidebar/AccountPopover"; - import ChatSearchCommandMenu from "@/sections/sidebar/ChatSearchCommandMenu"; - import { useQueryController } from "@/providers/QueryControllerProvider"; -+import { useTranslation } from "react-i18next"; - - // Visible-agents = pinned-agents + current-agent (if current-agent not in pinned-agents) - // OR Visible-agents = pinned-agents (if current-agent in pinned-agents) -@@ -120,6 +121,7 @@ function RecentsSection({ - isLoadingMore, - onLoadMore, - }: RecentsSectionProps) { -+ const { t } = useTranslation(); - const { setNodeRef, isOver } = useDroppable({ - id: DRAG_TYPES.RECENTS, - data: { -@@ -162,10 +164,10 @@ function RecentsSection({ - isOver && "bg-background-tint-03" - )} - > -- -+ - {chatSessions.length === 0 ? ( - -- Try sending a message! Your chat history will appear here. -+ {t("sidebar.recents_empty")} - - ) : ( - <> -@@ -197,6 +199,7 @@ function RecentsSection({ - } - - const AppSidebar = memo(function AppSidebarInner() { -+ const { t } = useTranslation(); - const { folded } = useSidebarState(); - const router = useRouter(); - const combinedSettingsData = useSettings(); -@@ -493,11 +496,12 @@ const AppSidebar = memo(function AppSidebarInner() { - reset(); - }} - > -- New Session -+ {t("sidebar.new_session")} - -
- ); - }, [ -+ t, - folded, - activeSidebarTab, - combinedSettingsData, -@@ -526,12 +530,12 @@ const AppSidebar = memo(function AppSidebarInner() { - -- Search Chats -+ {t("sidebar.search_chats")} - - } - /> - ), -- [folded] -+ [t, folded] - ); - const moreAgentsButton = useMemo( - () => ( -@@ -547,11 +551,13 @@ const AppSidebar = memo(function AppSidebarInner() { - selected={activeSidebarTab.isMoreAgents()} - variant={folded ? "sidebar-heavy" : "sidebar-light"} - > -- {visibleAgents.length === 0 ? "Explore Agents" : "More Agents"} -+ {visibleAgents.length === 0 -+ ? t("sidebar.explore_agents") -+ : t("sidebar.more_agents")} - -
- ), -- [folded, activeSidebarTab, visibleAgents] -+ [t, folded, activeSidebarTab, visibleAgents] - ); - const newProjectButton = useMemo( - () => ( -@@ -562,10 +568,10 @@ const AppSidebar = memo(function AppSidebarInner() { - folded={folded} - variant={folded ? "sidebar-heavy" : "sidebar-light"} - > -- New Project -+ {t("sidebar.new_project")} - - ), -- [folded, createProjectModal.toggle, createProjectModal.isOpen] -+ [t, folded, createProjectModal.toggle, createProjectModal.isOpen] - ); - const handleShowBuildIntro = useCallback(() => { - setShowIntroAnimation(true); -@@ -584,7 +590,7 @@ const AppSidebar = memo(function AppSidebarInner() { - icon={SvgSettings} - folded={folded} - > -- {isAdmin ? "Admin Panel" : "Curator Panel"} -+ {isAdmin ? t("sidebar.admin_panel") : t("sidebar.curator_panel")} - - )} - -
- ), -- [folded, isAdmin, isCurator, handleShowBuildIntro, isOnyxCraftEnabled] -+ [t, folded, isAdmin, isCurator, handleShowBuildIntro, isOnyxCraftEnabled] - ); - - return ( -@@ -683,7 +689,7 @@ const AppSidebar = memo(function AppSidebarInner() { - collisionDetection={closestCenter} - onDragEnd={handleAgentDragEnd} - > -- -+ - - {/* Projects */} - )} -diff --git a/web/src/sections/sidebar/NotificationsPopover.tsx b/web/src/sections/sidebar/NotificationsPopover.tsx -index 1137fe3f..39a169a4 100644 ---- a/web/src/sections/sidebar/NotificationsPopover.tsx -+++ b/web/src/sections/sidebar/NotificationsPopover.tsx -@@ -1,6 +1,7 @@ - "use client"; - - import { useCallback, useEffect, useMemo, useRef, useState } from "react"; -+import { useTranslation } from "react-i18next"; - import { useRouter } from "next/navigation"; - import { Route } from "next"; - import { track, AnalyticsEvent } from "@/lib/analytics/utils"; -@@ -108,6 +109,7 @@ export default function NotificationsPopover({ - onNavigate, - onShowBuildIntro, - }: NotificationsPopoverProps) { -+ const { t } = useTranslation(); - const router = useRouter(); - const { - notifications, -@@ -267,13 +269,13 @@ export default function NotificationsPopover({ - prominence="tertiary" - onClick={onClose} - /> -- Notifications -+ {t("account.notifications")} - - -
- {undismissedCount !== 0 && ( - -- {`${undismissedCount} unread`} -+ {t("account.unread", { count: undismissedCount })} - - )} -
-@@ -297,7 +299,7 @@ export default function NotificationsPopover({ -
-
- -
-@@ -309,7 +311,7 @@ export default function NotificationsPopover({ - > - {newNotifications.length > 0 && ( - <> -- -+ -
- {newNotifications.map((notification) => ( - 0 && ( - <> -- -+ -
- {olderNotifications.map((notification) => ( - fileInputRef.current?.click()} emphasized > @@ -15095,7 +13552,7 @@ index b9eeb842..468f15da 100644 , null,
-@@ -538,6 +540,7 @@ export default function AgentEditorPage({ +@@ -547,6 +549,7 @@ export default function AgentEditorPage({ agent: existingAgent, refreshAgent, }: AgentEditorPageProps) { @@ -15103,7 +13560,7 @@ index b9eeb842..468f15da 100644 const router = useRouter(); const appRouter = useAppRouter(); const { refresh: refreshAgents } = useAgents(); -@@ -1313,7 +1316,9 @@ export default function AgentEditorPage({ +@@ -1352,7 +1355,9 @@ export default function AgentEditorPage({ } type="submit" > @@ -15114,7 +13571,7 @@ index b9eeb842..468f15da 100644
-@@ -1338,21 +1343,28 @@ export default function AgentEditorPage({ +@@ -1377,21 +1382,28 @@ export default function AgentEditorPage({ alignItems="start" > @@ -15148,7 +13605,7 @@ index b9eeb842..468f15da 100644 /> -@@ -1376,7 +1388,7 @@ export default function AgentEditorPage({ +@@ -1415,7 +1427,7 @@ export default function AgentEditorPage({ -@@ -1545,8 +1557,8 @@ export default function AgentEditorPage({ +@@ -1587,8 +1599,8 @@ export default function AgentEditorPage({ )} -diff --git a/web/src/views/AppPage.tsx b/web/src/views/AppPage.tsx -index 37eb160d..f18a3e27 100644 ---- a/web/src/views/AppPage.tsx -+++ b/web/src/views/AppPage.tsx -@@ -4,6 +4,7 @@ import { redirect, useRouter, useSearchParams } from "next/navigation"; - import { personaIncludesRetrieval } from "@/app/app/services/lib"; - import { useCallback, useEffect, useMemo, useRef, useState } from "react"; - import { toast, useToastFromQuery } from "@/hooks/useToast"; -+import { useTranslation } from "react-i18next"; - import { SEARCH_PARAM_NAMES } from "@/app/app/services/searchParams"; - import { Section } from "@/layouts/general-layouts"; - import { useFederatedConnectors, useFilters, useLlmManager } from "@/lib/hooks"; -@@ -107,6 +108,7 @@ export interface ChatPageProps { - } - - export default function AppPage({ firstMessage }: ChatPageProps) { -+ const { t } = useTranslation(); - // Performance tracking - // Keeping this here in case we need to track down slow renders in the future - // const renderCount = useRef(0); -@@ -130,7 +132,7 @@ export default function AppPage({ firstMessage }: ChatPageProps) { - - useToastFromQuery({ - oauth_connected: { -- message: "Authentication successful", -+ message: t("chat.auth_successful"), - type: "success", - }, - }); -@@ -144,8 +146,27 @@ export default function AppPage({ firstMessage }: ChatPageProps) { - currentChatSessionId, - isLoading: isLoadingChatSessions, - } = useChatSessions(); -- const { vectorDbEnabled, disable_default_assistant } = useSettings(); -+ // handle redirect if chat page is disabled -+ // NOTE: this must be done here, in a client component since -+ // settings are passed in via Context and therefore aren't -+ // available in server-side components -+ const settings = useSettings(); -+ const { appName } = settings; -+ -+ const appNameRef = useRef("Onyx"); -+ useEffect(() => { -+ appNameRef.current = appName; -+ document.title = currentChatSession?.name -+ ? `${currentChatSession.name} — ${appName}` -+ : appName; -+ }, [currentChatSession?.name, appName]); -+ useEffect(() => { -+ return () => { -+ document.title = appNameRef.current; -+ }; -+ }, []); - -+ const { vectorDbEnabled } = settings; - const { ccPairs } = useCCPairs(vectorDbEnabled); - const { tags } = useTags(); - const { documentSets } = useDocumentSets(); -@@ -295,7 +316,7 @@ export default function AppPage({ firstMessage }: ChatPageProps) { - liveAgent, - currentChatSessionId, - currentChatSession ?? undefined, -- disable_default_assistant ?? false -+ settings.disable_default_assistant ?? false - ); - - const scrollContainerRef = useRef(null); -@@ -522,7 +543,7 @@ export default function AppPage({ firstMessage }: ChatPageProps) { - .reverse() - .find((m) => m.type === "user"); - if (!lastUserMsg) { -- toast.error("No previously-submitted user message found."); -+ toast.error(t("chat.no_previous_message")); - return; - } - -@@ -542,6 +563,10 @@ export default function AppPage({ firstMessage }: ChatPageProps) { - multiModel.isMultiModelActive, - ]); - -+ const toggleDocumentSidebar = useCallback(() => { -+ updateCurrentDocumentSidebarVisible(!documentSidebarVisible); -+ }, [documentSidebarVisible, updateCurrentDocumentSidebarVisible]); -+ - if (resolvedUser === null) { - redirect("/auth/login"); - } -@@ -845,21 +870,21 @@ export default function AppPage({ firstMessage }: ChatPageProps) { - } - title={ - sessionFetchError.type === "not_found" -- ? "Chat not found" -+ ? t("chat.chat_not_found") - : sessionFetchError.type === "access_denied" -- ? "Access denied" -- : "Something went wrong" -+ ? t("chat.access_denied") -+ : t("chat.something_went_wrong") - } - description={ - sessionFetchError.type === "not_found" -- ? "This chat session doesn't exist or has been deleted." -+ ? t("chat.chat_not_found_desc") - : sessionFetchError.type === "access_denied" -- ? "You don't have permission to view this chat session." -+ ? t("chat.access_denied_desc") - : sessionFetchError.detail - } - /> - - - )} -@@ -955,7 +980,7 @@ export default function AppPage({ firstMessage }: ChatPageProps) { - {/* - # Note (@raunakab) - -- `shadow-box-01` on AppInputBar extends ~14px below the element -+ `shadow-01` on AppInputBar extends ~14px below the element - (2px offset + 12px blur). Because the content area in `Root` - (app-layouts.tsx) uses `overflow-auto`, shadows that exceed - the container bounds are clipped. diff --git a/web/src/views/SettingsPage.tsx b/web/src/views/SettingsPage.tsx -index 32c69cef..bcbf4bbd 100644 +index f1638662..de08d7ca 100644 --- a/web/src/views/SettingsPage.tsx +++ b/web/src/views/SettingsPage.tsx -@@ -30,6 +30,7 @@ import InputTextArea from "@/refresh-components/inputs/InputTextArea"; +@@ -33,6 +33,7 @@ import InputSelect from "@/refresh-components/inputs/InputSelect"; import { Switch } from "@opal/components"; import { useUser } from "@/providers/UserProvider"; import { useTheme } from "next-themes"; +import { useTranslation } from "react-i18next"; import { MemoryItem, ThemePreference } from "@/lib/types"; import useUserPersonalization from "@/hooks/useUserPersonalization"; - import { toast } from "@/hooks/useToast"; -@@ -119,6 +120,7 @@ function ScopeSelector({ + import ModelSelector from "@/sections/model-selector/ModelSelector"; +@@ -122,6 +123,7 @@ function ScopeSelector({ scopesError, disabled, }: ScopeSelectorProps) { @@ -15514,7 +13847,7 @@ index 32c69cef..bcbf4bbd 100644 const groups = useMemo(() => { const byLabel = new Map(); for (const option of scopeOptions) { -@@ -138,14 +140,17 @@ function ScopeSelector({ +@@ -141,14 +143,17 @@ function ScopeSelector({ if (scopesError) { return ( @@ -15534,7 +13867,7 @@ index 32c69cef..bcbf4bbd 100644 ); } -@@ -178,7 +183,11 @@ function ScopeSelector({ +@@ -181,7 +186,11 @@ function ScopeSelector({
{locked @@ -15547,7 +13880,7 @@ index 32c69cef..bcbf4bbd 100644 : option.label} {/* Fixed 2-line slot so every row is the same height. */} -@@ -230,15 +239,19 @@ function PATModal({ +@@ -233,15 +242,19 @@ function PATModal({ onCreate, createdToken, }: PATModalProps) { @@ -15569,7 +13902,7 @@ index 32c69cef..bcbf4bbd 100644 /> {createdToken.token} -@@ -250,7 +263,7 @@ function PATModal({ +@@ -253,7 +266,7 @@ function PATModal({ getCopyText={() => createdToken.token} prominence="primary" > @@ -15578,7 +13911,7 @@ index 32c69cef..bcbf4bbd 100644 } /> -@@ -263,8 +276,11 @@ function PATModal({ +@@ -266,8 +279,11 @@ function PATModal({ return ( @@ -15618,7 +13951,7 @@ index 32c69cef..bcbf4bbd 100644 value={newTokenName} onChange={(e) => setNewTokenName(e.target.value)} variant={isCreating ? "disabled" : undefined} -@@ -290,7 +314,7 @@ function PATModal({ +@@ -293,7 +317,7 @@ function PATModal({ /> @@ -15694,7 +14027,7 @@ index 32c69cef..bcbf4bbd 100644 } withLabel > -@@ -336,11 +384,18 @@ function PATModal({ +@@ -339,11 +387,18 @@ function PATModal({ onValueChange={(value) => setAccessMode(value as AccessMode)} disabled={isCreating} > @@ -15716,7 +14049,7 @@ index 32c69cef..bcbf4bbd 100644 -@@ -364,9 +419,11 @@ function GeneralSettings() { +@@ -367,9 +422,11 @@ function GeneralSettings() { user, updateUserPersonalization, updateUserThemePreference, @@ -15728,7 +14061,7 @@ index 32c69cef..bcbf4bbd 100644 const applyBackground = useCallback( async (bg: (typeof CHAT_BACKGROUND_OPTIONS)[number]) => { -@@ -396,8 +453,20 @@ function GeneralSettings() { +@@ -399,8 +456,20 @@ function GeneralSettings() { updatePersonalizationField, handleSavePersonalization, } = useUserPersonalization(user, updateUserPersonalization, { @@ -15751,7 +14084,7 @@ index 32c69cef..bcbf4bbd 100644 }); // Track initial values to detect changes -@@ -415,25 +484,35 @@ function GeneralSettings() { +@@ -418,25 +487,35 @@ function GeneralSettings() { try { const response = await deleteAllChatSessions(); if (response.ok) { @@ -15791,7 +14124,7 @@ index 32c69cef..bcbf4bbd 100644 onClose={() => setShowDeleteConfirmation(false)} submit={ -@@ -668,6 +804,7 @@ function PromptShortcuts() { +@@ -673,6 +809,7 @@ function PromptShortcuts() { const { promptShortcuts, isLoading, error, refresh } = usePromptShortcuts(); const [shortcuts, setShortcuts] = useState([]); const [isInitialLoad, setIsInitialLoad] = useState(true); @@ -16006,7 +14341,7 @@ index 32c69cef..bcbf4bbd 100644 // Initialize shortcuts when input prompts are loaded useEffect(() => { -@@ -700,8 +837,10 @@ function PromptShortcuts() { +@@ -705,8 +842,10 @@ function PromptShortcuts() { // Show error popup if fetch fails useEffect(() => { if (!error) return; @@ -16019,7 +14354,7 @@ index 32c69cef..bcbf4bbd 100644 const handleUpdateShortcut = useCallback( (index: number, field: "prompt" | "content", value: string) => { -@@ -773,22 +912,34 @@ function PromptShortcuts() { +@@ -778,22 +917,34 @@ function PromptShortcuts() { if (response.ok) { setShortcuts((prev) => prev.filter((_, i) => i !== index)); await refresh(); @@ -16058,7 +14393,7 @@ index 32c69cef..bcbf4bbd 100644 return; } -@@ -808,7 +959,9 @@ function PromptShortcuts() { +@@ -813,7 +964,9 @@ function PromptShortcuts() { if (response.ok) { await refresh(); @@ -16069,7 +14404,7 @@ index 32c69cef..bcbf4bbd 100644 } else { throw new Error("Failed to create shortcut"); } -@@ -827,16 +980,20 @@ function PromptShortcuts() { +@@ -832,16 +985,20 @@ function PromptShortcuts() { if (response.ok) { await refresh(); @@ -16093,7 +14428,7 @@ index 32c69cef..bcbf4bbd 100644 ); const handleBlurShortcut = useCallback( -@@ -879,7 +1036,10 @@ function PromptShortcuts() { +@@ -884,7 +1041,10 @@ function PromptShortcuts() { > handleUpdateShortcut(index, "prompt", e.target.value) -@@ -903,16 +1063,25 @@ function PromptShortcuts() { +@@ -908,16 +1068,25 @@ function PromptShortcuts() { icon={SvgMinusCircle} onClick={() => void handleRemoveShortcut(index)} prominence="tertiary" @@ -16134,7 +14469,7 @@ index 32c69cef..bcbf4bbd 100644 value={shortcut.content} onChange={(e) => handleUpdateShortcut(index, "content", e.target.value) -@@ -959,6 +1128,7 @@ function ChatPreferencesSettings() { +@@ -964,6 +1133,7 @@ function ChatPreferencesSettings() { enabled: smoothStreamingEnabled, setEnabled: setSmoothStreamingEnabled, } = useSmoothStreaming(); @@ -16142,7 +14477,7 @@ index 32c69cef..bcbf4bbd 100644 const { personalizationValues, -@@ -967,8 +1137,12 @@ function ChatPreferencesSettings() { +@@ -972,8 +1142,12 @@ function ChatPreferencesSettings() { updateUserPreferences, handleSavePersonalization, } = useUserPersonalization(user, updateUserPersonalization, { @@ -16157,7 +14492,7 @@ index 32c69cef..bcbf4bbd 100644 }); const [draftVoicePlaybackSpeed, setDraftVoicePlaybackSpeed] = useState( user?.preferences.voice_playback_speed ?? 1 -@@ -986,12 +1160,16 @@ function ChatPreferencesSettings() { +@@ -991,12 +1165,16 @@ function ChatPreferencesSettings() { }) => { try { await updateUserVoiceSettings(settings); @@ -16177,7 +14512,7 @@ index 32c69cef..bcbf4bbd 100644 ); const commitVoicePlaybackSpeed = useCallback(() => { -@@ -1024,15 +1202,18 @@ function ChatPreferencesSettings() { +@@ -1029,15 +1207,18 @@ function ChatPreferencesSettings() {
@@ -16279,7 +14614,7 @@ index 32c69cef..bcbf4bbd 100644 -@@ -1139,12 +1339,21 @@ function ChatPreferencesSettings() { +@@ -1150,12 +1350,21 @@ function ChatPreferencesSettings() {
updateUserPreferences(e.target.value)} onBlur={() => void handleSavePersonalization()} -@@ -1159,15 +1368,21 @@ function ChatPreferencesSettings() { +@@ -1170,15 +1379,21 @@ function ChatPreferencesSettings() { />
-@@ -1303,18 +1536,37 @@ function AccountsAccessSettings() { +@@ -1314,21 +1547,42 @@ function AccountsAccessSettings() { const { user, authTypeMetadata } = useUser(); - const authType = useAuthType(); + const isMultiTenant = useIsMultiTenant(); const [showPasswordModal, setShowPasswordModal] = useState(false); + const { t } = useTranslation(); + // TODO(auth-refresh): only passwordMinLength is enforced here; the remaining + // constraints (max length, uppercase, lowercase, digit, special char) will be + // wired up when this form is refreshed as part of auth-refresh. const passwordValidationSchema = Yup.object().shape({ - currentPassword: Yup.string().required("Current password is required"), + currentPassword: Yup.string().required( @@ -16434,11 +14772,13 @@ index 32c69cef..bcbf4bbd 100644 + ), newPassword: Yup.string() .min( - authTypeMetadata.passwordMinLength, -- `Password must be at least ${authTypeMetadata.passwordMinLength} characters` + authTypeMetadata?.passwordMinLength ?? 0, +- `Password must be at least ${authTypeMetadata?.passwordMinLength ?? 0} characters` + t("settings.accounts.new_password_min_length", { -+ defaultValue: `Password must be at least ${authTypeMetadata.passwordMinLength} characters`, -+ count: authTypeMetadata.passwordMinLength, ++ defaultValue: `Password must be at least ${ ++ authTypeMetadata?.passwordMinLength ?? 0 ++ } characters`, ++ count: authTypeMetadata?.passwordMinLength ?? 0, + }) ) - .required("New password is required"), @@ -16461,7 +14801,7 @@ index 32c69cef..bcbf4bbd 100644 }); // PAT state -@@ -1384,19 +1636,28 @@ function AccountsAccessSettings() { +@@ -1398,19 +1652,28 @@ function AccountsAccessSettings() { // Show error popup if SWR fetch fails useEffect(() => { if (error) { @@ -16495,7 +14835,7 @@ index 32c69cef..bcbf4bbd 100644 return; } -@@ -1421,19 +1682,32 @@ function AccountsAccessSettings() { +@@ -1435,19 +1698,32 @@ function AccountsAccessSettings() { token: data.token, name: newTokenName, }); @@ -16532,7 +14872,7 @@ index 32c69cef..bcbf4bbd 100644 const deletePAT = useCallback( async (patId: number) => { -@@ -1448,16 +1722,28 @@ function AccountsAccessSettings() { +@@ -1462,16 +1738,28 @@ function AccountsAccessSettings() { setNewlyCreatedToken(null); } await mutate(); @@ -16565,7 +14905,7 @@ index 32c69cef..bcbf4bbd 100644 ); const handleChangePassword = useCallback( -@@ -1479,17 +1765,30 @@ function AccountsAccessSettings() { +@@ -1493,17 +1781,30 @@ function AccountsAccessSettings() { }); if (response.ok) { @@ -16600,7 +14940,7 @@ index 32c69cef..bcbf4bbd 100644 ); return ( -@@ -1523,23 +1822,33 @@ function AccountsAccessSettings() { +@@ -1537,23 +1838,33 @@ function AccountsAccessSettings() { {tokenToDelete && (
-@@ -1571,7 +1880,10 @@ function AccountsAccessSettings() { +@@ -1585,7 +1896,10 @@ function AccountsAccessSettings() {
@@ -16661,7 +15001,7 @@ index 32c69cef..bcbf4bbd 100644 } onClose={() => { -@@ -1595,7 +1909,10 @@ function AccountsAccessSettings() { +@@ -1609,7 +1925,10 @@ function AccountsAccessSettings() {
@@ -16688,7 +15028,7 @@ index 32c69cef..bcbf4bbd 100644
{user?.email ?? "anonymous"} -@@ -1661,8 +1990,11 @@ function AccountsAccessSettings() { +@@ -1675,8 +2006,11 @@ function AccountsAccessSettings() { {showPasswordSection && ( )} -@@ -1681,7 +2013,7 @@ function AccountsAccessSettings() { +@@ -1695,7 +2029,7 @@ function AccountsAccessSettings() { {showTokensSection && (
+@@ -1712,13 +2046,22 @@ function AccountsAccessSettings() { + > {isLoading - ? "Loading tokens..." @@ -16780,7 +15120,7 @@ index 32c69cef..bcbf4bbd 100644 value={query} onChange={(e) => setQuery(e.target.value)} searchIcon -@@ -1714,7 +2055,10 @@ function AccountsAccessSettings() { +@@ -1732,7 +2075,10 @@ function AccountsAccessSettings() { interaction={showCreateModal ? "active" : "rest"} onClick={() => setShowCreateModal(true)} > @@ -16792,7 +15132,7 @@ index 32c69cef..bcbf4bbd 100644
-@@ -1728,31 +2072,50 @@ function AccountsAccessSettings() { +@@ -1746,31 +2092,50 @@ function AccountsAccessSettings() { (1000 * 60 * 60 * 24) ); @@ -16852,7 +15192,7 @@ index 32c69cef..bcbf4bbd 100644 const middleText = `${createdText} - ${expiryText} - ${scopeText}`; -@@ -1774,7 +2137,14 @@ function AccountsAccessSettings() { +@@ -1792,7 +2157,14 @@ function AccountsAccessSettings() { onClick={() => setTokenToDelete(pat)} prominence="tertiary" size="sm" @@ -16868,7 +15208,7 @@ index 32c69cef..bcbf4bbd 100644 /> } /> -@@ -1789,10 +2159,13 @@ function AccountsAccessSettings() { +@@ -1807,10 +2179,13 @@ function AccountsAccessSettings() {
@@ -16884,7 +15224,7 @@ index 32c69cef..bcbf4bbd 100644
-@@ -1811,13 +2184,18 @@ interface IndexedConnectorCardProps { +@@ -1829,13 +2204,18 @@ interface IndexedConnectorCardProps { function IndexedConnectorCard({ source, isActive }: IndexedConnectorCardProps) { const sourceMetadata = getSourceMetadata(source); @@ -16904,7 +15244,7 @@ index 32c69cef..bcbf4bbd 100644 sizePreset="main-content" variant="section" /> -@@ -1838,6 +2216,7 @@ function FederatedConnectorCard({ +@@ -1856,6 +2236,7 @@ function FederatedConnectorCard({ const [showDisconnectConfirmation, setShowDisconnectConfirmation] = useState(false); const sourceMetadata = getSourceMetadata(connector.source as ValidSources); @@ -16912,7 +15252,7 @@ index 32c69cef..bcbf4bbd 100644 const handleDisconnect = useCallback(async () => { setIsDisconnecting(true); -@@ -1848,25 +2227,37 @@ function FederatedConnectorCard({ +@@ -1866,25 +2247,37 @@ function FederatedConnectorCard({ ); if (response.ok) { @@ -16954,7 +15294,7 @@ index 32c69cef..bcbf4bbd 100644 onClose={() => setShowDisconnectConfirmation(false)} submit={ ) : undefined } -@@ -1931,6 +2332,7 @@ function ConnectorsSettings() { +@@ -1949,6 +2352,7 @@ function ConnectorsSettings() { refetch: refetchFederatedConnectors, } = useFederatedOAuthStatus(); const { ccPairs } = useCCPairs(); @@ -17010,7 +15350,7 @@ index 32c69cef..bcbf4bbd 100644 const ACTIVE_STATUSES: ConnectorCredentialPairStatus[] = [ ConnectorCredentialPairStatus.ACTIVE, -@@ -1968,7 +2370,7 @@ function ConnectorsSettings() { +@@ -1986,7 +2390,7 @@ function ConnectorsSettings() {