Skip to content

Fix broken binary preview for KNOWN_BINARY_TYPES - #470

Merged
Bohreromir merged 1 commit into
mainfrom
fix/preview-binary-fallback
Nov 13, 2026
Merged

Bohreromir merged 1 commit into
mainfrom
fix/preview-binary-fallback

Conversation

@Bohreromir

Copy link
Copy Markdown
Member

Description

For content types in KNOWN_BINARY_TYPES the preview endpoint returns an empty body with X-Preview-Renderable: false. The preview modal ignored that header, decoded the empty body as valid UTF-8 and showed an empty, read-only text editor instead of the binary fallback.

Check the header right after the 7z/rar checks and show the fallback. The unit test mock now sends the real binaryPreview() headers, and an E2E test covers an application/avro object.

Docs

Release note

Checklist

Author

  • AI review done, findings addressed
  • Tests added or updated
  • Changelog updated (if the repo keeps one)

Reviewer

  • Useful comments and logging
  • Docs added or updated per the style guide

Acceptance

  • Check for release notes and docs

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 67.58% 9259 / 13699
🔵 Statements 66.52% 12443 / 18705
🔵 Functions 68.34% 2982 / 4363
🔵 Branches 57.47% 5214 / 9071
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/lib/components/storage/modals/PreviewModal.svelte 74.35% 65.39% 80.19% 71.01% 152, 162, 164, 168, 180, 213-218, 262-264, 308, 339-350, 356, 432, 453-545, 549, 553-555, 563, 579-580, 599-615, 623-640, 646-647, 653, 673-701, 729-731, 755-759, 754, 769, 768, 728, 799, 841, 840, 837, 940-945, 952-953, 939, 1027-1024
Generated in workflow #1299 for commit 7221c29 by the Vitest Coverage Report Action

…not renderable

For content types in KNOWN_BINARY_TYPES the preview endpoint returns an
empty body with X-Preview-Renderable: false. The preview modal ignored
that header, decoded the empty body as valid UTF-8 and showed an empty,
read-only text editor instead of the binary fallback.

Check the header right after the 7z/rar checks and show the fallback.
The unit test mock now sends the real binaryPreview() headers, and an
E2E test covers an application/avro object.
@Bohreromir
Bohreromir force-pushed the fix/preview-binary-fallback branch from 4e7c408 to 7221c29 Compare November 12, 2026 14:21
@Bohreromir Bohreromir moved this to Development: Waiting for Review in Stackable Engineering Nov 12, 2026
@Bohreromir
Bohreromir marked this pull request as ready for review November 12, 2026 14:23
@lfrancke lfrancke moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Nov 12, 2026
@Bohreromir
Bohreromir added this pull request to the merge queue Nov 13, 2026
@Bohreromir Bohreromir moved this from Development: In Review to Development: Done in Stackable Engineering Nov 13, 2026
Merged via the queue into main with commit 34d3854 Nov 13, 2026
12 checks passed
@Bohreromir
Bohreromir deleted the fix/preview-binary-fallback branch November 13, 2026 09:04
Bohreromir added a commit to stackabletech/cockpit-clickdummy-demo that referenced this pull request Nov 13, 2026
The fake preview endpoint now answers like the server's binaryPreview()
for binary fixtures with a content type (e.g. the gzip clickstream
file),
so the demo exercises the X-Preview-Renderable: false fallback from
stackabletech#470.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: Done

Development

Successfully merging this pull request may close these issues.

2 participants