Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

fix(kb): let the Drive picker offer Excel, CSV and Sheets files

merged#2930CedarCopilot

CedarCopilot wants to merge 2 commits into staging from worktree-send-it-drive-picker-excel

Customer behavior verdict

Libra found a regression: Picking an already linked Drive file does not create another entry.

Who this touches

  • The Drive picker offers native and uploaded spreadsheet formats: no production calls in the last 7 days.
  • Linked spreadsheets appear with spreadsheet icons and usable viewer links: no production calls in the last 7 days.
  • Existing Docs and Slides links retain their type-specific destinations: no production calls in the last 7 days.
  • Picking an already linked Drive file does not create another entry: no production calls in the last 7 days.
  • Existing Docs and Slides links retain their type-specific destinations: This scenario failed on both revisions. Libra has not established whether the cause is existing behavior or the scenario itself.
  • Picking an already linked Drive file does not create another entry: This scenario failed on this PR and passed on the base revision.
  • Linked spreadsheets appear with spreadsheet icons and usable viewer links: Held on this PR; the scenario fails when this is broken on purpose.

What Libra verified

  • Linked spreadsheets appear with spreadsheet icons and usable viewer links

    Libra ran this behavior against the change and confirmed the check detects when it breaks.

    Technical evidence
    • linked native Sheets and XLSX files remain visible with spreadsheet icons and their correct viewer links

    Changed code: google-slides-manager.tsx.

Live on prod, watching, 2 days leftTimeline and evidence
  1. Opened
    Sep 24, 2026, 10:26 AM
  2. Sep 24, 2026, 10:42 AM
  3. Merged
    Sep 24, 2026, 12:14 PM
  4. Live on prod
    Sep 24, 2026, 12:14 PM
  5. Observed 1 hour
    Sep 24, 2026, 12:14 PM
  6. Watching

    Live on prod, watching, 2 days left

    Sep 24, 2026, 12:14 PM
  7. Pipelines steady after this deploy
    Sep 24, 2026, 12:14 PM

Behaviors Libra is checking

Linked native Google Sheets files open through the Google Sheets viewer URL instead of the generic Drive file URL.Not checked
prod
The knowledge-base Google Drive picker lets users select native Google Sheets, Excel .xlsx/.xls, and CSV files in addition to Google Docs and Slides.Not checked
prod

Libra has verdicts on 0 of 2 tracked behaviors on prod; 2 are still being checked. Libra checks hourly for 3 days after each deploy.

Summary

  • The knowledge-base Drive picker only listed Slides and Docs, so Excel files could not be selected. An .xlsx in Drive is spreadsheetml.sheet, not the native Sheets type, so it needs its own entry.
  • Extend the shared KB_DRIVE_MIMES (native Sheets, .xlsx, .xls, .csv). Both the settings manager and the in-chat request-file card use it, so a file picked in one place shows in the other.
  • Spreadsheet rows get their own icon and the Sheets viewer URL; the "Docs and Slides" copy is now "Google Drive files".
  • Not in this PR: the agent can link these files but has no read path for non-native spreadsheets yet (readDocumentTool only builds a viewer URL).

Test plan

  • pnpm run autofix:local , all green except chatHistoryList.test.ts (date-bucket assertion in code this PR does not touch)
  • apps/mail/tests/modules/integrations/useGooglePicker.test.ts (new) , list contents, comma-joined setMimeTypes, viewer URL per type; passes alongside requestDriveFileRenderer.test.tsx
  • Three fresh-subagent thermo reviews; findings fixed or justified

Verify in prod

No new server behavior or logging: this is a client-side constant change, so there is no Axiom/CloudWatch signal.

  • Working: Settings > Connections > Google Drive > add file shows .xlsx/.csv/Sheets alongside Docs and Slides, and a picked .xlsx appears in the linked list with a spreadsheet icon.
  • Regression: only Docs and Slides are selectable, or an added Excel file saves but does not appear in the list.

🤖 Generated with Claude Code

RetriggerConfidence Score: 4/5

The behavior appears safe to merge, but the changed import must satisfy the repository’s explicit absolute-import requirement first.

Findings

  1. P2 Relative import violates guidance ▶
Fix with agent prompt
### Issue 1
apps/mail/modules/integrations/google-slides-manager.tsx:12-18
The expanded picker import adds `SPREADSHEET_MIMES` and `driveFileUrl` through `./use-google-picker`, but the repository requires absolute imports. This requirement must be satisfied before merging.

```suggestion
import {
  KB_DRIVE_MIMES,
  MIME_PRESENTATION,
  SPREADSHEET_MIMES,
  driveFileUrl,
  useGooglePicker,
} from '@/modules/integrations/use-google-picker';
```

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR expands the shared knowledge-base Drive picker MIME list to include native Sheets, Excel and CSV files. It also adds spreadsheet icons and viewer URLs, updates the settings copy, and adds picker tests.

Reviews (1) · Last reviewed commit: "Merge origin/staging"

Show production surfaces and changed-file mapping

Production surfaces

Libra has not measured any production surfaces for this change yet.

Changed files → surfaces

  • apps/mail/modules/cedar-os/__tests__/requestDriveFileRenderer.test.tsxno production surface mapped
  • apps/mail/modules/integrations/google-slides-manager.tsxno production surface mapped
  • apps/mail/modules/integrations/use-google-picker.tsno production surface mapped
  • apps/mail/tests/modules/integrations/useGooglePicker.test.tsno production surface mapped