Skip to content

Keep image review downloads and external opens distinct - #144

Draft
zrmarley wants to merge 1 commit into
mainfrom
zmarley/bot-1930-image-save-policy
Draft

zrmarley wants to merge 1 commit into
mainfrom
zmarley/bot-1930-image-save-policy

Conversation

@zrmarley

@zrmarley zrmarley commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Keeps proxied relay image review sources on the existing Download image path.
  • Routes direct HTTPS image review sources through the shared host onOpenLink plumbing and labels them Open image in browser instead of presenting them as downloads.
  • Extracts the existing attachment source policy so file attachments and the image review viewer share the same proxy-vs-external decision.

Linear: https://linear.app/squareup/issue/BOT-1930/view-images-and-galleries

Source-derived risk

  • This is a narrow policy/wiring fix, not full gallery validation.
  • Download image for relay proxy media and external Open image in browser intentionally remain distinct shared-policy cases.
  • ChannelsPage.openLink can return false for ordinary HTTPS by design, so this PR does not claim verified native system-browser external opener behavior. The _blank fallback attributes are established; real browser/package navigation remains pending.
  • BOT-1930 remains incomplete for package protected read/native saving work tracked with BOT-2016/BOT-1884. Copy image work is separate in BOT-2022.

Design notes

  • Read ~/goose artifacts/buzz-design-system-pack/AGENTS.md, DESIGN.md, and components/registry.json; IconButton is listed with status proposed.
  • Reuses the existing repo IconButton and the Phosphor gateway export for the existing ArrowSquareOutIcon.
  • No new visual tokens, styles, media files, screenshots, recordings, assets, media/binary fixtures, or downloads were added. tests/fixtures/messages.tsx changed only as code fixture data.
  • This follows the existing repository icon policy; the registry/IconButton packaging design conflict remains noted, not changed here.

Tests

  • bin/pnpm typecheck
  • bin/pnpm exec biome check --error-on-warnings src/bundled/channels/ChannelsPage.tsx src/features/messages/FileAttachment.tsx src/features/messages/ImageReviewStage.tsx src/features/messages/MediaReviewViewer.tsx src/features/messages/attachment-source.ts src/features/messages/MediaReviewViewer.test.tsx src/features/messages/icon-labels.test.tsx tests/fixtures/messages.tsx
  • bin/pnpm exec vitest run src/features/messages/MediaReviewViewer.test.tsx src/features/messages/icon-labels.test.tsx — 2 files, 10 tests
  • bin/pnpm design:check
  • Push hook: TypeScript plus related Vitest selection — 17 files, 220 tests; design-system guards passed
  • Slopaganda Panda review: PASS, 2/10 smell, no blockers

Deferred / not verified

  • No browser cases were added or removed. The changed contract is covered at the colocated React Testing Library layer because it is component policy/wiring and semantic DOM behavior.
  • The only verified end-to-end claim here is the RTL viewer path from media review source policy to host opener callback.
  • Real browser navigation, decode/download behavior, packaged/native opener behavior, screenshots/media artifacts, native tests, and a full just scan are deferred pending explicit approval.

Signed-off-by: Zach Marley <zmarley@squareup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant