Summary
Add an option to control whether the download button is shown when previewing a file from inside an archive.
Background
The archive renderer currently lets users open supported entries and preview them inline. Some enterprise deployments need finer-grained control over actions exposed for nested archive entries, especially when the outer archive can be viewed but extracted content should not always be downloadable.
Proposed behavior
- Provide a documented option to show or hide the download button for archive entries.
- Keep the top-level viewer download behavior independent from nested archive entry behavior.
- Support a global boolean as the simple path, and consider a callback/policy hook for per-entry decisions.
- Ensure the state is reflected consistently in the archive preview header and any compact/mobile toolbar.
Suggested API shape
const viewer = createFileViewer(container, {
archive: {
entryActions: {
download: false,
},
},
})
A callback form may be useful for enterprise policies:
archive: {
entryActions: {
download(entry) {
return entry.path.startsWith('public/')
},
},
}
Acceptance criteria
- Consumers can hide the nested file download button without disabling the viewer-level download action.
- The option works for archive entries previewed through the archive renderer.
- The default behavior remains backward-compatible.
- Documentation and demo examples mention the option.
- A focused harness or smoke case verifies both visible and hidden states.
Summary
Add an option to control whether the download button is shown when previewing a file from inside an archive.
Background
The archive renderer currently lets users open supported entries and preview them inline. Some enterprise deployments need finer-grained control over actions exposed for nested archive entries, especially when the outer archive can be viewed but extracted content should not always be downloadable.
Proposed behavior
Suggested API shape
A callback form may be useful for enterprise policies:
Acceptance criteria