Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(society): make browser profiles understandable at a glance
rubenluetke10-beepf9dd217788ef
diff --git a/jarvis/society/browser/profiles.py b/jarvis/society/browser/profiles.pyindex 4db7d1ae71..ece300398b 100644--- a/jarvis/society/browser/profiles.py+++ b/jarvis/society/browser/profiles.py@@ -17,6 +17,10 @@ from typing import Anyfrom uuid import uuid4_ID = re.compile(r"^[a-zA-Z0-9_-]{1,80}$")+SHARED_PROFILE_NAME = "Shared browser"+# The first release named the shared profile "Shared Chrome", which read as the+# user's own Chrome; it is a Jarvis-managed profile.+_LEGACY_SHARED_NAME = "Shared Chrome"_SCHEMA = """CREATE TABLE IF NOT EXISTS profiles (id TEXT PRIMARY KEY, name TEXT NOT NULL, kind TEXT NOT NULL,@@ -103,6 +107,7 @@ class BrowserProfiles:try:conn.executescript(_SCHEMA)conn.execute("BEGIN IMMEDIATE")+ self._rename_legacy_shared(conn)yield connconn.commit()except BaseException:@@ -111,6 +116,18 @@ class BrowserProfiles:finally:conn.close()+ @staticmethod+ def _rename_legacy_shared(db: sqlite3.Connection) -> None:+ """Rename the auto-created shared profile once; a user-chosen name stays."""+ if db.execute("SELECT 1 FROM settings WHERE key='shared_name_v2'").fetchone():+ return+ db.execute(+ "UPDATE profiles SET name=? WHERE name=? AND kind='managed' AND id="+ "(SELECT value FROM settings WHERE key='default_profile')",+ (SHARED_PROFILE_NAME, _LEGACY_SHARED_NAME),+ )+ db.execute("INSERT OR REPLACE INTO settings VALUES('shared_name_v2','1')")+@staticmethoddef _public(row: sqlite3.Row) -> dict[str, Any]:return {@@ -242,7 +259,7 @@ class BrowserProfiles:pid = uuid4().hexdb.execute("INSERT INTO profiles(id,name,kind,domains,created_at) VALUES(?,?,?,?,?)",- (pid, "Shared Chrome", "managed", "[]", time.time()),+ (pid, SHARED_PROFILE_NAME, "managed", "[]", time.time()),)if source:db.execute("INSERT INTO profile_sources VALUES(?,?)", (pid, source))diff --git a/jarvis/ui/web/frontend/src/components/society/browser/BrowserProfilesDialog.test.tsx b/jarvis/ui/web/frontend/src/components/society/browser/BrowserProfilesDialog.test.tsxindex 1030f02946..510c1283c2 100644--- a/jarvis/ui/web/frontend/src/components/society/browser/BrowserProfilesDialog.test.tsx+++ b/jarvis/ui/web/frontend/src/components/society/browser/BrowserProfilesDialog.test.tsx@@ -75,12 +75,24 @@ function mount(agentId?: string, connectChrome = false) {async function ready(agentId?: string) {const client = mount(agentId);- await screen.findByLabelText("Profile name");+ await screen.findByRole("heading", { name: "Profiles" });return client;}+async function openCard(name: RegExp) {+ fireEvent.click(await screen.findByRole("button", { name }));+ return screen.getByLabelText("Profile name");+}+function mutations() { return calls.filter((call) => call.method !== "GET"); }+function sharedDefault() {+ snapshot.profiles.unshift({ id: "shared", name: "Shared browser", kind: "managed", connected: false,+ allowed_domains: [], agent_ids: ["writer"], is_default: true });+ snapshot.default_profile_id = "shared";+ snapshot.bindings.writer = { mode: "inherit", profile_id: null, effective_profile_id: "shared" };+}+describe("browser profile sharing", () => {test("Google recovery offers Chrome setup when none exists without creating or assigning anything", async () => {snapshot.profiles = [];@@ -88,59 +100,80 @@ describe("browser profile sharing", () => {mount("scout", true);const create = await screen.findByRole("button", { name: "Create profile" });expect(screen.getByRole("note").textContent).toContain("Sign in yourself in regular Chrome");- expect(screen.getByRole("combobox", { name: "Profile type" }).textContent).toContain("My existing Chrome profile");+ expect((screen.getByRole("radio", { name: /Your regular Chrome/ }) as HTMLInputElement).checked).toBe(true);expect(mutations()).toEqual([]);fireEvent.click(within(create.closest("form")!).getByRole("button", { name: "Cancel" }));expect(screen.queryByRole("button", { name: "Create profile" })).toBeNull();expect(mutations()).toEqual([]);});- test("Google recovery selects an existing Chrome profile instead of another managed profile", async () => {+ test("Google recovery opens an existing Chrome profile instead of another managed profile", async () => {snapshot.profiles.unshift({ id: "isolated", name: "Managed browser", kind: "managed", connected: false,allowed_domains: [], agent_ids: [], is_default: false });mount("scout", true);expect(await screen.findByDisplayValue("Personal Chrome")).toBeTruthy();+ expect(screen.queryByDisplayValue("Managed browser")).toBeNull();expect(screen.queryByRole("button", { name: "Create profile" })).toBeNull();expect(mutations()).toEqual([]);});- test("a removed assigned profile remains visibly disconnected until an explicit replacement is saved", async () => {++ test("a removed assigned profile asks for a choice until the user picks a replacement", async () => {snapshot.profiles = [];mount("scout");- expect(await screen.findByText("Currently uses: Profile disconnected — choose a profile")).toBeTruthy();- expect(screen.getByRole("combobox", { name: "Agent browser profile" }).textContent).toContain("Profile disconnected");- expect(screen.queryByText("Currently uses: Own separate profile")).toBeNull();- expect(mutations()).toEqual([]);- fireEvent.click(screen.getByRole("combobox", { name: "Agent browser profile" }));- fireEvent.click(await screen.findByRole("option", { name: "Own separate profile" }));+ expect(await screen.findByText(/profile this agent used was removed/)).toBeTruthy();+ const group = screen.getByRole("radiogroup", { name: "Which browser does Scout use?" });+ expect(within(group).getAllByRole("radio").some((radio) => (radio as HTMLInputElement).checked)).toBe(false);expect(mutations()).toEqual([]);- fireEvent.click(screen.getByRole("button", { name: "Save agent choice" }));+ fireEvent.click(within(group).getByRole("radio", { name: /Own private profile/ }));await waitFor(() => expect(mutations()[0]?.body).toEqual({ mode: "own", profile_id: null }));});- test("a missing default is not presented as an agent's own profile", async () => {+ test("a missing default is not offered as the shared browser", async () => {snapshot.profiles = [];snapshot.default_profile_id = "revoked";snapshot.bindings.scout = { mode: "inherit", profile_id: null, effective_profile_id: "revoked" };mount("scout");- expect(await screen.findByText("Currently uses: Profile disconnected — choose a profile")).toBeTruthy();- expect(screen.getByRole("combobox", { name: "Agent browser profile" }).textContent).toContain("Shared profile (default) · Profile disconnected");+ expect(await screen.findByText(/profile this agent used was removed/)).toBeTruthy();+ const shared = screen.getByRole("radio", { name: /Shared browser/ }) as HTMLInputElement;+ expect(shared.checked).toBe(false);+ expect(shared.disabled).toBe(true);expect(mutations()).toEqual([]);});- test("opening the manager preserves existing assignments and reports disconnected Chrome", async () => {+ test("opening the manager preserves assignments and reports a disconnected Chrome", async () => {await ready("scout");expect(mutations()).toEqual([]);- expect(screen.getByText(/Chrome disconnected/)).toBeTruthy();- expect(screen.getByText(/Website.*expire a login/)).toBeTruthy();- expect(screen.getByText("Currently uses: Personal Chrome")).toBeTruthy();+ expect((screen.getByRole("radio", { name: /Personal Chrome/ }) as HTMLInputElement).checked).toBe(true);+ expect(screen.getByText("Not connected")).toBeTruthy();+ expect(screen.getByText("Used by Scout")).toBeTruthy();+ expect(screen.getByText(/A website can still log you out/)).toBeTruthy();});- test("all agents explicitly includes future agents and updates current assignments", async () => {+ test("the shared browser is offered once and its card cannot reset other choices", async () => {+ sharedDefault();+ await ready("writer");+ const group = screen.getByRole("radiogroup", { name: "Which browser does Writer use?" });+ expect(within(group).getAllByRole("radio").map((radio) => radio.closest("label")!.textContent)).toEqual([+ expect.stringContaining("Shared browser — the same logins"),+ expect.stringContaining("Own private profile"),+ expect.stringContaining("Personal Chrome"),+ ]);+ await openCard(/Shared browser.*Default/);+ expect(screen.getByText(/New agents get it automatically/)).toBeTruthy();+ expect(screen.queryByRole("button", { name: "Use for all agents" })).toBeNull();+ expect(screen.queryByRole("checkbox")).toBeNull();+ expect(mutations()).toEqual([]);+ });++ test("using a profile for all agents asks first, then includes future agents", async () => {const listener = vi.fn();window.addEventListener(BROWSER_PROFILE_CHANGED_EVENT, listener);const client = await ready();- fireEvent.click(screen.getByRole("radio", { name: "All agents (including future agents)" }));- fireEvent.click(screen.getByRole("button", { name: "Save sharing" }));+ await openCard(/Personal Chrome/);+ fireEvent.click(screen.getByRole("button", { name: "Use for all agents" }));+ expect(mutations()).toEqual([]);+ expect(screen.getByText(/Every agent switches to Personal Chrome/)).toBeTruthy();+ fireEvent.click(screen.getByRole("button", { name: "Switch all agents" }));await waitFor(() => expect(mutations()).toEqual([{ path: "/api/society/browser/profiles/personal/sharing", method: "PUT", body: { scope: "all", agent_ids: [] } }]));await waitFor(() => expect(client.getQueryData<BrowserProfilesSnapshot>(BROWSER_PROFILES_QUERY)?.default_profile_id).toBe("personal"));expect(listener).toHaveBeenCalledOnce();@@ -148,28 +181,31 @@ describe("browser profile sharing", () => {window.removeEventListener(BROWSER_PROFILE_CHANGED_EVENT, listener);});- test("selected agents saves exactly the checked agents", async () => {+ test("choosing agents saves exactly the checked agents and only after a change", async () => {await ready();+ await openCard(/Personal Chrome/);+ const save = screen.getByRole("button", { name: "Save agents" }) as HTMLButtonElement;+ expect(save.disabled).toBe(true);fireEvent.click(screen.getByRole("checkbox", { name: "Scout" }));fireEvent.click(screen.getByRole("checkbox", { name: "Writer" }));- fireEvent.click(screen.getByRole("button", { name: "Save sharing" }));+ expect(screen.getByText(/Agents you untick stop browsing/)).toBeTruthy();+ fireEvent.click(save);await waitFor(() => expect(mutations()[0]?.body).toEqual({ scope: "selected", agent_ids: ["writer"] }));});- test("an individual can opt out of the default with its own profile", async () => {+ test("an agent switches to its own profile with one click", async () => {await ready("scout");- fireEvent.click(screen.getByRole("combobox", { name: "Agent browser profile" }));- fireEvent.click(await screen.findByRole("option", { name: "Own separate profile" }));- expect(mutations()).toEqual([]);- fireEvent.click(screen.getByRole("button", { name: "Save agent choice" }));+ fireEvent.click(screen.getByRole("radio", { name: /Own private profile/ }));await waitFor(() => expect(mutations()[0]).toEqual({ path: "/api/society/agents/scout/browser/profile", method: "PUT", body: { mode: "own", profile_id: null } }));- expect(await screen.findByText("Currently uses: Own separate profile")).toBeTruthy();+ await waitFor(() => expect((screen.getByRole("radio", { name: /Own private profile/ }) as HTMLInputElement).checked).toBe(true));});test("Chrome profile creation requires explicit domains and never assigns agents automatically", async () => {await ready();fireEvent.click(screen.getByRole("button", { name: "Add profile" }));const form = screen.getByRole("button", { name: "Create profile" }).closest("form")!;+ expect((within(form).getByRole("radio", { name: /Extra Jarvis browser/ }) as HTMLInputElement).checked).toBe(true);+ fireEvent.click(within(form).getByRole("radio", { name: /Your regular Chrome/ }));fireEvent.change(within(form).getByLabelText("Profile name"), { target: { value: "Work Chrome" } });expect((within(form).getByRole("button", { name: "Create profile" }) as HTMLButtonElement).disabled).toBe(true);fireEvent.change(within(form).getByLabelText("Allowed websites"), { target: { value: "x.com, example.com" } });@@ -178,15 +214,19 @@ describe("browser profile sharing", () => {expect(await screen.findByDisplayValue("Work Chrome")).toBeTruthy();});- test("domain edits are saved explicitly and notify the affected live browser", async () => {+ test("domain edits are saved explicitly and only after a change", async () => {await ready();+ await openCard(/Personal Chrome/);+ const save = screen.getByRole("button", { name: "Save changes" }) as HTMLButtonElement;+ expect(save.disabled).toBe(true);fireEvent.change(screen.getByLabelText("Allowed websites"), { target: { value: "x.com, EXAMPLE.COM, x.com" } });- fireEvent.click(screen.getByRole("button", { name: "Save profile details" }));+ fireEvent.click(save);await waitFor(() => expect(mutations()[0]?.body).toEqual({ name: "Personal Chrome", allowed_domains: ["x.com", "example.com"] }));});test("pairing is explicit and does not claim a Chrome Web Store installation", async () => {await ready();+ await openCard(/Personal Chrome/);expect(screen.getByText(/installed manually until Chrome Web Store/)).toBeTruthy();expect(screen.getByRole("link", { name: "Download extension" }).getAttribute("href")).toBe("/api/society/browser/extension.zip");expect(screen.queryByText("private-code")).toBeNull();@@ -194,25 +234,35 @@ describe("browser profile sharing", () => {expect(await screen.findByText("private-code")).toBeTruthy();expect(screen.getByText("http://127.0.0.1:8765")).toBeTruthy();expect(screen.getByText(/Valid for 2 minutes/)).toBeTruthy();- expect(screen.getByText(/Chrome disconnected/)).toBeTruthy();});test("busy assignment preserves the old profile and gives a recoverable error", async () => {failingStatus = 409;await ready();- fireEvent.click(screen.getByRole("radio", { name: "All agents (including future agents)" }));- fireEvent.click(screen.getByRole("button", { name: "Save sharing" }));+ await openCard(/Personal Chrome/);+ fireEvent.click(screen.getByRole("button", { name: "Use for all agents" }));+ fireEvent.click(screen.getByRole("button", { name: "Switch all agents" }));expect(await screen.findByRole("alert")).toHaveProperty("textContent", expect.stringContaining("browser is in use"));expect(snapshot.default_profile_id).toBeNull();expect(screen.queryByText("private provider error")).toBeNull();});- test("removal states that website sessions are retained before disconnecting", async () => {+ test("removal states that saved logins are retained before disconnecting", async () => {await ready();- fireEvent.click(screen.getByRole("button", { name: "Remove profile from Jarvis" }));+ await openCard(/Personal Chrome/);+ fireEvent.click(screen.getByRole("button", { name: "Remove profile" }));expect(mutations()).toEqual([]);- expect(screen.getByText(/website sessions are not deleted/)).toBeTruthy();- fireEvent.click(screen.getByRole("button", { name: "Remove from Jarvis" }));+ expect(screen.getByText(/Saved logins on this computer are not deleted/)).toBeTruthy();+ fireEvent.click(screen.getByRole("button", { name: "Remove" }));await waitFor(() => expect(mutations()[0]?.method).toBe("DELETE"));});++ test("removing the shared profile warns that agents stop browsing", async () => {+ sharedDefault();+ await ready();+ await openCard(/Shared browser.*Default/);+ fireEvent.click(screen.getByRole("button", { name: "Remove profile" }));+ expect(screen.getByText(/This is the shared profile/)).toBeTruthy();+ expect(mutations()).toEqual([]);+ });});diff --git a/jarvis/ui/web/frontend/src/components/society/browser/BrowserProfilesDialog.tsx b/jarvis/ui/web/frontend/src/components/society/browser/BrowserProfilesDialog.tsxindex a133779da5..0f5b1ffece 100644--- a/jarvis/ui/web/frontend/src/components/society/browser/BrowserProfilesDialog.tsx+++ b/jarvis/ui/web/frontend/src/components/society/browser/BrowserProfilesDialog.tsx@@ -1,19 +1,20 @@-import { useEffect, useId, useState } from "react";+import { useEffect, useId, useState, type ReactNode } from "react";import * as Dialog from "@radix-ui/react-dialog";-import { Plus, RotateCw, X } from "lucide-react";+import { ChevronDown, Globe, Plug, Plus, RotateCw, UserRound, X } from "lucide-react";import { useQueryClient } from "@tanstack/react-query";import { useLocaleChunk, useT } from "@/i18n";-import { BrandedSelect } from "@/components/ui/select";import {BROWSER_PROFILES_QUERY, BROWSER_PROFILE_CHANGED_EVENT, BrowserProfileError, bindAgentBrowserProfile, createBrowserProfile,pairBrowserProfile, parseBrowserDomains, removeBrowserProfile, shareBrowserProfile,updateBrowserProfile, useBrowserProfiles,- type BrowserProfile, type BrowserProfileKind, type BrowserProfilePairing, type BrowserProfilesSnapshot,+ type BrowserBindingMode, type BrowserProfile, type BrowserProfileKind, type BrowserProfilePairing, type BrowserProfilesSnapshot,} from "@/lib/browserProfiles";import { cn } from "@/lib/utils";const button = "inline-flex items-center justify-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-foreground hover:bg-secondary disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";+const primaryButton = "inline-flex items-center justify-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";const input = "w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";+const choiceCard = "flex cursor-pointer items-start gap-3 rounded-lg border border-border bg-background p-3 hover:bg-secondary/50 has-[:checked]:border-primary has-[:checked]:bg-primary/5 has-[:disabled]:cursor-default";type SaveSnapshot = (data: BrowserProfilesSnapshot) => void;function useProfileAction() {@@ -39,59 +40,60 @@ function useProfileAction() {return { pending, run, feedback: message ? <p role={failed ? "alert" : "status"} className={cn("text-xs", failed ? "text-destructive" : "text-muted-foreground")}>{message}</p> : null };}-function ProfileFields({ name, setName, domains, setDomains, kind }: {- name: string; setName: (value: string) => void; domains: string; setDomains: (value: string) => void; kind: BrowserProfileKind;+function KindIcon({ kind }: { kind: BrowserProfileKind | "own" }) {+ const Icon = kind === "chrome" ? Plug : kind === "own" ? UserRound : Globe;+ return <span aria-hidden className="mt-0.5 grid size-7 shrink-0 place-items-center rounded-md bg-secondary text-muted-foreground"><Icon size={15} /></span>;+}++function Choice({ name, checked, disabled, onSelect, kind, title, hint }: {+ name: string; checked: boolean; disabled?: boolean; onSelect: () => void; kind: BrowserProfileKind | "own"; title: string; hint: string;}) {- const t = useT();- const id = useId();- return <>- <label className="grid gap-1 text-xs font-medium" htmlFor={`${id}-name`}>- {t("society.browser_profiles.name")}- <input id={`${id}-name`} className={input} required maxLength={80} autoComplete="off"- value={name} onChange={(event) => setName(event.target.value)} />- </label>- <label className="grid gap-1 text-xs font-medium" htmlFor={`${id}-domains`}>- {t("society.browser_profiles.domains")}- <input id={`${id}-domains`} className={input} required={kind === "chrome"} autoComplete="off" placeholder="x.com"- value={domains} onChange={(event) => setDomains(event.target.value)} aria-describedby={`${id}-domains-hint`} />- </label>- <p id={`${id}-domains-hint`} className="text-xs text-muted-foreground">{t(kind === "chrome" ? "society.browser_profiles.domains_hint" : "society.browser_profiles.managed_domains_hint")}</p>- </>;+ return <label className={choiceCard}>+ <input type="radio" name={name} className="mt-2 accent-primary" checked={checked} disabled={disabled} onChange={onSelect} />+ <KindIcon kind={kind} />+ <span className="grid gap-0.5">+ <span className="text-sm font-medium">{title}</span>+ <span className="text-xs text-muted-foreground">{hint}</span>+ </span>+ </label>;}-function AgentBinding({ agentId, data, onSaved }: { agentId: string; data: BrowserProfilesSnapshot; onSaved: SaveSnapshot }) {+function profileHint(profile: BrowserProfile, t: (key: string) => string) {+ return profile.kind === "chrome"+ ? t("society.browser_profiles.chrome_profile_hint").replace("{0}", profile.allowed_domains.join(", "))+ : t("society.browser_profiles.managed_profile_hint");+}++/** One plain question for the agent the dialog was opened from; a pick saves at once. */+function AgentChoice({ agentId, data, onSaved }: { agentId: string; data: BrowserProfilesSnapshot; onSaved: SaveSnapshot }) {const t = useT();+ const name = useId();const binding = data.bindings[agentId];- const original = binding?.mode === "profile" && binding.profile_id ? `profile:${binding.profile_id}` : (binding?.mode ?? "inherit");- const [choice, setChoice] = useState(original);+ const current = binding?.mode === "profile" && binding.profile_id ? `profile:${binding.profile_id}` : (binding?.mode ?? "inherit");const action = useProfileAction();const agent = data.agents.find((item) => item.agent_id === agentId);- const expectedId = binding?.effective_profile_id ?? (binding?.mode === "profile" ? binding.profile_id- : binding?.mode === "own" ? null : data.default_profile_id);- const effective = data.profiles.find((profile) => profile.id === expectedId);const defaultProfile = data.profiles.find((profile) => profile.id === data.default_profile_id);- const unavailable = t("society.browser_profiles.profile_unavailable");- const effectiveLabel = effective?.name ?? (expectedId ? unavailable : t("society.browser_profiles.own"));- return <form className="grid gap-3 rounded-lg border border-border bg-secondary/30 p-4" onSubmit={(event) => {- event.preventDefault();- void action.run(async () => {- const mode = choice.startsWith("profile:") ? "profile" : choice === "own" ? "own" : "inherit";- onSaved(await bindAgentBrowserProfile(agentId, mode, mode === "profile" ? choice.slice(8) : null));- });- }}>- <h3 className="text-sm font-semibold">{t("society.browser_profiles.agent_profile").replace("{0}", agent?.name ?? agentId)}</h3>- <BrandedSelect ariaLabel={t("society.browser_profiles.agent_choice")} value={choice} disabled={action.pending}- onValueChange={setChoice} options={[- { value: "inherit", label: `${t("society.browser_profiles.inherit")} · ${defaultProfile?.name ?? (data.default_profile_id ? unavailable : t("society.browser_profiles.own"))}` },- { value: "own", label: t("society.browser_profiles.own") },- ...data.profiles.map((profile) => ({ value: `profile:${profile.id}`, label: profile.name })),- ...(binding?.mode === "profile" && binding.profile_id && !data.profiles.some((profile) => profile.id === binding.profile_id)- ? [{ value: original, label: unavailable, disabled: true }] : []),- ]} />- <p className="text-xs text-muted-foreground">{t("society.browser_profiles.effective").replace("{0}", effectiveLabel)}</p>- <div><button type="submit" className={button} disabled={action.pending || choice === original}>{t("society.browser_profiles.save_agent")}</button></div>+ const missing = (binding?.mode === "profile" && !data.profiles.some((profile) => profile.id === binding.profile_id))+ || (binding?.mode === "inherit" && !!data.default_profile_id && !defaultProfile);+ // The default profile is offered as "Shared browser"; listing it again would show the same name twice.+ const others = data.profiles.filter((profile) => !profile.is_default || current === `profile:${profile.id}`);+ const choose = (mode: BrowserBindingMode, profileId: string | null = null) => void action.run(async () => {+ onSaved(await bindAgentBrowserProfile(agentId, mode, profileId));+ });+ return <section className="grid gap-3 rounded-xl border border-border bg-secondary/30 p-4">+ <h3 className="text-sm font-semibold">{t("society.browser_profiles.agent_title").replace("{0}", agent?.name ?? agentId)}</h3>+ {missing && <p role="alert" className="text-xs text-destructive">{t("society.browser_profiles.agent_needs_choice")}</p>}+ <div role="radiogroup" aria-label={t("society.browser_profiles.agent_title").replace("{0}", agent?.name ?? agentId)} className="grid gap-2">+ <Choice name={name} kind="managed" checked={current === "inherit" && !missing} disabled={action.pending || !defaultProfile}+ onSelect={() => choose("inherit")} title={t("society.browser_profiles.use_shared")}+ hint={defaultProfile ? t("society.browser_profiles.use_shared_hint").replace("{0}", defaultProfile.name) : t("society.browser_profiles.no_shared")} />+ <Choice name={name} kind="own" checked={current === "own"} disabled={action.pending}+ onSelect={() => choose("own")} title={t("society.browser_profiles.own")} hint={t("society.browser_profiles.own_hint")} />+ {others.map((profile) => <Choice key={profile.id} name={name} kind={profile.kind} checked={current === `profile:${profile.id}`}+ disabled={action.pending} onSelect={() => choose("profile", profile.id)} title={profile.name} hint={profileHint(profile, t)} />)}+ </div>{action.feedback}- </form>;+ </section>;}function PairingPanel({ profileId, connected }: { profileId: string; connected: boolean }) {@@ -105,26 +107,110 @@ function PairingPanel({ profileId, connected }: { profileId: string; connected:return () => window.clearTimeout(timer);}, [pairing]);useEffect(() => { if (connected) setPairing(null); }, [connected]);- return <section className="grid gap-3 rounded-lg border border-border bg-secondary/30 p-4">- <h3 className="text-sm font-semibold">{t("society.browser_profiles.connect_chrome")}</h3>- <p className="text-xs text-muted-foreground">{t("society.browser_profiles.extension_preview")}</p>- <p className="text-xs text-muted-foreground">{t("society.browser_profiles.chrome_limits")}</p>- <ol className="list-decimal space-y-2 pl-5 text-xs text-muted-foreground">- <li><a className="font-medium text-foreground underline underline-offset-2" href="/api/society/browser/extension.zip" download>{t("society.browser_profiles.download")}</a>{" "}{t("society.browser_profiles.unpack")}</li>- <li>{t("society.browser_profiles.install")}</li>- <li>{t("society.browser_profiles.pair_hint")}</li>- </ol>- <div><button type="button" className={button} disabled={action.pending} onClick={() => void action.run(async () => {- setPairing(await pairBrowserProfile(profileId));- setExpired(false);- })}>{t("society.browser_profiles.generate_code")}</button></div>- {pairing && <div className="grid gap-2 rounded-md border border-border bg-background p-3 text-xs">- <span>{t("society.browser_profiles.server")}</span><code className="break-all select-all">{pairing.server_url}</code>- <span>{t("society.browser_profiles.code")}</span>- <code className="select-all text-xl font-semibold tracking-widest" aria-label={t("society.browser_profiles.code")}>{pairing.pairing_code}</code>- <p className="text-muted-foreground">{t("society.browser_profiles.code_expiry").replace("{0}", String(Math.ceil(pairing.expires_in / 60)))}</p>- </div>}- {expired && <p role="status" className="text-xs text-muted-foreground">{t("society.browser_profiles.code_expired")}</p>}+ return <details open={!connected} className="group grid gap-3 rounded-lg border border-border p-3">+ <summary className="flex cursor-pointer list-none items-center justify-between text-sm font-semibold">+ {t(connected ? "society.browser_profiles.reconnect_chrome" : "society.browser_profiles.connect_chrome")}+ <ChevronDown size={14} aria-hidden className="transition-transform group-open:rotate-180" />+ </summary>+ <div className="mt-3 grid gap-3">+ <ol className="list-decimal space-y-2 pl-5 text-xs text-muted-foreground">+ <li><a className="font-medium text-foreground underline underline-offset-2" href="/api/society/browser/extension.zip" download>{t("society.browser_profiles.download")}</a>{" "}{t("society.browser_profiles.unpack")}</li>+ <li>{t("society.browser_profiles.install")}</li>+ <li>{t("society.browser_profiles.pair_hint")}</li>+ </ol>+ <div><button type="button" className={button} disabled={action.pending} onClick={() => void action.run(async () => {+ setPairing(await pairBrowserProfile(profileId));+ setExpired(false);+ })}>{t("society.browser_profiles.generate_code")}</button></div>+ {pairing && <div className="grid gap-2 rounded-md border border-border bg-background p-3 text-xs">+ <span>{t("society.browser_profiles.server")}</span><code className="break-all select-all">{pairing.server_url}</code>+ <span>{t("society.browser_profiles.code")}</span>+ <code className="select-all text-xl font-semibold tracking-widest" aria-label={t("society.browser_profiles.code")}>{pairing.pairing_code}</code>+ <p className="text-muted-foreground">{t("society.browser_profiles.code_expiry").replace("{0}", String(Math.ceil(pairing.expires_in / 60)))}</p>+ </div>}+ {expired && <p role="status" className="text-xs text-muted-foreground">{t("society.browser_profiles.code_expired")}</p>}+ <p className="text-xs text-muted-foreground">{t("society.browser_profiles.extension_preview")} {t("society.browser_profiles.chrome_limits")}</p>+ {action.feedback}+ </div>+ </details>;+}++function DomainsField({ kind, domains, setDomains }: { kind: BrowserProfileKind; domains: string; setDomains: (value: string) => void }) {+ const t = useT();+ const id = useId();+ const field = <>+ <label className="grid gap-1 text-xs font-medium" htmlFor={id}>+ {t("society.browser_profiles.domains")}+ <input id={id} className={input} required={kind === "chrome"} autoComplete="off" placeholder="x.com, github.com"+ value={domains} onChange={(event) => setDomains(event.target.value)} aria-describedby={`${id}-hint`} />+ </label>+ <p id={`${id}-hint`} className="text-xs text-muted-foreground">{t(kind === "chrome" ? "society.browser_profiles.domains_hint" : "society.browser_profiles.managed_domains_hint")}</p>+ </>;+ // Most Jarvis browser profiles never need a website limit, so it stays folded away.+ if (kind === "chrome") return field;+ return <details open={!!domains.trim()} className="grid gap-2">+ <summary className="cursor-pointer text-xs font-medium text-muted-foreground">{t("society.browser_profiles.limit_sites")}</summary>+ <div className="mt-2 grid gap-1">{field}</div>+ </details>;+}++function NameField({ name, setName }: { name: string; setName: (value: string) => void }) {+ const t = useT();+ const id = useId();+ return <label className="grid gap-1 text-xs font-medium" htmlFor={id}>+ {t("society.browser_profiles.name")}+ <input id={id} className={input} required maxLength={80} autoComplete="off" value={name} onChange={(event) => setName(event.target.value)} />+ </label>;+}++function UsedBy({ profile, data }: { profile: BrowserProfile; data: BrowserProfilesSnapshot }) {+ const t = useT();+ const names = data.agents.filter((agent) => profile.agent_ids.includes(agent.agent_id)).map((agent) => agent.name);+ if (profile.is_default && data.agents.length > 0 && names.length === data.agents.length) return <>{t("society.browser_profiles.used_by_all")}</>;+ if (!names.length) return <>{t(profile.is_default ? "society.browser_profiles.used_by_new" : "society.browser_profiles.used_by_none")}</>;+ const shown = names.length > 3 ? t("society.browser_profiles.used_by_more").replace("{0}", names.slice(0, 3).join(", ")).replace("{1}", String(names.length - 3)) : names.join(", ");+ return <>{t("society.browser_profiles.used_by").replace("{0}", shown)}</>;+}++function ProfileUsage({ profile, data, onSaved }: { profile: BrowserProfile; data: BrowserProfilesSnapshot; onSaved: SaveSnapshot }) {+ const t = useT();+ const [agents, setAgents] = useState(profile.agent_ids);+ const [confirming, setConfirming] = useState(false);+ const action = useProfileAction();+ const changed = agents.length !== profile.agent_ids.length || agents.some((id) => !profile.agent_ids.includes(id));+ const removed = profile.agent_ids.some((id) => !agents.includes(id));+ if (profile.is_default) return <section className="grid gap-1 border-t border-border pt-4">+ <h4 className="text-sm font-semibold">{t("society.browser_profiles.usage_title")}</h4>+ <p className="text-xs text-muted-foreground">{t("society.browser_profiles.default_usage")}</p>+ </section>;+ return <section className="grid gap-3 border-t border-border pt-4">+ <h4 className="text-sm font-semibold">{t("society.browser_profiles.usage_title")}</h4>+ {confirming ? <div className="grid gap-2 rounded-md border border-border bg-secondary/40 p-3">+ <p className="text-xs">{t("society.browser_profiles.make_default_confirm").replace("{0}", profile.name)}</p>+ <div className="flex gap-2">+ <button type="button" className={primaryButton} disabled={action.pending} onClick={() => void action.run(async () => {+ onSaved(await shareBrowserProfile(profile.id, { scope: "all", agent_ids: [] }));+ })}>{t("society.browser_profiles.confirm_make_default")}</button>+ <button type="button" className={button} disabled={action.pending} onClick={() => setConfirming(false)}>{t("society.browser_profiles.cancel")}</button>+ </div>+ </div> : <div><button type="button" className={button} disabled={action.pending} onClick={() => setConfirming(true)}>{t("society.browser_profiles.make_default")}</button></div>}+ <form className="grid gap-2" onSubmit={(event) => {+ event.preventDefault();+ void action.run(async () => onSaved(await shareBrowserProfile(profile.id, { scope: "selected", agent_ids: agents })));+ }}>+ <p className="text-xs text-muted-foreground">{t("society.browser_profiles.pick_agents")}</p>+ <fieldset className="grid max-h-44 gap-2 overflow-y-auto rounded-md border border-border p-3" disabled={action.pending}>+ <legend className="sr-only">{t("society.browser_profiles.pick_agents")}</legend>+ {data.agents.map((agent) => <label key={agent.agent_id} className="flex items-center gap-2 text-sm">+ <input type="checkbox" className="accent-primary" checked={agents.includes(agent.agent_id)} onChange={(event) => {+ setAgents((current) => event.target.checked ? [...current, agent.agent_id] : current.filter((id) => id !== agent.agent_id));+ }} />{agent.name}+ </label>)}+ {!data.agents.length && <p className="text-xs text-muted-foreground">{t("society.browser_profiles.no_agents")}</p>}+ </fieldset>+ {removed && <p className="text-xs text-muted-foreground">{t("society.browser_profiles.pick_agents_hint")}</p>}+ <div><button type="submit" className={button} disabled={action.pending || !changed}>{t("society.browser_profiles.save_agents")}</button></div>+ </form>{action.feedback}</section>;}@@ -135,82 +221,116 @@ function ProfileEditor({ profile, data, onSaved, onRemoved }: {const t = useT();const [name, setName] = useState(profile.name);const [domains, setDomains] = useState(profile.allowed_domains.join(", "));- const [scope, setScope] = useState<"all" | "selected">(profile.is_default ? "all" : "selected");- const [agents, setAgents] = useState(profile.agent_ids);const [removing, setRemoving] = useState(false);- const action = useProfileAction();- const scopeName = useId();- return <div className="grid gap-4">- <form className="grid gap-3" onSubmit={(event) => {- event.preventDefault();- void action.run(async () => onSaved(await updateBrowserProfile(profile.id, { name: name.trim(), allowed_domains: parseBrowserDomains(domains) })));- }}>- <ProfileFields name={name} setName={setName} domains={domains} setDomains={setDomains} kind={profile.kind} />- <div><button className={button} type="submit" disabled={action.pending || !name.trim() || (profile.kind === "chrome" && !parseBrowserDomains(domains).length)}>{t("society.browser_profiles.save_details")}</button></div>- </form>+ const details = useProfileAction();+ const removal = useProfileAction();+ const parsed = parseBrowserDomains(domains);+ const dirty = name.trim() !== profile.name || parsed.join(",") !== profile.allowed_domains.join(",");+ return <div className="grid gap-4 border-t border-border p-4">{profile.kind === "chrome" && <PairingPanel profileId={profile.id} connected={profile.connected} />}- <form className="grid gap-3 border-t border-border pt-4" onSubmit={(event) => {+ <form className="grid gap-3" onSubmit={(event) => {event.preventDefault();- void action.run(async () => onSaved(await shareBrowserProfile(profile.id, { scope, agent_ids: scope === "all" ? [] : agents })));+ void details.run(async () => onSaved(await updateBrowserProfile(profile.id, { name: name.trim(), allowed_domains: parsed })));}}>- <fieldset className="grid gap-2" disabled={action.pending}>- <legend className="mb-2 text-sm font-semibold">{t("society.browser_profiles.share_with")}</legend>- <label className="flex items-center gap-2 text-sm"><input type="radio" name={scopeName} className="accent-primary" checked={scope === "all"} onChange={() => setScope("all")} />{t("society.browser_profiles.all")}</label>- <p className="pl-5 text-xs text-muted-foreground">{t("society.browser_profiles.all_hint")}</p>- <label className="flex items-center gap-2 text-sm"><input type="radio" name={scopeName} className="accent-primary" checked={scope === "selected"} onChange={() => setScope("selected")} />{t("society.browser_profiles.selected")}</label>- {scope === "selected" && <p className="pl-5 text-xs text-muted-foreground">{t("society.browser_profiles.selected_hint")}</p>}- {scope === "selected" && <div className="grid max-h-44 gap-2 overflow-y-auto rounded-md border border-border p-3">- {data.agents.map((agent) => <label key={agent.agent_id} className="flex items-center gap-2 text-sm">- <input type="checkbox" className="accent-primary" checked={agents.includes(agent.agent_id)} onChange={(event) => {- setAgents((current) => event.target.checked ? [...current, agent.agent_id] : current.filter((id) => id !== agent.agent_id));- }} />{agent.name}- </label>)}- {!data.agents.length && <p className="text-xs text-muted-foreground">{t("society.browser_profiles.no_agents")}</p>}- </div>}- </fieldset>- <div><button type="submit" className={button} disabled={action.pending}>{t("society.browser_profiles.save_sharing")}</button></div>+ <NameField name={name} setName={setName} />+ <DomainsField kind={profile.kind} domains={domains} setDomains={setDomains} />+ <div><button className={button} type="submit" disabled={details.pending || !dirty || !name.trim() || (profile.kind === "chrome" && !parsed.length)}>{t("society.browser_profiles.save_details")}</button></div>+ {details.feedback}</form>- {action.feedback}+ <ProfileUsage key={profile.agent_ids.join(",")} profile={profile} data={data} onSaved={onSaved} /><div className="border-t border-border pt-3">{removing ? <div className="grid gap-2">- <p className="text-xs text-muted-foreground">{t("society.browser_profiles.remove_hint")}</p>+ <p className="text-xs text-muted-foreground">{t(profile.is_default ? "society.browser_profiles.remove_default_hint" : "society.browser_profiles.remove_hint")}</p><div className="flex gap-2">- <button type="button" className={cn(button, "text-destructive")} disabled={action.pending} onClick={() => void action.run(async () => {+ <button type="button" className={cn(button, "text-destructive")} disabled={removal.pending} onClick={() => void removal.run(async () => {onSaved(await removeBrowserProfile(profile.id)); onRemoved();})}>{t("society.browser_profiles.confirm_remove")}</button>- <button type="button" className={button} disabled={action.pending} onClick={() => setRemoving(false)}>{t("society.browser_profiles.cancel")}</button>+ <button type="button" className={button} disabled={removal.pending} onClick={() => setRemoving(false)}>{t("society.browser_profiles.cancel")}</button></div>+ {removal.feedback}</div> : <button type="button" className="text-xs text-destructive underline underline-offset-2" onClick={() => setRemoving(true)}>{t("society.browser_profiles.remove")}</button>}</div></div>;}-function NewProfile({ onCreated, onCancel }: { onCreated: (profile: BrowserProfile) => Promise<void>; onCancel: () => void }) {+function ProfileCard({ profile, data, open, onToggle, onSaved, onRemoved }: {+ profile: BrowserProfile; data: BrowserProfilesSnapshot; open: boolean; onToggle: () => void; onSaved: SaveSnapshot; onRemoved: () => void;+}) {const t = useT();- const [kind, setKind] = useState<BrowserProfileKind>("chrome");+ const panel = useId();+ const badge = (text: ReactNode, tone = "bg-secondary text-muted-foreground") =>+ <span className={cn("rounded-full px-2 py-0.5 text-[11px] font-medium", tone)}>{text}</span>;+ return <article className="rounded-xl border border-border bg-background" data-testid={`browser-profile-${profile.id}`}>+ <button type="button" className="flex w-full items-start gap-3 rounded-xl p-4 text-left hover:bg-secondary/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ aria-expanded={open} aria-controls={panel} onClick={onToggle}>+ <KindIcon kind={profile.kind} />+ <span className="grid min-w-0 flex-1 gap-1">+ <span className="flex flex-wrap items-center gap-2">+ <span className="truncate text-sm font-semibold">{profile.name}</span>+ {profile.is_default && badge(t("society.browser_profiles.default"), "bg-primary/10 text-primary")}+ {badge(t(profile.kind === "chrome" ? "society.browser_profiles.kind_chrome" : "society.browser_profiles.kind_managed"))}+ {profile.kind === "chrome" && badge(t(profile.connected ? "society.browser_profiles.status_connected" : "society.browser_profiles.status_disconnected"),+ profile.connected ? "bg-success/10 text-success" : "bg-warning/10 text-warning")}+ </span>+ <span className="text-xs text-muted-foreground"><UsedBy profile={profile} data={data} /></span>+ </span>+ <span className="flex shrink-0 items-center gap-1 text-xs text-muted-foreground">+ {t(open ? "society.browser_profiles.done" : "society.browser_profiles.manage")}+ <ChevronDown size={14} aria-hidden className={cn("transition-transform", open && "rotate-180")} />+ </span>+ </button>+ {open && <div id={panel}>+ <ProfileEditor key={`${profile.id}:${profile.name}:${profile.allowed_domains.join(",")}:${profile.is_default}`} profile={profile} data={data} onSaved={onSaved} onRemoved={onRemoved} />+ </div>}+ </article>;+}++function NewProfile({ initialKind, onCreated, onCancel }: { initialKind: BrowserProfileKind; onCreated: (profile: BrowserProfile) => Promise<void>; onCancel: () => void }) {+ const t = useT();+ const kindName = useId();+ const [kind, setKind] = useState<BrowserProfileKind>(initialKind);const [name, setName] = useState("");const [domains, setDomains] = useState("");const action = useProfileAction();- return <form className="grid gap-3 rounded-lg border border-border p-4" onSubmit={(event) => {+ const parsed = parseBrowserDomains(domains);+ return <form className="grid gap-3 rounded-xl border border-primary/40 p-4" onSubmit={(event) => {event.preventDefault();- void action.run(async () => onCreated(await createBrowserProfile({ name: name.trim(), kind, allowed_domains: parseBrowserDomains(domains) })));+ void action.run(async () => onCreated(await createBrowserProfile({ name: name.trim(), kind, allowed_domains: parsed })));}}>- <h3 className="text-sm font-semibold">{t("society.browser_profiles.new")}</h3>- <BrandedSelect ariaLabel={t("society.browser_profiles.kind")} value={kind} onValueChange={(value) => setKind(value as BrowserProfileKind)} disabled={action.pending}- options={[- { value: "chrome", label: t("society.browser_profiles.chrome") },- { value: "managed", label: t("society.browser_profiles.managed") },- ]} />- <p className="text-xs text-muted-foreground">{t(kind === "chrome" ? "society.browser_profiles.chrome_hint" : "society.browser_profiles.managed_hint")}</p>- <ProfileFields name={name} setName={setName} domains={domains} setDomains={setDomains} kind={kind} />+ <h3 className="text-sm font-semibold">{t("society.browser_profiles.new_title")}</h3>+ <div role="radiogroup" aria-label={t("society.browser_profiles.kind")} className="grid gap-2">+ <Choice name={kindName} kind="managed" checked={kind === "managed"} disabled={action.pending} onSelect={() => setKind("managed")}+ title={t("society.browser_profiles.new_managed")} hint={t("society.browser_profiles.new_managed_hint")} />+ <Choice name={kindName} kind="chrome" checked={kind === "chrome"} disabled={action.pending} onSelect={() => setKind("chrome")}+ title={t("society.browser_profiles.new_chrome")} hint={t("society.browser_profiles.new_chrome_hint")} />+ </div>+ <NameField name={name} setName={setName} />+ <DomainsField kind={kind} domains={domains} setDomains={setDomains} /><div className="flex gap-2">- <button type="submit" className={button} disabled={action.pending || !name.trim() || (kind === "chrome" && !parseBrowserDomains(domains).length)}>{t("society.browser_profiles.create")}</button>+ <button type="submit" className={primaryButton} disabled={action.pending || !name.trim() || (kind === "chrome" && !parsed.length)}>{t("society.browser_profiles.create")}</button><button type="button" className={button} disabled={action.pending} onClick={onCancel}>{t("society.browser_profiles.cancel")}</button></div>{action.feedback}</form>;}+function HowItWorks() {+ const t = useT();+ return <details className="group rounded-lg border border-border px-4 py-3">+ <summary className="flex cursor-pointer list-none items-center justify-between text-sm font-medium">+ {t("society.browser_profiles.how_title")}+ <ChevronDown size={14} aria-hidden className="transition-transform group-open:rotate-180" />+ </summary>+ <ul className="mt-3 grid gap-2 text-xs text-muted-foreground">+ <li><strong className="text-foreground">{t("society.browser_profiles.use_shared")}:</strong> {t("society.browser_profiles.how_shared")}</li>+ <li><strong className="text-foreground">{t("society.browser_profiles.how_sign_in_title")}:</strong> {t("society.browser_profiles.how_sign_in")}</li>+ <li><strong className="text-foreground">{t("society.browser_profiles.own")}:</strong> {t("society.browser_profiles.how_own")}</li>+ <li><strong className="text-foreground">{t("society.browser_profiles.kind_chrome")}:</strong> {t("society.browser_profiles.how_chrome")}</li>+ <li>{t("society.browser_profiles.persistence")}</li>+ </ul>+ </details>;+}+export default function BrowserProfilesDialog({ agentId, onClose, connectChrome = false }: {agentId?: string; onClose: () => void; connectChrome?: boolean;}) {@@ -218,14 +338,14 @@ export default function BrowserProfilesDialog({ agentId, onClose, connectChromeuseLocaleChunk("society");const queryClient = useQueryClient();const query = useBrowserProfiles();- const [selectedId, setSelectedId] = useState<string | null>(null);+ const [openId, setOpenId] = useState<string | null | undefined>(undefined);const [creating, setCreating] = useState(false);const [setupDismissed, setSetupDismissed] = useState(false);const data = query.data;const firstChrome = data?.profiles.find((profile) => profile.kind === "chrome");const showCreate = creating || (connectChrome && !!data && !firstChrome && !setupDismissed);- const selected = data?.profiles.find((profile) => profile.id === selectedId) ??- (connectChrome ? firstChrome : data?.profiles[0]);+ // Google recovery opens the Chrome profile it asks the user to connect; otherwise every card starts folded.+ const expanded = openId === undefined ? (connectChrome ? firstChrome?.id ?? null : null) : openId;const onSaved = (snapshot: BrowserProfilesSnapshot) => {const previous = queryClient.getQueryData<BrowserProfilesSnapshot>(BROWSER_PROFILES_QUERY);const changedProfiles = new Set(previous?.profiles.filter((profile) => {@@ -247,7 +367,7 @@ export default function BrowserProfilesDialog({ agentId, onClose, connectChromereturn <Dialog.Root open onOpenChange={(open) => { if (!open) onClose(); }}><Dialog.Portal><Dialog.Overlay className="fixed inset-0 z-[150] bg-scrim/60 backdrop-blur-sm" />- <Dialog.Content className="fixed left-1/2 top-1/2 z-[151] flex max-h-[90dvh] w-[min(46rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border bg-background text-foreground shadow-xl">+ <Dialog.Content className="fixed left-1/2 top-1/2 z-[151] flex max-h-[90dvh] w-[min(42rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border bg-background text-foreground shadow-xl"><div className="flex items-start justify-between gap-4 border-b border-border p-5"><div className="grid gap-1.5"><Dialog.Title className="font-display text-lg font-semibold">{t("society.browser_profiles.title")}</Dialog.Title>@@ -256,33 +376,32 @@ export default function BrowserProfilesDialog({ agentId, onClose, connectChrome<Dialog.Close className={button} aria-label={t("society.browser_profiles.close")}><X size={16} /></Dialog.Close></div><div className="grid gap-5 overflow-y-auto p-5">- <p className="text-xs text-muted-foreground">{t("society.browser_profiles.persistence")}</p>{connectChrome && <p role="note" className="rounded-lg border border-border bg-secondary/30 p-4 text-sm">{t("society.browser_profiles.google_signin_recovery")}</p>}- <div className="flex flex-wrap items-center gap-2">- <button type="button" className={button} disabled={!data || showCreate} onClick={() => setCreating(true)}><Plus size={14} />{t("society.browser_profiles.new")}</button>- <button type="button" className={button} disabled={query.isFetching} onClick={() => void query.refetch()}><RotateCw size={14} />{t("society.browser_profiles.refresh")}</button>- </div>{query.isLoading && <p role="status" className="text-sm text-muted-foreground">{t("society.browser_profiles.loading")}</p>}{query.isError && <p role="alert" className="text-sm text-destructive">{t("society.browser_profiles.load_error")}</p>}{data && <>- {agentId && <AgentBinding key={`${agentId}:${JSON.stringify(data.bindings[agentId])}`} agentId={agentId} data={data} onSaved={onSaved} />}- {showCreate && <NewProfile onCancel={() => { setCreating(false); setSetupDismissed(true); }} onCreated={async (profile) => {- await queryClient.invalidateQueries({ queryKey: BROWSER_PROFILES_QUERY });- setSelectedId(profile.id); setCreating(false); setSetupDismissed(true);- }} />}- {!data.profiles.length && !showCreate && <p className="rounded-lg border border-dashed border-border p-5 text-sm text-muted-foreground">{t("society.browser_profiles.empty")}</p>}- {!!data.profiles.length && <div className="grid gap-3">- <BrandedSelect ariaLabel={t("society.browser_profiles.choose_profile")} value={selected?.id ?? ""} onValueChange={setSelectedId}- options={data.profiles.map((profile) => ({ value: profile.id, label: `${profile.name}${profile.is_default ? ` · ${t("society.browser_profiles.default")}` : ""}` }))} />- {selected && <>- <p role="status" className="text-xs text-muted-foreground">{t(selected.kind === "chrome"- ? selected.connected ? "society.browser_profiles.connected" : "society.browser_profiles.disconnected"- : "society.browser_profiles.managed_status")}</p>- <ProfileEditor key={`${selected.id}:${selected.name}:${selected.allowed_domains.join(",")}:${selected.agent_ids.join(",")}:${selected.is_default}`} profile={selected} data={data} onSaved={onSaved} onRemoved={() => setSelectedId(null)} />- </>}- </div>}+ {agentId && <AgentChoice agentId={agentId} data={data} onSaved={onSaved} />}+ <section className="grid gap-3">+ <div className="flex flex-wrap items-center justify-between gap-2">+ <h3 className="text-sm font-semibold">{t("society.browser_profiles.profiles")}</h3>+ <div className="flex items-center gap-2">+ <button type="button" className={button} disabled={query.isFetching} onClick={() => void query.refetch()}+ aria-label={t("society.browser_profiles.refresh")} title={t("society.browser_profiles.refresh")}><RotateCw size={14} /></button>+ <button type="button" className={button} disabled={showCreate} onClick={() => setCreating(true)}><Plus size={14} />{t("society.browser_profiles.new")}</button>+ </div>+ </div>+ {showCreate && <NewProfile initialKind={connectChrome ? "chrome" : "managed"}+ onCancel={() => { setCreating(false); setSetupDismissed(true); }} onCreated={async (profile) => {+ await queryClient.invalidateQueries({ queryKey: BROWSER_PROFILES_QUERY });+ setOpenId(profile.id); setCreating(false); setSetupDismissed(true);+ }} />}+ {!data.profiles.length && !showCreate && <p className="rounded-lg border border-dashed border-border p-5 text-sm text-muted-foreground">{t("society.browser_profiles.empty")}</p>}+ {data.profiles.map((profile) => <ProfileCard key={profile.id} profile={profile} data={data} open={expanded === profile.id}+ onToggle={() => setOpenId(expanded === profile.id ? null : profile.id)} onSaved={onSaved} onRemoved={() => setOpenId(null)} />)}+ </section>+ <HowItWorks /></>}</div></Dialog.Content>diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json b/jarvis/ui/web/frontend/src/i18n/locales/society/de.jsonindex 5939f92e70..70f9e0ddcf 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json@@ -2,32 +2,26 @@"society": {"browser_profiles": {"profile_unavailable": "Profil getrennt — bitte ein Profil auswählen",- "selected_hint": "Agents, die dieses geteilte Profil nicht mehr verwenden dürfen, warten, bis du ihnen ausdrücklich ein anderes Profil zuweist. Zukünftige Agents behalten ihr eigenes Profil.","chrome_offline": "Chrome nicht verbunden","sign_in_chrome": "Direkt in Chrome anmelden","preview_paused": "Melde dich direkt in Chrome an. Jarvis pausiert die Vorschau, solange du dieses Profil steuerst. Gib die Steuerung anschließend zurück.","chrome_limits": "Agents steuern nur ihren eigenen Tab auf den erlaubten Websites. Datei-Uploads, Downloads und der Wechsel zu deinen anderen Chrome-Tabs werden noch nicht unterstützt.","title": "Browser-Profile",- "intro": "Einmal in einem Agenten-Browser anmelden: Alle Agenten, auch neue, verwenden standardmäßig das gemeinsame Profil. Ein separates Profil brauchst du nur für einen anderen Account.",- "persistence": "Profilzuordnungen und gespeicherte Website-Sitzungen bleiben auf diesem Computer erhalten, wenn du Jarvis schließt oder neu startest. Websites können einen Login trotzdem beenden oder eine erneute Anmeldung verlangen.",+ "intro": "Ein Browser-Profil speichert deine Website-Logins. Agents surfen damit und bleiben so angemeldet.",+ "persistence": "Logins und Einstellungen bleiben auf diesem Computer, auch nach einem Neustart. Eine Website kann dich trotzdem abmelden.","loading": "Profile werden geladen…","refresh": "Status aktualisieren","new": "Profil hinzufügen","name": "Profilname","domains": "Erlaubte Websites",- "domains_hint": "Gib Website-Domains durch Kommas getrennt ein, zum Beispiel x.com. Nur diese Websites dürfen gesteuert werden. Ergänze weitere benötigte Domains ausdrücklich.",- "managed_domains_hint": "Optional: Beschränke dieses separate Profil auf bestimmte Website-Domains. Ohne Eintrag gelten die Website-Freigaben von Jarvis.",- "agent_profile": "Browser-Profil für {0}",- "agent_choice": "Browser-Profil des Agents",- "inherit": "Gemeinsames Profil (Standard)",- "own": "Eigenes separates Profil",- "effective": "Verwendet aktuell: {0}",- "save_agent": "Auswahl speichern",+ "domains_hint": "Agents dürfen in deinem Chrome nur diese Websites öffnen. Trenne sie mit Kommas.",+ "managed_domains_hint": "Leer lassen, um alle Websites zu erlauben, die Jarvis zulässt.",+ "own": "Eigenes privates Profil","saved": "Gespeichert.","busy_error": "Der Browser wird gerade verwendet. Beende die aktuelle Browser-Aufgabe oder gib die manuelle Steuerung zurück und versuche es erneut.","save_error": "Die Änderung konnte nicht gespeichert werden. Prüfe den Profilnamen und die Website-Domains und versuche es erneut.","load_error": "Browser-Profile konnten nicht geladen werden. Versuche, den Status zu aktualisieren.",- "connect_chrome": "Dieses Chrome-Profil verbinden",+ "connect_chrome": "Dein Chrome verbinden","extension_preview": "Vorschau der Chrome-Verbindung: Bis zur Veröffentlichung im Chrome Web Store wird die Erweiterung manuell installiert.","download": "Erweiterung herunterladen","unpack": "Entpacke die ZIP-Datei in einen Ordner, den du behältst.",@@ -38,30 +32,18 @@"code": "Verbindungscode","code_expiry": "Für {0} Minuten gültig. Halte diesen Code privat: Er verbindet dieses Chrome-Profil mit Jarvis.","code_expired": "Der Verbindungscode ist abgelaufen. Erzeuge einen neuen Code.",- "share_with": "Wer verwendet dieses Profil?",- "all": "Alle Agents (einschließlich zukünftiger Agents)",- "all_hint": "Beim Speichern wird dieses Profil allen aktuellen Agents zugewiesen und zum Standard für zukünftige Agents. Einzelnen Agents kannst du danach ein anderes Profil zuweisen.",- "selected": "Nur ausgewählte Agents","no_agents": "Noch keine Agents vorhanden. Nach dem Erstellen kannst du ihnen dieses Profil zuweisen.",- "save_details": "Profildaten speichern",- "save_sharing": "Freigabe speichern",- "remove": "Profil aus Jarvis entfernen",- "remove_hint": "Die Profilverbindung und ihre Zuordnungen werden aus Jarvis entfernt. Gespeicherte Browserdaten und Website-Sitzungen werden nicht gelöscht.",- "confirm_remove": "Aus Jarvis entfernen",+ "save_details": "Änderungen speichern",+ "remove": "Profil entfernen",+ "remove_hint": "Das entfernt das Profil aus Jarvis. Gespeicherte Logins auf diesem Computer werden nicht gelöscht.",+ "confirm_remove": "Entfernen","cancel": "Abbrechen",- "kind": "Profiltyp",- "chrome": "Mein vorhandenes Chrome-Profil",- "managed": "Separates Browser-Profil",- "chrome_hint": "Agents verwenden sichtbare Tabs in deinem ausgewählten Chrome-Profil mit dessen bestehenden Logins. Verbinde es einmal über die Erweiterung.",- "managed_hint": "Mit Anmelden im Agent-Browser öffnest du normalen Chrome in diesem Fenster. Danach übergibst du dasselbe gespeicherte Profil wieder an den Agenten.",+ "kind": "Welche Art von Profil?","create": "Profil erstellen","close": "Browser-Profile schließen",- "empty": "Öffne einen Agenten-Browser, um das gemeinsame Profil zu nutzen. Weitere Profile brauchst du nur für getrennte Accounts oder zum Verbinden eines vorhandenen Chrome-Profils.",- "choose_profile": "Profil verwalten",+ "empty": "Noch kein Profil. Öffne den Browser eines Agents, dann legt Jarvis den gemeinsamen Browser automatisch an.","default": "Standard",- "connected": "Chrome verbunden. Ob du angemeldet bist, wird auf der jeweiligen Website geprüft.","disconnected": "Chrome nicht verbunden. Öffne das richtige Chrome-Profil, verbinde dessen Jarvis-Erweiterung und aktualisiere den Status. Browser-Aufgaben warten auf diese Verbindung.",- "managed_status": "Separates Profil. Website-Sitzungen werden lokal gespeichert; eine vorhandene Sitzung beweist keinen gültigen Login.","google_signin_rejected": "Google hat diese Anmeldung abgelehnt","google_signin_recovery": "Google kann die Anmeldung in einem automatisierten Browser ablehnen. Melde dich zuerst selbst im normalen Chrome an. Verbinde danach dieses Chrome-Profil hier und wähle es ausdrücklich für diesen Agenten aus.","connect_supported_chrome": "Normalen Chrome verbinden",@@ -73,7 +55,49 @@"inline_login_finish": "An Agent übergeben","inline_login_hint": "Melde dich hier in Chrome an. Wenn du fertig bist, übergib dieses Profil wieder an den Agenten. Dein Browserprofil wird auf diesem Computer gespeichert.","inline_login_recovery": "Mit Anmelden öffnest du dieses Profil in normalem Chrome innerhalb dieses Fensters. Während der Anmeldung ist die Agentensteuerung getrennt.",- "inline_login_unavailable": "Diese Sitzung kann die Anmeldung noch nicht öffnen. Dafür sind installiertes Google Chrome und eine aktuelle Windows-Browsersitzung nötig."+ "inline_login_unavailable": "Diese Sitzung kann die Anmeldung noch nicht öffnen. Dafür sind installiertes Google Chrome und eine aktuelle Windows-Browsersitzung nötig.",+ "how_title": "Wie funktioniert das?",+ "how_shared": "Das Browser-Profil von Jarvis. Jeder Agent nutzt es, solange du nichts anderes auswählst. Einmal anmelden – dann sind alle Agents angemeldet.",+ "how_sign_in_title": "Anmelden",+ "how_sign_in": "Öffne den Browser eines Agents, wähle „Anmelden“, melde dich auf der Website an und wähle dann „An Agent übergeben“.",+ "how_own": "Ein leeres Profil, das nur ein Agent nutzt – zum Beispiel für einen zweiten Account.",+ "how_chrome": "Verbindet ein Profil aus deinem normalen Chrome über eine kleine Erweiterung. Agents dürfen nur die Websites öffnen, die du erlaubst.",+ "agent_title": "Welchen Browser nutzt {0}?",+ "agent_needs_choice": "Das Profil dieses Agents wurde entfernt. Wähle ein Profil, damit er wieder surfen kann.",+ "use_shared": "Gemeinsamer Browser",+ "use_shared_hint": "{0} – dieselben Logins wie alle anderen Agents. Empfohlen.",+ "no_shared": "Es ist kein gemeinsames Profil eingerichtet. Wähle eine andere Option.",+ "own_hint": "Eigene Logins, die nur dieser Agent nutzt.",+ "managed_profile_hint": "Separater Jarvis-Browser mit eigenen Logins.",+ "chrome_profile_hint": "Dein normales Chrome · {0}",+ "profiles": "Profile",+ "kind_managed": "Jarvis-Browser",+ "kind_chrome": "Dein Chrome",+ "status_connected": "Verbunden",+ "status_disconnected": "Nicht verbunden",+ "used_by_all": "Genutzt von allen Agents und neuen Agents",+ "used_by_new": "Genutzt von neuen Agents",+ "used_by": "Genutzt von {0}",+ "used_by_more": "{0} und {1} weiteren",+ "used_by_none": "Noch von keinem Agent genutzt",+ "manage": "Verwalten",+ "done": "Schließen",+ "limit_sites": "Auf bestimmte Websites beschränken (optional)",+ "reconnect_chrome": "Erneut verbinden",+ "usage_title": "Wer nutzt dieses Profil?",+ "default_usage": "Jeder Agent nutzt dieses Profil, solange du ihm kein anderes zuweist. Neue Agents bekommen es automatisch.",+ "make_default": "Für alle Agents nutzen",+ "make_default_confirm": "Alle Agents wechseln zu {0}, auch Agents mit eigener Auswahl. Neue Agents bekommen es ebenfalls.",+ "confirm_make_default": "Alle Agents umstellen",+ "pick_agents": "Oder einzelne Agents auswählen:",+ "pick_agents_hint": "Abgewählte Agents surfen erst wieder, wenn du ihnen ein anderes Profil zuweist.",+ "save_agents": "Agents speichern",+ "remove_default_hint": "Das ist das gemeinsame Profil. Danach können Agents erst wieder surfen, wenn du jedem ein Profil zuweist. Gespeicherte Logins auf diesem Computer werden nicht gelöscht.",+ "new_title": "Neues Profil",+ "new_managed": "Zusätzlicher Jarvis-Browser",+ "new_managed_hint": "Ein leerer Browser für einen zweiten Account. Du meldest dich einmal in Jarvis an.",+ "new_chrome": "Dein normales Chrome",+ "new_chrome_hint": "Nutzt die Logins, die du in Chrome schon hast. Braucht eine kleine Erweiterung."},"profile_card": {"user_book": "Dein Profil & Präferenzen",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json b/jarvis/ui/web/frontend/src/i18n/locales/society/en.jsonindex e75b5aba27..a50f53a84d 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json@@ -2,32 +2,26 @@"society": {"browser_profiles": {"profile_unavailable": "Profile disconnected — choose a profile",- "selected_hint": "Agents removed from this shared profile wait until you explicitly choose another profile for them. Future agents keep their own profile.","chrome_offline": "Chrome disconnected","sign_in_chrome": "Sign in directly in Chrome","preview_paused": "Sign in directly in Chrome. Jarvis pauses the preview while you control this profile. Return control when you are finished.","chrome_limits": "Agents control only their own tab on the allowed websites. File uploads, downloads and switching your other Chrome tabs are not supported yet.","title": "Browser profiles",- "intro": "Sign in once in an agent browser. All agents, including new ones, use the shared profile by default. Choose a separate profile only when you need a different account.",- "persistence": "Profile assignments and saved website sessions stay on this computer after closing Jarvis or restarting it. Websites can still expire a login or ask you to sign in again.",+ "intro": "A browser profile keeps your website logins. Agents browse with it, so they stay signed in.",+ "persistence": "Logins and choices stay on this computer, also after a restart. A website can still log you out.","loading": "Loading profiles…","refresh": "Refresh status","new": "Add profile","name": "Profile name","domains": "Allowed websites",- "domains_hint": "Enter website domains separated by commas, for example x.com. Only these websites may be controlled. Add any other required domains explicitly.",- "managed_domains_hint": "Optional: restrict this separate profile to these website domains. Leave empty to allow websites permitted by Jarvis.",- "agent_profile": "Browser profile for {0}",- "agent_choice": "Agent browser profile",- "inherit": "Shared profile (default)",- "own": "Own separate profile",- "effective": "Currently uses: {0}",- "save_agent": "Save agent choice",+ "domains_hint": "Agents may only open these websites in your Chrome. Separate them with commas.",+ "managed_domains_hint": "Leave empty to allow every website Jarvis permits.",+ "own": "Own private profile","saved": "Saved.","busy_error": "The browser is in use. Finish the current browser task or release manual control, then try again.","save_error": "Could not save this change. Check the profile name and website domains, then try again.","load_error": "Could not load browser profiles. Try refreshing.",- "connect_chrome": "Connect this Chrome profile",+ "connect_chrome": "Connect your Chrome","extension_preview": "Chrome connection preview: the extension is installed manually until Chrome Web Store distribution is available.","download": "Download extension","unpack": "Unpack the ZIP into a folder you will keep.",@@ -38,30 +32,18 @@"code": "Pairing code","code_expiry": "Valid for {0} minutes. Keep this code private; it connects this Chrome profile to Jarvis.","code_expired": "The pairing code expired. Generate a new code to connect.",- "share_with": "Who uses this profile?",- "all": "All agents (including future agents)",- "all_hint": "Saving applies this profile to every current agent and makes it the default for future agents. You can choose another profile for individual agents afterwards.",- "selected": "Selected agents only","no_agents": "No agents yet. You can assign this profile after creating an agent.",- "save_details": "Save profile details",- "save_sharing": "Save sharing",- "remove": "Remove profile from Jarvis",- "remove_hint": "This removes the profile connection and its assignments from Jarvis. Stored browser data and website sessions are not deleted.",- "confirm_remove": "Remove from Jarvis",+ "save_details": "Save changes",+ "remove": "Remove profile",+ "remove_hint": "This removes the profile from Jarvis. Saved logins on this computer are not deleted.",+ "confirm_remove": "Remove","cancel": "Cancel",- "kind": "Profile type",- "chrome": "My existing Chrome profile",- "managed": "Separate browser profile",- "chrome_hint": "Agents use visible tabs in your selected Chrome profile with its existing logins. Connect once using the extension.",- "managed_hint": "Use Sign in in the agent browser to open regular Chrome in this window. When finished, hand the same saved profile back to the agent.",+ "kind": "What kind of profile?","create": "Create profile","close": "Close browser profiles",- "empty": "Open an agent browser to start using the shared profile. Add another profile only for separate accounts or to connect an existing Chrome profile.",- "choose_profile": "Profile to manage",+ "empty": "No profile yet. Open an agent's browser and Jarvis creates the shared browser automatically.","default": "Default",- "connected": "Chrome connected. Website login status is checked on each website.","disconnected": "Chrome disconnected. Open the correct Chrome profile, connect its Jarvis extension, then refresh. Browser tasks wait for this connection.",- "managed_status": "Separate profile. Website sessions are saved locally; an existing session does not prove you are still logged in.","google_signin_rejected": "Google declined this sign-in","google_signin_recovery": "Google can reject sign-in in an automated browser. Sign in yourself in regular Chrome first, then connect that Chrome profile here and explicitly choose it for this agent.","connect_supported_chrome": "Connect regular Chrome",@@ -73,7 +55,49 @@"inline_login_finish": "Hand back to agent","inline_login_hint": "Sign in here in Chrome. When finished, hand this profile back to the agent. Your browser profile is saved on this computer.","inline_login_recovery": "Choose Sign in to reopen this profile in regular Chrome inside this window, with agent control disconnected during sign-in.",- "inline_login_unavailable": "This session cannot open sign-in yet. It requires installed Google Chrome and a current Windows browser session."+ "inline_login_unavailable": "This session cannot open sign-in yet. It requires installed Google Chrome and a current Windows browser session.",+ "how_title": "How does this work?",+ "how_shared": "Jarvis' own browser profile. Every agent uses it unless you choose something else. Sign in once and every agent is signed in.",+ "how_sign_in_title": "Signing in",+ "how_sign_in": "Open an agent's browser, choose Sign in, log in to the website, then choose Hand back to agent.",+ "how_own": "An empty profile that only one agent uses, for example for a second account.",+ "how_chrome": "Connects a profile from your regular Chrome with a small extension. Agents may only open the websites you allow.",+ "agent_title": "Which browser does {0} use?",+ "agent_needs_choice": "The profile this agent used was removed. Choose a profile so it can browse again.",+ "use_shared": "Shared browser",+ "use_shared_hint": "{0} — the same logins as all other agents. Recommended.",+ "no_shared": "No shared profile is set up. Choose another option.",+ "own_hint": "Separate logins that only this agent uses.",+ "managed_profile_hint": "Separate Jarvis browser with its own logins.",+ "chrome_profile_hint": "Your regular Chrome · {0}",+ "profiles": "Profiles",+ "kind_managed": "Jarvis browser",+ "kind_chrome": "Your Chrome",+ "status_connected": "Connected",+ "status_disconnected": "Not connected",+ "used_by_all": "Used by all agents and new agents",+ "used_by_new": "Used by new agents",+ "used_by": "Used by {0}",+ "used_by_more": "{0} and {1} more",+ "used_by_none": "Not used by any agent yet",+ "manage": "Manage",+ "done": "Close",+ "limit_sites": "Limit to certain websites (optional)",+ "reconnect_chrome": "Connect again",+ "usage_title": "Who uses this profile?",+ "default_usage": "Every agent uses this profile unless you choose another one for it. New agents get it automatically.",+ "make_default": "Use for all agents",+ "make_default_confirm": "Every agent switches to {0}, also agents with their own choice. New agents get it too.",+ "confirm_make_default": "Switch all agents",+ "pick_agents": "Or choose individual agents:",+ "pick_agents_hint": "Agents you untick stop browsing until you choose another profile for them.",+ "save_agents": "Save agents",+ "remove_default_hint": "This is the shared profile. After removing it, agents cannot browse until you choose a profile for each of them. Saved logins on this computer are not deleted.",+ "new_title": "New profile",+ "new_managed": "Extra Jarvis browser",+ "new_managed_hint": "An empty browser for a second account. You sign in once inside Jarvis.",+ "new_chrome": "Your regular Chrome",+ "new_chrome_hint": "Uses the logins you already have in Chrome. Needs a small extension."},"profile_card": {"user_book": "Your profile & preferences",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json b/jarvis/ui/web/frontend/src/i18n/locales/society/es.jsonindex debd9ff957..37a8db1127 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json@@ -2,32 +2,26 @@"society": {"browser_profiles": {"profile_unavailable": "Perfil desconectado — elige un perfil",- "selected_hint": "Los agentes excluidos de este perfil compartido esperan hasta que elijas explícitamente otro perfil para ellos. Los agentes futuros conservan su propio perfil.","chrome_offline": "Chrome desconectado","sign_in_chrome": "Inicia sesión directamente en Chrome","preview_paused": "Inicia sesión directamente en Chrome. Jarvis pausa la vista previa mientras controlas este perfil. Devuelve el control cuando termines.","chrome_limits": "Los agentes solo controlan su propia pestaña en los sitios permitidos. Aún no se admiten cargas, descargas ni cambios a tus otras pestañas de Chrome.","title": "Perfiles del navegador",- "intro": "Inicia sesión una vez en el navegador de un agente. Todos los agentes, incluidos los nuevos, usan el perfil compartido por defecto. Elige un perfil separado solo si necesitas otra cuenta.",- "persistence": "Las asignaciones y las sesiones guardadas permanecen en este equipo al cerrar Jarvis o reiniciarlo. Los sitios pueden caducar una sesión o pedir que vuelvas a iniciar sesión.",+ "intro": "Un perfil de navegador guarda tus inicios de sesión. Los agentes navegan con él y siguen conectados.",+ "persistence": "Los inicios de sesión y las opciones se quedan en este ordenador, también tras reiniciar. Un sitio web aún puede cerrar tu sesión.","loading": "Cargando perfiles…","refresh": "Actualizar estado","new": "Añadir perfil","name": "Nombre del perfil","domains": "Sitios web permitidos",- "domains_hint": "Introduce dominios separados por comas, por ejemplo x.com. Solo se pueden controlar estos sitios. Añade explícitamente cualquier otro dominio necesario.",- "managed_domains_hint": "Opcional: limita este perfil independiente a estos dominios. Déjalo vacío para usar los permisos de sitios web de Jarvis.",- "agent_profile": "Perfil del navegador de {0}",- "agent_choice": "Perfil del navegador del agente",- "inherit": "Perfil compartido (predeterminado)",- "own": "Perfil independiente propio",- "effective": "Actualmente usa: {0}",- "save_agent": "Guardar selección",+ "domains_hint": "Los agentes solo pueden abrir estos sitios en tu Chrome. Sepáralos con comas.",+ "managed_domains_hint": "Déjalo vacío para permitir todos los sitios que Jarvis admite.",+ "own": "Perfil privado propio","saved": "Guardado.","busy_error": "El navegador está en uso. Termina la tarea actual o devuelve el control manual y vuelve a intentarlo.","save_error": "No se pudo guardar el cambio. Revisa el nombre y los dominios e inténtalo de nuevo.","load_error": "No se pudieron cargar los perfiles. Prueba a actualizar.",- "connect_chrome": "Conectar este perfil de Chrome",+ "connect_chrome": "Conectar tu Chrome","extension_preview": "Vista previa de la conexión con Chrome: la extensión se instala manualmente hasta que esté disponible en Chrome Web Store.","download": "Descargar extensión","unpack": "Descomprime el ZIP en una carpeta que vayas a conservar.",@@ -38,30 +32,18 @@"code": "Código de vinculación","code_expiry": "Válido durante {0} minutos. Mantén este código privado: conecta este perfil de Chrome con Jarvis.","code_expired": "El código ha caducado. Genera uno nuevo para conectar.",- "share_with": "¿Quién usa este perfil?",- "all": "Todos los agentes (incluidos los futuros)",- "all_hint": "Al guardar se asigna este perfil a todos los agentes actuales y se convierte en el predeterminado para los futuros. Después puedes elegir otro perfil para agentes individuales.",- "selected": "Solo agentes seleccionados","no_agents": "Aún no hay agentes. Puedes asignar este perfil después de crear uno.",- "save_details": "Guardar datos del perfil",- "save_sharing": "Guardar acceso compartido",- "remove": "Quitar perfil de Jarvis",- "remove_hint": "Se eliminan la conexión y sus asignaciones de Jarvis. Los datos del navegador y las sesiones de los sitios web se conservan.",- "confirm_remove": "Quitar de Jarvis",+ "save_details": "Guardar cambios",+ "remove": "Eliminar perfil",+ "remove_hint": "Esto quita el perfil de Jarvis. Los inicios de sesión guardados en este ordenador no se borran.",+ "confirm_remove": "Eliminar","cancel": "Cancelar",- "kind": "Tipo de perfil",- "chrome": "Mi perfil de Chrome existente",- "managed": "Perfil del navegador independiente",- "chrome_hint": "Los agentes usan pestañas visibles de tu perfil de Chrome con sus sesiones actuales. Conéctalo una vez mediante la extensión.",- "managed_hint": "Usa Iniciar sesión en el navegador del agente para abrir Chrome normal en esta ventana. Al terminar, devuelve el mismo perfil guardado al agente.",+ "kind": "¿Qué tipo de perfil?","create": "Crear perfil","close": "Cerrar perfiles del navegador",- "empty": "Abre el navegador de un agente para usar el perfil compartido. Añade otro perfil solo para separar cuentas o conectar un perfil de Chrome existente.",- "choose_profile": "Perfil que gestionar",+ "empty": "Aún no hay perfiles. Abre el navegador de un agente y Jarvis crea el navegador compartido automáticamente.","default": "Predeterminado",- "connected": "Chrome conectado. El estado de inicio de sesión se comprueba en cada sitio.","disconnected": "Chrome desconectado. Abre el perfil correcto, conecta su extensión de Jarvis y actualiza. Las tareas del navegador esperan esta conexión.",- "managed_status": "Perfil independiente. Las sesiones se guardan localmente; una sesión guardada no demuestra que el acceso siga siendo válido.","google_signin_rejected": "Google ha rechazado este inicio de sesión","google_signin_recovery": "Google puede rechazar el inicio de sesión en un navegador automatizado. Inicia sesión personalmente en Chrome normal; después conecta ese perfil aquí y elígelo explícitamente para este agente.","connect_supported_chrome": "Conectar Chrome normal",@@ -73,7 +55,49 @@"inline_login_finish": "Devolver al agente","inline_login_hint": "Inicia sesión aquí en Chrome. Al terminar, devuelve este perfil al agente. Tu perfil del navegador se guarda en este equipo.","inline_login_recovery": "Elige Iniciar sesión para abrir este perfil en Chrome normal dentro de esta ventana, con el control del agente desconectado durante el inicio de sesión.",- "inline_login_unavailable": "Esta sesión aún no puede abrir el inicio de sesión. Se necesita Google Chrome instalado y una sesión actualizada del navegador en Windows."+ "inline_login_unavailable": "Esta sesión aún no puede abrir el inicio de sesión. Se necesita Google Chrome instalado y una sesión actualizada del navegador en Windows.",+ "how_title": "¿Cómo funciona?",+ "how_shared": "El perfil de navegador propio de Jarvis. Todos los agentes lo usan salvo que elijas otro. Inicia sesión una vez y todos los agentes quedan conectados.",+ "how_sign_in_title": "Iniciar sesión",+ "how_sign_in": "Abre el navegador de un agente, elige «Iniciar sesión», entra en el sitio web y luego elige «Devolver al agente».",+ "how_own": "Un perfil vacío que solo usa un agente, por ejemplo para una segunda cuenta.",+ "how_chrome": "Conecta un perfil de tu Chrome habitual con una pequeña extensión. Los agentes solo pueden abrir los sitios que permitas.",+ "agent_title": "¿Qué navegador usa {0}?",+ "agent_needs_choice": "Se eliminó el perfil que usaba este agente. Elige un perfil para que pueda volver a navegar.",+ "use_shared": "Navegador compartido",+ "use_shared_hint": "{0}: los mismos inicios de sesión que los demás agentes. Recomendado.",+ "no_shared": "No hay un perfil compartido. Elige otra opción.",+ "own_hint": "Inicios de sesión separados que solo usa este agente.",+ "managed_profile_hint": "Navegador de Jarvis aparte con sus propios inicios de sesión.",+ "chrome_profile_hint": "Tu Chrome habitual · {0}",+ "profiles": "Perfiles",+ "kind_managed": "Navegador de Jarvis",+ "kind_chrome": "Tu Chrome",+ "status_connected": "Conectado",+ "status_disconnected": "No conectado",+ "used_by_all": "Lo usan todos los agentes y los nuevos",+ "used_by_new": "Lo usan los agentes nuevos",+ "used_by": "Lo usa {0}",+ "used_by_more": "{0} y {1} más",+ "used_by_none": "Ningún agente lo usa todavía",+ "manage": "Gestionar",+ "done": "Cerrar",+ "limit_sites": "Limitar a ciertos sitios web (opcional)",+ "reconnect_chrome": "Volver a conectar",+ "usage_title": "¿Quién usa este perfil?",+ "default_usage": "Todos los agentes usan este perfil salvo que les asignes otro. Los agentes nuevos lo reciben automáticamente.",+ "make_default": "Usar para todos los agentes",+ "make_default_confirm": "Todos los agentes pasan a {0}, también los que tienen su propia elección. Los agentes nuevos también lo reciben.",+ "confirm_make_default": "Cambiar todos los agentes",+ "pick_agents": "O elige agentes concretos:",+ "pick_agents_hint": "Los agentes que desmarques dejan de navegar hasta que les asignes otro perfil.",+ "save_agents": "Guardar agentes",+ "remove_default_hint": "Este es el perfil compartido. Después, los agentes no podrán navegar hasta que asignes un perfil a cada uno. Los inicios de sesión guardados en este ordenador no se borran.",+ "new_title": "Nuevo perfil",+ "new_managed": "Navegador de Jarvis adicional",+ "new_managed_hint": "Un navegador vacío para una segunda cuenta. Inicias sesión una vez dentro de Jarvis.",+ "new_chrome": "Tu Chrome habitual",+ "new_chrome_hint": "Usa los inicios de sesión que ya tienes en Chrome. Necesita una pequeña extensión."},"profile_card": {"user_book": "Tu perfil y preferencias",diff --git a/tests/unit/society/test_browser_shared_default.py b/tests/unit/society/test_browser_shared_default.pyindex 572e16fd69..279afe9d8e 100644--- a/tests/unit/society/test_browser_shared_default.py+++ b/tests/unit/society/test_browser_shared_default.py@@ -140,6 +140,22 @@ def test_legacy_selected_configuration_without_marker_is_not_reset(tmp_path):assert profiles.resolve(agent("future")).profile_id is None+def test_legacy_shared_chrome_name_is_renamed_once_without_changing_access(tmp_path):+ profiles = BrowserProfiles(tmp_path)+ assert profiles.ensure_shared_default(agent())+ shared = profiles.resolve(agent())+ with sqlite3.connect(profiles.path) as db:+ db.execute("UPDATE profiles SET name='Shared Chrome'")+ db.execute("DELETE FROM settings WHERE key='shared_name_v2'")+ agents = [{"agent_id": "lead", "name": "Lead"}]++ assert profiles.snapshot(agents, set())["profiles"][0]["name"] == "Shared browser"+ assert profiles.resolve(agent()).access_key == shared.access_key+ # A name the user picks later is never rewritten.+ profiles.update(shared.profile_id, name="Shared Chrome", domains=None)+ assert profiles.snapshot(agents, set())["profiles"][0]["name"] == "Shared Chrome"++def test_queued_adoption_shares_original_storage_and_clears_all_overrides(tmp_path):folder = owned_folder(tmp_path, "source")profiles = BrowserProfiles(tmp_path)