feat(office-viewer): consent gate with Allow / Download buttons#897
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.