fix(site): link the chrome extension in the browse install and mark the cli as optional (#62494)

This commit is contained in:
Dax
2026-11-06 21:49:46 -05:00
committed by GitHub
Unverified
parent 93c65afbf0
commit 262d44ce8d
21 changed files with 42 additions and 22 deletions
@@ -371,6 +371,8 @@ export function ExtensionDownload(props: {
lead: string
command?: string
commands?: { method: string; command: string }[]
/** Where the lead's [bracketed] words link to. */
store?: string
}) {
const i18n = useI18n()
const state = useCopy()
@@ -380,7 +382,23 @@ export function ExtensionDownload(props: {
<section data-component="block" data-slot="product-download" data-section="download">
<SectionHeading id="download" title={i18n.t("download.action.install")} label />
<div data-slot="body" ref={root}>
<p data-slot="lead">{props.lead}</p>
<p data-slot="lead">
<For each={props.lead.split(/(\[[^\]]+\])/)}>
{(part) =>
part.startsWith("[") && part.endsWith("]") ? (
<Show when={props.store} fallback={part.slice(1, -1)}>
{(href) => (
<a href={href()} target="_blank" rel="noopener">
{part.slice(1, -1)}
</a>
)}
</Show>
) : (
part
)
}
</For>
</p>
<Show when={props.commands ?? (props.command ? [{ method: props.command.split(" ")[0], command: props.command }] : undefined)}>
{(commands) => (
<ul data-component="download-list">
@@ -51,10 +51,10 @@ export const extensionPages: readonly Extension[] = [
{ title: "Allowlists", body: "Limit a session's tabs to the sites you name." },
],
install: {
lead: "Install the Chrome extension first. It walks you through the rest of the steps. To install the CLI directly, use any of these.",
lead: "Install the [Chrome extension] first. It walks you through the rest of the steps. To install the CLI directly (you should not need to do this), use any of these.",
commands: [
{ method: "curl", command: "curl -fsSL https://opencode.ai/browse/install | bash" },
{ method: "powershell", command: "irm https://opencode.ai/browse/install.ps1 | iex" },
{ method: "pwsh", command: "irm https://opencode.ai/browse/install.ps1 | iex" },
{ method: "npm", command: "npm install -g @opencode/browse && browse install" },
{ method: "bun", command: "bun add -g @opencode/browse && browse install" },
],
@@ -157,7 +157,7 @@ export function ExtensionPage(props: { slug: ExtensionSlug; path?: string }) {
</For>
</ul>
<ExtensionDownload lead={extension().install} command={command()} commands={data().install.commands} />
<ExtensionDownload lead={extension().install} command={command()} commands={data().install.commands} store={data().store} />
<MoreFromAnomaly slot="more-from-anomaly" exclude={props.slug} />
</Site>
+1 -1
View File
@@ -198,7 +198,7 @@ export const content = {
allowlists: { title: "قوائم السماح", body: "اقصر علامات تبويب الجلسة على المواقع التي تحددها." },
},
install:
"ثبّت إضافة Chrome أولًا، وستُرشدك خلال بقية الخطوات. لتثبيت CLI مباشرة، استخدم أيًّا من هذه الأوامر.",
"ثبّت [إضافة Chrome] أولًا، وستُرشدك خلال بقية الخطوات. لتثبيت CLI مباشرة (لن تحتاج إلى ذلك عادةً)، استخدم أيًّا من هذه الأوامر.",
},
},
apps: {
+1 -1
View File
@@ -390,7 +390,7 @@ export const content = {
},
},
install:
"Instale a extensão do Chrome primeiro. Ela guia você pelo resto dos passos. Para instalar a CLI diretamente, use qualquer um destes.",
"Instale a [extensão do Chrome] primeiro. Ela guia você pelo resto dos passos. Para instalar a CLI diretamente (você não deve precisar disso), use qualquer um destes.",
},
},
apps: {
+1 -1
View File
@@ -269,7 +269,7 @@ export const content = {
allowlists: { title: "Hvidlister", body: "Begræns en sessions faner til de sites, du angiver." },
},
install:
"Installer Chrome-udvidelsen først. Den guider dig gennem resten af trinene. Vil du installere CLI'en direkte, så brug en af disse.",
"Installer [Chrome-udvidelsen] først. Den guider dig gennem resten af trinene. Vil du installere CLI'en direkte (det burde du ikke have brug for), så brug en af disse.",
},
},
apps: {
+1 -1
View File
@@ -302,7 +302,7 @@ export const content = {
allowlists: { title: "Allowlists", body: "Beschränke die Tabs einer Session auf die Websites, die du nennst." },
},
install:
"Installiere zuerst die Chrome-Extension. Sie führt dich durch die restlichen Schritte. Um die CLI direkt zu installieren, nimm einen dieser Befehle.",
"Installiere zuerst die [Chrome-Extension]. Sie führt dich durch die restlichen Schritte. Um die CLI direkt zu installieren (das solltest du nicht brauchen), nimm einen dieser Befehle.",
},
},
apps: {
+1 -1
View File
@@ -365,7 +365,7 @@ export const content = {
},
},
install:
"Instala primero la extensión de Chrome. Te guía por el resto de los pasos. Para instalar la CLI directamente, usa cualquiera de estos.",
"Instala primero la [extensión de Chrome]. Te guía por el resto de los pasos. Para instalar la CLI directamente (no deberías necesitarlo), usa cualquiera de estos.",
},
},
apps: {
+1 -1
View File
@@ -365,7 +365,7 @@ export const content = {
},
},
install:
"Installez d'abord l'extension Chrome. Elle vous guide pour le reste des étapes. Pour installer la CLI directement, utilisez l'une de ces commandes.",
"Installez d'abord l'[extension Chrome]. Elle vous guide pour le reste des étapes. Pour installer la CLI directement (vous ne devriez pas en avoir besoin), utilisez l'une de ces commandes.",
},
},
apps: {
+1 -1
View File
@@ -365,7 +365,7 @@ export const content = {
},
},
install:
"Installa prima l'estensione di Chrome. Ti guida nel resto dei passaggi. Per installare la CLI direttamente, usa uno di questi.",
"Installa prima l'[estensione di Chrome]. Ti guida nel resto dei passaggi. Per installare la CLI direttamente (non dovrebbe servirti), usa uno di questi.",
},
},
apps: {
+1 -1
View File
@@ -281,7 +281,7 @@ export const content = {
allowlists: { title: "許可リスト", body: "セッションのタブを、指定したサイトだけに制限できます。" },
},
install:
"まず Chrome 拡張機能をインストールしてください。残りの手順は拡張機能が案内します。CLI を直接インストールする場合は、次のいずれかを使ってください。",
"まず [Chrome 拡張機能] をインストールしてください。残りの手順は拡張機能が案内します。CLI を直接インストールする場合は(通常は不要です)、次のいずれかを使ってください。",
},
},
apps: {
+1 -1
View File
@@ -232,7 +232,7 @@ export const content = {
allowlists: { title: "허용 목록", body: "세션의 탭을 지정한 사이트로만 제한하세요." },
},
install:
"먼저 Chrome 확장 프로그램을 설치하세요. 나머지 단계는 확장 프로그램이 안내합니다. CLI를 직접 설치하려면 아래 명령 중 하나를 사용하세요.",
"먼저 [Chrome 확장 프로그램]을 설치하세요. 나머지 단계는 확장 프로그램이 안내합니다. CLI를 직접 설치하려면(보통은 필요 없습니다) 아래 명령 중 하나를 사용하세요.",
},
},
apps: {
+1 -1
View File
@@ -269,7 +269,7 @@ export const content = {
allowlists: { title: "Hvitelister", body: "Begrens fanene til en sesjon til nettstedene du oppgir." },
},
install:
"Installer Chrome-utvidelsen først. Den guider deg gjennom resten av stegene. Vil du installere CLI-en direkte, bruk en av disse.",
"Installer [Chrome-utvidelsen] først. Den guider deg gjennom resten av stegene. Vil du installere CLI-en direkte (det skal du ikke trenge), bruk en av disse.",
},
},
apps: {
+1 -1
View File
@@ -390,7 +390,7 @@ export const content = {
},
},
install:
"Najpierw zainstaluj rozszerzenie Chrome. Przeprowadzi cię przez pozostałe kroki. Aby zainstalować CLI bezpośrednio, użyj jednego z tych poleceń.",
"Najpierw zainstaluj [rozszerzenie Chrome]. Przeprowadzi cię przez pozostałe kroki. Aby zainstalować CLI bezpośrednio (nie powinno to być potrzebne), użyj jednego z tych poleceń.",
},
},
apps: {
+1 -1
View File
@@ -269,7 +269,7 @@ export const content = {
allowlists: { title: "Списки доступа", body: "Ограничьте вкладки сессии указанными сайтами." },
},
install:
"Сначала установите расширение для Chrome. Оно проведёт вас через остальные шаги. Чтобы установить CLI напрямую, используйте любую из этих команд.",
"Сначала установите [расширение для Chrome]. Оно проведёт вас через остальные шаги. Чтобы установить CLI напрямую (обычно это не нужно), используйте любую из этих команд.",
},
},
apps: {
+1 -1
View File
@@ -235,7 +235,7 @@ export const content = {
allowlists: { title: "รายการที่อนุญาต", body: "จำกัดแท็บของเซสชันไว้เฉพาะเว็บไซต์ที่คุณระบุ" },
},
install:
"ติดตั้งส่วนขยาย Chrome ก่อน แล้วส่วนขยายจะพาคุณทำขั้นตอนที่เหลือ หากต้องการติดตั้ง CLI โดยตรง ให้ใช้คำสั่งใดคำสั่งหนึ่งต่อไปนี้",
"ติดตั้ง[ส่วนขยาย Chrome]ก่อน แล้วส่วนขยายจะพาคุณทำขั้นตอนที่เหลือ หากต้องการติดตั้ง CLI โดยตรง (ปกติไม่จำเป็น) ให้ใช้คำสั่งใดคำสั่งหนึ่งต่อไปนี้",
},
},
apps: {
+1 -1
View File
@@ -390,7 +390,7 @@ export const content = {
},
},
install:
"Önce Chrome uzantısını yükleyin. Kalan adımlarda size yol gösterir. CLI'yi doğrudan yüklemek için bunlardan birini kullanın.",
"Önce [Chrome uzantısını] yükleyin. Kalan adımlarda size yol gösterir. CLI'yi doğrudan yüklemek için (buna ihtiyacınız olmamalı) bunlardan birini kullanın.",
},
},
apps: {
+1 -1
View File
@@ -275,7 +275,7 @@ export const content = {
allowlists: { title: "Списки доступу", body: "Обмежте вкладки сесії вказаними сайтами." },
},
install:
"Спочатку встановіть розширення для Chrome. Воно проведе вас через решту кроків. Щоб установити CLI напряму, скористайтеся будь-якою з цих команд.",
"Спочатку встановіть [розширення для Chrome]. Воно проведе вас через решту кроків. Щоб установити CLI напряму (зазвичай це не потрібно), скористайтеся будь-якою з цих команд.",
},
},
apps: {
+1 -1
View File
@@ -194,7 +194,7 @@ export const content = {
allowlists: { title: "允许列表", body: "将会话的标签页限制在您指定的网站内。" },
},
install:
"请先安装 Chrome 扩展,它会引导你完成其余步骤。如需直接安装 CLI,可使用以下任一命令。",
"请先安装 [Chrome 扩展],它会引导你完成其余步骤。如需直接安装 CLI(通常不需要),可使用以下任一命令。",
},
},
apps: {
+1 -1
View File
@@ -198,7 +198,7 @@ export const content = {
allowlists: { title: "允許清單", body: "將工作階段的分頁限制在你指定的網站內。" },
},
install:
"請先安裝 Chrome 擴充功能,它會引導你完成其餘步驟。如需直接安裝 CLI,可使用以下任一指令。",
"請先安裝 [Chrome 擴充功能],它會引導你完成其餘步驟。如需直接安裝 CLI(通常不需要),可使用以下任一指令。",
},
},
apps: {
+3 -1
View File
@@ -150,7 +150,9 @@ export function extensionMarkdown(slug: ExtensionSlug) {
extension.features.map((feature) => `- **${feature.title}:** ${feature.body}`).join("\n"),
"## Install",
extension.store && `Add to Chrome from the ${link("Chrome Web Store", extension.store)}.`,
extension.install.lead,
extension.store
? extension.install.lead.replace(/\[([^\]]+)\]/g, (_, text) => link(text, extension.store!))
: extension.install.lead.replace(/\[([^\]]+)\]/g, "$1"),
extension.install.command && codeFence("bash", extension.install.command),
extension.install.commands && codeFence("bash", extension.install.commands.map((item) => item.command).join("\n")),
`Source: ${link(extension.source.replace("https://", ""), extension.source)}`,