Skip to content

feat(office-viewer): consent gate with Allow / Download buttons#897

Merged
harshithmullapudi merged 1 commit into
mainfrom
feat/chat-attachments
Jun 8, 2026
Merged

feat(office-viewer): consent gate with Allow / Download buttons#897
harshithmullapudi merged 1 commit into
mainfrom
feat/chat-attachments

Conversation

@harshithmullapudi

Copy link
Copy Markdown
Member

The Office Online preview ships file bytes to Microsoft's servers during render. Make that an explicit choice instead of an automatic side-effect of opening a .pptx/.docx/.xlsx:

  • On open, show a consent card naming the file and explaining that Allow hands a short-lived signed URL to Microsoft Office Online.
  • "Allow" mints the signed URL and embeds the iframe as before.
  • "Download" hits the existing session-gated /fs/download route, so nothing touches Microsoft.
  • Asked every time — no sessionStorage memory yet. When "remember this" is needed, do it as a workspace setting.

Also fix the iframe sizing: the library's inner #react-doc-viewer / #proxy-renderer / #msdoc-renderer / #msdoc-iframe don't inherit the style={{ height: '100%' }} prop. Force them with scoped CSS so the preview fills the host instead of collapsing to a small box.

Download uses a plain with buttonVariants() rather than — this codebase's Button always emits a leading slot ({isLoading ? : <></>}) alongside children, which violates Radix Slot's React.Children.only.

The Office Online preview ships file bytes to Microsoft's servers
during render. Make that an explicit choice instead of an automatic
side-effect of opening a .pptx/.docx/.xlsx:

- On open, show a consent card naming the file and explaining that
  Allow hands a short-lived signed URL to Microsoft Office Online.
- "Allow" mints the signed URL and embeds the iframe as before.
- "Download" hits the existing session-gated /fs/download route, so
  nothing touches Microsoft.
- Asked every time — no sessionStorage memory yet. When "remember
  this" is needed, do it as a workspace setting.

Also fix the iframe sizing: the library's inner #react-doc-viewer /
#proxy-renderer / #msdoc-renderer / #msdoc-iframe don't inherit the
style={{ height: '100%' }} prop. Force them with scoped CSS so the
preview fills the host instead of collapsing to a small box.

Download uses a plain <a> with buttonVariants() rather than
<Button asChild> — this codebase's Button always emits a leading
slot ({isLoading ? <Loader/> : <></>}) alongside children, which
violates Radix Slot's React.Children.only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@harshithmullapudi harshithmullapudi merged commit a82cc03 into main Jun 8, 2026
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