diff --git a/packages/app/component-tests/browser-settings.spec.ts b/packages/app/component-tests/browser-settings.spec.ts index 179acedf49c..aaa73e85830 100644 --- a/packages/app/component-tests/browser-settings.spec.ts +++ b/packages/app/component-tests/browser-settings.spec.ts @@ -76,6 +76,29 @@ story("no setting decides what an import brings: the import section has its brow await expect(view.stored).not.toContainText("importHistory") }) +story("each switch is named by its row's title, and each row says what it does in one sentence", async ({ page }) => { + const view = await open(page, { target: "settings-browser-remote", extensions: true }) + const row = (id: string) => view.root.locator(`[data-action="${id}"]`) + + // The switch's accessible name is the row's title, so a screen reader hears what the row shows. + for (const [id, title, description] of [ + ["settings-browser-links", "Open links in OpenCode", "Hold Shift and click a link to use your default browser."], + ["settings-browser-remote", "Share sign-ins with remote servers", "Only turn on for servers you trust, since they can access your signed\u2011in sites."], + ["settings-browser-agent-pages", "Open browser automatically", "Show the tab when the agent opens a page or file for you."], + ] as const) { + await expect(row(id).locator('[data-slot="settings-row-title"]')).toHaveText(title) + await expect(row(id).locator('[data-slot="settings-row-description"]')).toHaveText(description) + await expect(row(id).getByRole("switch", { name: title, exact: true })).toHaveCount(1) + } + + await expect(row("settings-browser-extensions").locator('[data-slot="settings-row-description"]')).toHaveText( + "Install from the Chrome Web Store, Edge Add-ons, or your other browsers.", + ) + const sites = view.root.getByRole("region", { name: "Site permissions", exact: true }) + await expect(sites.locator('[data-slot="settings-row-title"]')).toHaveText("No saved permissions") + await expect(sites.locator("p")).toHaveText("Agent and remote server tabs ask again. Clearing browsing data keeps saved permissions.") +}) + story("clearing browsing data that left the history behind says so in its row, and still forgets the window's last pages", async ({ page }) => { const view = await open(page, { target: "settings-browser-cookies", historyKept: true }) const data = view.root.getByRole("region", { name: "Browser data", exact: true }) @@ -110,7 +133,10 @@ for (const [name, file, line] of [ story("Add an extension aligns controls without top clipping and switches cleanly into a confirmation step", async ({ page }) => { const view = await open(page, { extensions: true }) - await view.root.getByRole("button", { name: "Add extension" }).click() + // The row is "Add an extension", so its button is "Add", with its plus. + const add = view.root.locator('[data-action="settings-browser-extensions"]').getByRole("button", { name: "Add", exact: true }) + await expect(add.locator("svg")).toHaveCount(1) + await add.click() const dialog = page.getByRole("dialog", { name: "Add an extension" }) await expect(dialog).toBeVisible() await expect(dialog.getByText("LastPass: Free Password Manager")).toBeVisible() @@ -180,7 +206,7 @@ story("Add an extension aligns controls without top clipping and switches cleanl // Approving installs the extension and returns to the picker with status and updated row state. await dialog.getByRole("button", { name: "Add", exact: true }).nth(1).click() - await confirm.getByRole("button", { name: "Add extension" }).click() + await confirm.getByRole("button", { name: "Add", exact: true }).click() await expect(page.getByRole("dialog", { name: "Add an extension" })).toBeVisible() await expect(dialog.getByRole("status")).toContainText("Added LastPass: Free Password Manager.") await expect(dialog.getByRole("button", { name: "Added" })).toBeDisabled() diff --git a/packages/gui-plugins/src/browser/i18n/en.ts b/packages/gui-plugins/src/browser/i18n/en.ts index dd1bdb06fed..81ad28a17fb 100644 --- a/packages/gui-plugins/src/browser/i18n/en.ts +++ b/packages/gui-plugins/src/browser/i18n/en.ts @@ -129,8 +129,8 @@ export default { "extensions.access.clipboard": "Read what you copy", "extensions.compat.partial": "Some features don't work here", "extensions.compat.unsupported": "Probably won't work here", - "extensions.compat.cause.startup": "It needs browser features that are missing here, so it likely stops as soon as it starts.", - "extensions.compat.missing": "Doesn't work here:", + "extensions.compat.cause.startup": "Needs unsupported features, so it may stop right away.", + "extensions.compat.missing": "Not supported:", "extensions.compat.feature.network": "Watching what pages load", "extensions.compat.feature.shortcuts": "Keyboard shortcuts", "extensions.compat.feature.native": "Connecting to an app on your computer", @@ -190,12 +190,10 @@ export default { "settings.title": "Browser", "settings.open": "Browser settings", "settings.unavailable": "The browser is available in the desktop app.", - "settings.links.title": "Open links in OpenCode's browser", - "settings.links.description": - "Web links in a session open next to the conversation. To use your default browser, hold Shift while you click.", + "settings.links.title": "Open links in OpenCode", + "settings.links.description": "Hold Shift and click a link to use your default browser.", "settings.remote.title": "Share sign-ins with remote servers", - "settings.remote.description": - "Remote servers can use your sign-ins: their pages open signed in to your sites, and those sites can change your sign-ins on this device. Turn this on only for servers you trust.", + "settings.remote.description": "Only turn on for servers you trust, since they can access your signed\u2011in sites.", "settings.import.title": "Import from another browser", "settings.import.none": "No other browser found on this computer", "settings.import.choose": "Choose sites", @@ -220,18 +218,17 @@ export default { "settings.extensions.note": "Some extensions may not work here yet.", "settings.extensions.add.title": "Add an extension", "settings.extensions.confirm.title": 'Add "{{name}}"?', - "settings.extensions.add.description": "From the Chrome Web Store or Edge Add-ons, or one your other browsers already have.", - "settings.extensions.add.action": "Add extension", - "settings.extensions.dialog.description": "Extensions run in every page of this browser.", + "settings.extensions.add.description": "Install from the Chrome Web Store, Edge Add-ons, or your other browsers.", + "settings.extensions.dialog.description": "Extensions run on every page in this browser.", "settings.extensions.store.label": "Link to the extension", - "settings.extensions.store.placeholder": "Paste a link from the Chrome Web Store or Edge Add-ons", + "settings.extensions.store.placeholder": "Paste a Chrome Web Store or Edge Add-ons link", "settings.extensions.add": "Add", "settings.extensions.anyway": "Add anyway", "settings.extensions.added": "Added", "settings.extensions.browser.title": "From your browsers", "settings.extensions.browser.select": "Browser profile", "settings.extensions.browser.empty": "This browser has no extensions", - "settings.extensions.folder.action": "Add from a folder", + "settings.extensions.folder.action": "Choose folder", "settings.extensions.folder.pick": "Choose an extension folder", "settings.extensions.done": "Done", "settings.extensions.remove": "Remove {{name}}", @@ -253,8 +250,8 @@ export default { "menu.openPage": "Open in default browser", "menu.pageUnavailable": "This page can't open in your default browser", "menu.privateAddress": "This address only works in OpenCode's browser.", - "settings.agentPages.title": "Open the browser when the agent shows a page", - "settings.agentPages.description": "When the agent opens or switches to a tab, or shows you a file, the browser opens if it is closed and that tab comes to the front. A tab the agent opens in the background stays behind the one you are on.", + "settings.agentPages.title": "Open browser automatically", + "settings.agentPages.description": "Show the tab when the agent opens a page or file for you.", "tab.activity": "The agent used this tab", "menu.failed": "Couldn't open this page in your default browser.", "menu.copyLink": "Copy link address", @@ -336,8 +333,8 @@ export default { "prompt.system.camera.other": "The system did not let OpenCode use the camera.", "prompt.system.microphone.other": "The system did not let OpenCode use the microphone.", "settings.sites.title": "Site permissions", - "settings.sites.note": "Your saved answers apply in the tabs you use yourself. Sites ask again in tabs the agent works in and in tabs of remote servers. Clearing browsing data keeps these answers.", - "settings.sites.none": "No saved site permissions", + "settings.sites.note": "Agent and remote server tabs ask again. Clearing browsing data keeps saved permissions.", + "settings.sites.none": "No saved permissions", "settings.sites.allow": "Allowed", "settings.sites.block": "Blocked", "settings.sites.setting": "{{permission}} on {{site}}", @@ -348,7 +345,7 @@ export default { "settings.sites.permission.notifications": "Notifications", "settings.sites.permission.clipboard-read": "Clipboard", "extensions.failed.collision": "This extension clashes with one you already added. Nothing was replaced.", - "settings.extensions.changed": "This extension changed since you reviewed it. Add it again to review it before it runs.", + "settings.extensions.changed": "This extension changed. Add it again to review and run it.", "settings.extensions.replaces": "Replaces the installed copy of {{name}} and keeps its data.", "extensions.failed.expired": "This review is no longer current. Add the extension again to review it.", "extensions.notification.title": "Extension: {{name}}", @@ -443,5 +440,5 @@ export default { "zoom.label": "Zoom", "site.secure.description": "Information you send to this site stays private.", "site.cache": "Saved files", - "settings.extensions.folder.description": "Load an extension you are building from its folder.", + "settings.extensions.folder.description": "Load an extension from a folder.", } diff --git a/packages/gui-plugins/src/browser/renderer.tsx b/packages/gui-plugins/src/browser/renderer.tsx index 637a192cfc5..c68eef9d07d 100644 --- a/packages/gui-plugins/src/browser/renderer.tsx +++ b/packages/gui-plugins/src/browser/renderer.tsx @@ -481,8 +481,12 @@ const setup: Plugin.Setup = (ctx) => { }, get entries() { return [ - { id: "settings-browser-links", title: ctx.t("settings.links.title"), keywords: "links open system browser" }, - { id: "settings-browser-agent-pages", title: ctx.t("settings.agentPages.title"), keywords: "agent preview automatic browser pane" }, + { id: "settings-browser-links", title: ctx.t("settings.links.title"), keywords: "links open system default browser opencode's browser web shift click" }, + { + id: "settings-browser-agent-pages", + title: ctx.t("settings.agentPages.title"), + keywords: "open the browser when the agent shows a page agent preview automatic browser pane tab file", + }, { id: "settings-browser-remote", title: ctx.t("settings.remote.title"), diff --git a/packages/gui-plugins/src/browser/settings.tsx b/packages/gui-plugins/src/browser/settings.tsx index 61b9eec02e9..d7ab9718459 100644 --- a/packages/gui-plugins/src/browser/settings.tsx +++ b/packages/gui-plugins/src/browser/settings.tsx @@ -148,7 +148,7 @@ export default function BrowserSettings(props: { target?: string }) { description={ctx.t("settings.extensions.add.description")} > - {ctx.t("settings.extensions.add.action")} + {ctx.t("settings.extensions.add")} @@ -705,7 +705,7 @@ function AddExtension(props: { sources: readonly ProfileSource[]; close: () => v > {pending().result.type === "unsupported" ? ctx.t("settings.extensions.anyway") - : ctx.t("settings.extensions.add.action")} + : ctx.t("settings.extensions.add")} )}