From 6385c171fa769469c4211c01ba49b25b11eab59d Mon Sep 17 00:00:00 2001 From: Dotta <34892728+cryppadotta@users.noreply.github.com> Date: Tue, 24 Nov 2026 11:47:32 -0600 Subject: [PATCH] fix(connections): show only the privacy policy link in the Google Workspace picker (#22795) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The built-in Google Workspace connection lets agents use Gmail, Drive (with Docs, Sheets and Slides) and Calendar > - Before Google consent, the user chooses services in the "Connect Google Workspace" picker > - On Nov 17, #21998 added two text sections to this picker: "What agents can do" and "How your data is used" > - On Nov 24, the owner decided that this screen must show only the privacy policy link and no other explanatory text > - This pull request removes the two sections and keeps the privacy policy link directly under the service rows > - The benefit is a short picker that matches the owner decision, for new setup and reconnect, in the Apps flow and the task-hosted flow ## Linked Issues or Issue Description Refs #22634 **What happened?** The "Connect Google Workspace" picker shows a "What agents can do" section and a "How your data is used" section with bullet sentences. The text changes with the selected services. The owner does not want this text on the screen. **What did you expect to happen?** The picker shows the title, the three service rows (each with its access select and switch), the privacy policy link, and Cancel / Continue. It shows no other explanatory text for any selection. **Steps to reproduce** 1. Open Apps and start a Google Workspace connection, or reconnect an existing one. 2. Look at the service picker with all services on, with read only, and with one service on. 3. See the two text sections above the footer. ## What Changed - `ui/src/features/connections/GoogleWorkspaceServices.tsx`: remove the `DataUseDisclosure` block. The privacy policy link ("Read our privacy policy, including how we meet Google's Limited Use requirements", `https://paperclip.ing/privacy`, new tab) now sits directly under the service rows for every selection, including no selection. The "Select at least one service to continue." status stays. The screen-reader description "Choose the Google services to connect." stays. The URL constant `GOOGLE_WORKSPACE_PRIVACY_POLICY_URL` moves into this file. - `ui/src/features/connections/googleWorkspaceDisclosure.ts`: deleted. Nothing else used the copy builder. - `ui/src/features/connections/GoogleWorkspaceServices.test.tsx` (new; the earlier suite was removed in #22729): for all services read & write, all read only, one service, and no service, the dialog has no section headings, no lists and none of the removed sentences. The link has its text, href and new-tab target. The dialog keeps its accessible description. Continue stays disabled with no service and submits the chosen services. - `ui/storybook/stories/connection-setup/google-workspace-services.stories.tsx`: the `ProductionPickerReadOnly` play test now checks that the removed text is absent and the link is present. - Docs: `doc/memory/google-connector-memory.md` gets a dated Nov 24 decision row with the risk. `doc/plans/2026-11-17-google-workspace-production-checklist.md` no longer claims a disclosure in the picker. `doc/plans/2026-11-17-google-workspace-code-fixes.md` item 1 records the removal. The dialog now contains, from top to bottom: the Google Workspace logo and the title "Connect Google Workspace"; Gmail, Drive ("Docs, Sheets, and Slides") and Calendar rows, each with a "Read only / Read & write" select and a switch; the privacy policy link; the empty-selection status (only with no service on); Cancel and Continue in one footer row. ## Verification - Red first: the new test ran against the old picker and 4 of 5 tests failed (removed text present; link absent with no selection). After the change all 5 pass. - `cd ui && npx vitest run src/features/connections src/pages/apps/AppDetail.test.tsx src/pages/apps/AppsConnect.test.tsx`: 8 files, 55 tests pass. - `cd ui && node ../scripts/run-tsc.mjs -b`: no errors. - `node scripts/check-token-gates.mjs`: all gates clean. `node scripts/check-test-budget.mjs --files ui/src/features/connections/GoogleWorkspaceServices.test.tsx`: pass. `node scripts/storybook-catalog.mjs`: pass. - `pnpm verify` exits 2 (a global CI input changed: `doc/memory/google-connector-memory.md`). Required CI supplies the broad coverage. - Headless Playwright against Storybook dev, `ProductionPicker` at 1280x900 (dark and light) and `ProductionPickerMobile` at 375x812: the dialog text is only the title, the rows, the link, and Cancel / Continue. No horizontal scroll at 375 px. The link sits under the last row with the normal dialog gap, and the footer follows it. - Before: see the screenshots in #21998. After: the same dialog without the two text sections. ## Risks - Policy risk: Google's user data policy may expect a disclosure inside the product, before consent, that says what data the app uses and how. A privacy policy link alone may not satisfy a Google reviewer. This is a recorded owner decision. If a reviewer asks, restore a short statement above the link. The memory doc and the production checklist record this risk. - Low code risk. The change is UI-only. Selection, requested scopes, OAuth and saved state do not change. > For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and discuss it in `#dev` before opening the PR. Feature PRs that overlap with planned core work may need to be redirected — check the roadmap first. See `CONTRIBUTING.md`. ## Model Used - Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, in Claude Code with tool use (shell, file edits, headless browser). ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 --- doc/memory/google-connector-memory.md | 3 +- .../2026-11-17-google-workspace-code-fixes.md | 5 +- ...7-google-workspace-production-checklist.md | 8 +- .../GoogleWorkspaceServices.test.tsx | 81 +++++++++++++++++++ .../connections/GoogleWorkspaceServices.tsx | 31 ++----- .../connections/googleWorkspaceDisclosure.ts | 35 -------- .../google-workspace-services.stories.tsx | 12 ++- 7 files changed, 106 insertions(+), 69 deletions(-) create mode 100644 ui/src/features/connections/GoogleWorkspaceServices.test.tsx delete mode 100644 ui/src/features/connections/googleWorkspaceDisclosure.ts diff --git a/doc/memory/google-connector-memory.md b/doc/memory/google-connector-memory.md index 0b154384aff..546bd7e9a09 100644 --- a/doc/memory/google-connector-memory.md +++ b/doc/memory/google-connector-memory.md @@ -49,13 +49,14 @@ Last updated: November 23, 2026 (evening). | Nov 23 | **Security lab: TAC Security (recommended, not yet engaged)** | Google's discounted Tier 2 partner. Plan about $2,000 for year one including a retest. Confirm with a quote; Google assigns the tier. | | Nov 23 | **A tool refuses an argument it does not know** | All 36 tools fail before any request to Google and name the accepted arguments. Found live: `list_threads` ignored a filter and returned unfiltered mail. | | Nov 23 | **A cancelled or abandoned first sign-in leaves no connection** | Cancel removes the draft; a closed tab leaves a hidden draft that the next attempt reuses. Applies to every sign-in connector. | +| Nov 24 | **The service picker shows no explanatory text, only the privacy policy link** | Owner decision. This removes the in-product data-use disclosure added on Nov 17 ([#21998](https://github.com/paperclipai/paperclip/pull/21998)). Risk noted by the coordinator: Google's user data policy may expect an in-product disclosure before consent; if a reviewer asks, restore a short statement above the link. | ## What has shipped | PR | What it does | Merged commit | | --- | --- | --- | | [#21996](https://github.com/paperclipai/paperclip/pull/21996) | Plan docs: this file, the production checklist and the code-fix plan. | `12cb18e17d` | -| [#21998](https://github.com/paperclipai/paperclip/pull/21998) | Data-use disclosure in the service picker, shown just before Google consent. Every Google Workspace sign-in start goes through the picker, including four sign-in paths on the app page (Reconnect, Connect as me, Connect organization identity, dedicated-agent connect). The Gmail read & write line says Google's screen also mentions sending and that Paperclip does not send. | `b124ad0674` | +| [#21998](https://github.com/paperclipai/paperclip/pull/21998) | Data-use disclosure in the service picker, shown just before Google consent. Every Google Workspace sign-in start goes through the picker, including four sign-in paths on the app page (Reconnect, Connect as me, Connect organization identity, dedicated-agent connect). The Gmail read & write line says Google's screen also mentions sending and that Paperclip does not send. Removed on Nov 24 by owner decision (see "Decisions"); the picker keeps the privacy policy link. | `b124ad0674` | | [#21999](https://github.com/paperclipai/paperclip/pull/21999) | Prompt-injection screening now also covers resource reads through a named gateway, the one path that was not screened. Applies to every connector, not only Google. | `65eac24876` | | [#22001](https://github.com/paperclipai/paperclip/pull/22001) | Scope lock. `GOOGLE_WORKSPACE_SUBMITTED_SCOPES` is the hand-written list of 14, and `workspace.all` uses it. Paperclip-managed Google methods outside the 14 (Gmail archive, Chat, People, Workspace Search) are no longer offered for new setup or reconnect through Paperclip's Google app; saved ones keep refreshing and running. | `66ac5d7aa0` | | [#22000](https://github.com/paperclipai/paperclip/pull/22000) | REST tool set part 1: the folder `server/src/google-workspace-rest-tools/` with Gmail `get_message`, `search_threads` and `create_draft`. Nothing calls it yet; the switch comes in a later PR. | `a29658b5b7` | diff --git a/doc/plans/2026-11-17-google-workspace-code-fixes.md b/doc/plans/2026-11-17-google-workspace-code-fixes.md index 3c1a1dc698b..d646d262a39 100644 --- a/doc/plans/2026-11-17-google-workspace-code-fixes.md +++ b/doc/plans/2026-11-17-google-workspace-code-fixes.md @@ -17,7 +17,7 @@ change in fix 2, the deploy order is app first, then broker (see fix 10). | # | Fix | Size | Blocks submission | Status | | --- | --- | --- | --- | --- | -| 1 | Data-use disclosure in the picker | Small | Yes | Done, [#21998](https://github.com/paperclipai/paperclip/pull/21998) | +| 1 | Data-use disclosure in the picker | Small | Yes | Done, [#21998](https://github.com/paperclipai/paperclip/pull/21998); removed Nov 24 by owner decision | | 2 | Lock the managed scope set to 14 | Small to medium | Yes | Done in the app, [#22001](https://github.com/paperclipai/paperclip/pull/22001) | | 3 | Take `gmail.modify` off the Paperclip-managed client | Small | Yes | Done, [#22001](https://github.com/paperclipai/paperclip/pull/22001) | | 4 | Confirm injection screening on Google results | Check, then small | Yes | Done, [#21999](https://github.com/paperclipai/paperclip/pull/21999) | @@ -36,6 +36,9 @@ four sign-in paths on the app page. The Gmail read & write line says Google's screen also mentions sending and that Paperclip does not send. The plan below is kept for reference. +**Removed** (Nov 24) by owner decision. The picker keeps only the privacy +policy link, which names Google's Limited Use requirements. + **Confirmed gap.** `ServicePicker` in `ui/src/features/connections/GoogleWorkspaceServices.tsx` shows three service rows and Cancel / Continue. Its only description is screen-reader text. Google diff --git a/doc/plans/2026-11-17-google-workspace-production-checklist.md b/doc/plans/2026-11-17-google-workspace-production-checklist.md index 081a87de2d5..9fed8d06fc2 100644 --- a/doc/plans/2026-11-17-google-workspace-production-checklist.md +++ b/doc/plans/2026-11-17-google-workspace-production-checklist.md @@ -59,8 +59,12 @@ Decisions and the details behind them are kept in the ## 2. Product and code (see the code-fix plan) -- [x] Data-use disclosure shown in the picker immediately before Google consent - (Nov 17, [#21998](https://github.com/paperclipai/paperclip/pull/21998)). +- [ ] Data-use disclosure in the picker immediately before Google consent. + Added Nov 17 ([#21998](https://github.com/paperclipai/paperclip/pull/21998)), + then removed on Nov 24 by owner decision. The picker now shows only the + service rows and a link to the privacy policy and its Limited Use + statement. If a Google reviewer asks for an in-product disclosure, + restore a short statement above the link. - [ ] Limited Use statement published and linked from the picker. - [x] Help page: how to disconnect and how to delete stored Google data (Nov 17, [#22010](https://github.com/paperclipai/paperclip/pull/22010): diff --git a/ui/src/features/connections/GoogleWorkspaceServices.test.tsx b/ui/src/features/connections/GoogleWorkspaceServices.test.tsx new file mode 100644 index 00000000000..94af67a8922 --- /dev/null +++ b/ui/src/features/connections/GoogleWorkspaceServices.test.tsx @@ -0,0 +1,81 @@ +// @vitest-environment jsdom +import { act } from "react"; +import { createRoot, type Root } from "react-dom/client"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import type { GoogleWorkspaceServiceSelection } from "@paperclipai/shared"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { GoogleWorkspaceServicesDialog } from "./GoogleWorkspaceServices"; + +vi.mock("@/api/tools", () => ({ toolsApi: { listConnectionGrants: vi.fn() } })); +vi.mock("@/pages/apps/AppLogo", () => ({ AppLogo: () => null })); + +const removedText = [ + "What agents can do", + "How your data is used", + "agents can read and search your email", + "agents can read and search your files", + "agents can see your calendars", + "Paperclip does not send email", + "Agents read this content only to do the tasks you give them.", + "sent to the AI model provider configured for your workspace", + "It is not used to train general AI models.", + "Results are saved in the task and its run history", +]; + +describe("Google Workspace service picker", () => { + let root: Root; + let container: HTMLDivElement; + let client: QueryClient; + const onContinue = vi.fn(); + + async function render(initial?: GoogleWorkspaceServiceSelection) { + await act(async () => { root.render( + + ); }); + } + + beforeEach(() => { + vi.clearAllMocks(); + container = document.createElement("div"); + document.body.append(container); + root = createRoot(container); + client = new QueryClient(); + }); + afterEach(async () => { + await act(async () => { root.unmount(); }); + client.clear(); + container.remove(); + }); + + it.each<[string, GoogleWorkspaceServiceSelection | undefined]>([ + ["all services with read & write", undefined], + ["all services read only", { gmail: "read", drive: "read", calendar: "read" }], + ["a single service", { calendar: "write" }], + ["no services", {}], + ])("shows only the service rows and the privacy policy link for %s", async (_label, initial) => { + await render(initial); + const dialog = document.querySelector('[role="dialog"]')!; + for (const text of removedText) expect(dialog.textContent).not.toContain(text); + expect(dialog.querySelector("h3")).toBeNull(); + expect(dialog.querySelector("ul")).toBeNull(); + expect(document.querySelectorAll('[role="switch"]')).toHaveLength(3); + const link = [...dialog.querySelectorAll("a")].find(item => item.textContent?.includes("Limited Use"))!; + expect(link.textContent).toBe("Read our privacy policy, including how we meet Google's Limited Use requirements (opens in a new tab)"); + expect(link.getAttribute("href")).toBe("https://paperclip.ing/privacy"); + expect(link.getAttribute("target")).toBe("_blank"); + const description = document.getElementById(dialog.getAttribute("aria-describedby") ?? ""); + expect(description?.textContent).toBe("Choose the Google services to connect."); + }); + + it("keeps Continue disabled with no services and submits the chosen services", async () => { + await render({}); + const disabled = [...document.querySelectorAll("button")].find(item => item.textContent === "Continue")!; + expect(disabled.disabled).toBe(true); + expect(document.querySelector('[role="status"]')?.textContent).toBe("Select at least one service to continue."); + await act(async () => { root.unmount(); }); + root = createRoot(container); + await render({ gmail: "read" }); + await act(async () => { [...document.querySelectorAll("button")].find(item => item.textContent === "Continue")!.click(); }); + expect(onContinue).toHaveBeenCalledWith({ gmail: "read" }); + }); +}); diff --git a/ui/src/features/connections/GoogleWorkspaceServices.tsx b/ui/src/features/connections/GoogleWorkspaceServices.tsx index e3c3ddf00f9..35052237688 100644 --- a/ui/src/features/connections/GoogleWorkspaceServices.tsx +++ b/ui/src/features/connections/GoogleWorkspaceServices.tsx @@ -8,10 +8,11 @@ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } f import { NativeSelect } from "@/components/ui/select"; import { ToggleSwitch } from "@/components/ui/toggle-switch"; import { AppLogo } from "@/pages/apps/AppLogo"; -import { GOOGLE_WORKSPACE_PRIVACY_POLICY_URL, googleWorkspaceDataUseDisclosure } from "./googleWorkspaceDisclosure"; import { ANALYTICS_MASK_CLASS } from "@/lib/analytics/privacy"; import { cn } from "@/lib/utils"; +export const GOOGLE_WORKSPACE_PRIVACY_POLICY_URL = "https://paperclip.ing/privacy"; + export function GoogleWorkspaceServiceFields({ value, onChange }: { value: GoogleWorkspaceServiceSelection; onChange: (value: GoogleWorkspaceServiceSelection) => void; @@ -100,25 +101,6 @@ export function GoogleWorkspaceServicesDialog(props: DialogProps) { return ; } -function DataUseDisclosure({ selection }: { selection: GoogleWorkspaceServiceSelection }) { - const { access, use } = googleWorkspaceDataUseDisclosure(selection); - return
-
-

What agents can do

-
    {access.map(line =>
  • {line}
  • )}
-
-
-

How your data is used

-
    {use.map(line =>
  • {line}
  • )}
-
-

- - Read our privacy policy, including how we meet Google's Limited Use requirements (opens in a new tab) - -

-
; -} - function ServicePicker({ onContinue, onCancel, initial = GOOGLE_WORKSPACE_DEFAULT_SELECTION }: DialogProps) { const [selection, setSelection] = useState(initial); const empty = Object.keys(selection).length === 0; @@ -129,9 +111,12 @@ function ServicePicker({ onContinue, onCancel, initial = GOOGLE_WORKSPACE_DEFAUL Choose the Google services to connect. - {empty - ?

Select at least one service to continue.

- : } +

+ + Read our privacy policy, including how we meet Google's Limited Use requirements (opens in a new tab) + +

+ {empty &&

Select at least one service to continue.

}