Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
feat(connectors): show one beta badge on the Connectors title instead of every row (#2884)
Joshua305de6847e6f
diff --git a/src/components/ConnectorsSection.tsx b/src/components/ConnectorsSection.tsxindex 677f15c05..25df44990 100644--- a/src/components/ConnectorsSection.tsx+++ b/src/components/ConnectorsSection.tsx@@ -4,7 +4,6 @@ import { Lock, Mail } from "./icons";import { SettingsPanel, SettingsPanelRow } from "./ui/SettingsSection";import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./ui/select";import { ConnectorLoginRow } from "./connectors/ConnectorLoginRow";-import { BetaBadge } from "./connectors/BetaBadge";import { CONNECTOR_ROWS } from "./connectors/connectorRows";import { UpsellBar } from "./integrations/IntegrationsPane";import { useSettingsStore } from "../stores/settingsStore";@@ -77,12 +76,7 @@ export function ConnectorsSection({ onUpgrade }: ConnectorsSectionProps): ReactE<Mail className="h-4 w-4 text-primary/80" strokeWidth={2} aria-hidden="true" /></div><div className="flex-1 basis-52 min-w-0">- <div className="flex items-center gap-1.5">- <p className="text-xs font-semibold text-foreground">- {t("connectors.email.title")}- </p>- <BetaBadge />- </div>+ <p className="text-xs font-semibold text-foreground">{t("connectors.email.title")}</p><p className="text-xs text-muted-foreground/70 mt-0.5 leading-relaxed">{description}</p>diff --git a/src/components/IntegrationsView.tsx b/src/components/IntegrationsView.tsxindex e99e0b051..acce0092a 100644--- a/src/components/IntegrationsView.tsx+++ b/src/components/IntegrationsView.tsx@@ -8,6 +8,7 @@ import { ensureConnectorStatus, useConnectorStatusStore } from "../stores/connecimport { useConnectorAccess } from "../hooks/useConnectorAccess";import ApiKeysSection from "./ApiKeysSection";import { ConnectorsSection } from "./ConnectorsSection";+import { BetaBadge } from "./connectors/BetaBadge";import { CONNECTOR_ROWS } from "./connectors/connectorRows";import { IntegrationsNav } from "./integrations/IntegrationsNav";import { IntegrationsPane, UpsellBar } from "./integrations/IntegrationsPane";@@ -104,6 +105,7 @@ export default function IntegrationsView({connectors: (<IntegrationsPanetitle={titleOf("connectors")}+ titleBadge={<BetaBadge />}description={t("integrations.connectors.description")}><ConnectorsSection onUpgrade={onUpgrade} />diff --git a/src/components/connectors/BetaBadge.tsx b/src/components/connectors/BetaBadge.tsxindex 6239cc375..a2a735d63 100644--- a/src/components/connectors/BetaBadge.tsx+++ b/src/components/connectors/BetaBadge.tsx@@ -2,7 +2,7 @@ import type { ReactElement } from "react";import { useTranslation } from "react-i18next";import { Badge } from "../ui/badge";-/** The pill beside every connector's name while connectors are in beta. */+/** The pill beside the Connectors title while connectors are in beta. */export function BetaBadge(): ReactElement {const { t } = useTranslation();return (diff --git a/src/components/connectors/ConnectorLoginRow.tsx b/src/components/connectors/ConnectorLoginRow.tsxindex dd2ec73aa..4757e7461 100644--- a/src/components/connectors/ConnectorLoginRow.tsx+++ b/src/components/connectors/ConnectorLoginRow.tsx@@ -3,7 +3,6 @@ import { useTranslation } from "react-i18next";import { Lock } from "../icons";import { Button } from "../ui/button";import { SettingsPanelRow } from "../ui/SettingsSection";-import { BetaBadge } from "./BetaBadge";import { ensureConnectorStatus, useConnectorStatusStore } from "../../stores/connectorStatusStore";import type { ConnectorRowSpec } from "./connectorRows";@@ -223,10 +222,7 @@ export function ConnectorLoginRow({</div><div className="flex-1 min-w-0"><div className={dimmed}>- <div className="flex items-center gap-1.5">- <p className="text-xs font-semibold text-foreground">{copy("title")}</p>- <BetaBadge />- </div>+ <p className="text-xs font-semibold text-foreground">{copy("title")}</p><p className="text-xs text-muted-foreground/70 mt-0.5 leading-relaxed" dir="auto">{summary}</p>diff --git a/src/components/integrations/IntegrationsPane.tsx b/src/components/integrations/IntegrationsPane.tsxindex df1deb9de..1115a8f91 100644--- a/src/components/integrations/IntegrationsPane.tsx+++ b/src/components/integrations/IntegrationsPane.tsx@@ -5,6 +5,8 @@ import { Button } from "../ui/button";interface IntegrationsPaneProps {title: string;+ /** Shown beside the title, e.g. a beta pill. */+ titleBadge?: ReactNode;description: ReactNode;docsUrl?: string;actions?: ReactNode;@@ -14,6 +16,7 @@ interface IntegrationsPaneProps {/** One Integrations section: a header with its actions, then the section's content. */export function IntegrationsPane({title,+ titleBadge,description,actions,docsUrl,@@ -26,9 +29,12 @@ export function IntegrationsPane({<div className="flex flex-wrap items-start gap-x-4 gap-y-2"><div className="flex-1 basis-60 min-w-0">{/* Focusable so a link that opens another section can move focus here. */}- <h2 tabIndex={-1} className="text-base text-foreground outline-none">- {title}- </h2>+ <div className="flex items-center gap-2">+ <h2 tabIndex={-1} className="text-base text-foreground outline-none">+ {title}+ </h2>+ {titleBadge}+ </div><p className="text-xs text-muted-foreground/80 mt-1 leading-relaxed">{description}</p></div>{(docsUrl || actions) && (diff --git a/test/components/connectorsSection.test.js b/test/components/connectorsSection.test.jsindex b6fdd15e2..4614ec371 100644--- a/test/components/connectorsSection.test.js+++ b/test/components/connectorsSection.test.js@@ -280,8 +280,8 @@ test("free users with no login see a single View plans and no Connect", async (tconst none = await renderSection(t, { isPaid: false, blocked: false });assert.equal(count(none.textContent, /integrations\.api\.viewPlans/g), 1);assert.equal(buttonWithText(none, "connectors.slack.connect"), null);- // Every connector is still listed, each marked beta: email, Gmail, Slack, Linear and GitHub.- assert.equal(count(none.textContent, /connectors\.beta/g), 5);+ // The beta badge sits on the Connectors title, not on each row.+ assert.doesNotMatch(none.textContent, /connectors\.beta/);});test("free users can always disconnect a login they have", async (t) => {diff --git a/test/components/gmailConnectorRow.test.js b/test/components/gmailConnectorRow.test.jsindex 73addb791..42ddaa636 100644--- a/test/components/gmailConnectorRow.test.js+++ b/test/components/gmailConnectorRow.test.js@@ -230,7 +230,6 @@ test("a free plan can still disconnect a Gmail login it has", async (t) => {test("a free plan without a login still sees what Gmail does, with no button", async (t) => {const container = await renderGmailRow(t, { status: DISCONNECTED, isPaid: false });assert.match(container.textContent, /connectors\.gmail\.description/);- assert.match(container.textContent, /connectors\.beta/);assert.equal(hasButton(container, "integrations.api.viewPlans"), false);assert.equal(hasButton(container, "connectors.gmail.connect"), false);});diff --git a/test/components/integrationsView.test.js b/test/components/integrationsView.test.jsindex 2a91c967f..1e00a1589 100644--- a/test/components/integrationsView.test.js+++ b/test/components/integrationsView.test.js@@ -237,6 +237,16 @@ test("a section keeps its state while another one is open", async (t) => {assert.match(shownText(container), /CONNECTORS SECTION/);});+test("the Connectors title carries the one beta badge; other sections carry none", async (t) => {+ const { container } = await renderView(t);+ const titleRow = heading(container, "integrations.nav.sections.connectors").parentNode;+ assert.match(titleRow.textContent, /connectors\.beta/);+ assert.equal(shownText(container).match(/connectors\.beta/g).length, 1);++ await React.act(async () => click(navButton(container, "api")));+ assert.doesNotMatch(shownText(container), /connectors\.beta/);+});+test("Calendars stays mounted from any section, so its listeners keep the nav count fresh", async (t) => {const { container } = await renderView(t, { section: "api" });@@ -375,7 +385,8 @@ test("API, MCP and CLI use one docs label and open their own documentation", asy["cli", "https://docs.openwhispr.com/cli/install"],]) {await React.act(async () => click(navButton(container, section)));- const pane = heading(container, `integrations.nav.sections.${section}`).parentNode.parentNode;+ const pane = heading(container, `integrations.nav.sections.${section}`).parentNode.parentNode+ .parentNode;await React.act(async () => click(buttonWithText(pane, "integrations.readDocs")));assert.equal(openedUrls.at(-1), url);}