feat(catalog): Frontend companion to the preview/lambda feature PR #4936#4937
Closed
Austin-s-h wants to merge 23 commits into
Closed
feat(catalog): Frontend companion to the preview/lambda feature PR #4936#4937Austin-s-h wants to merge 23 commits into
Austin-s-h wants to merge 23 commits into
Conversation
Frontend companion to the preview/lambda feature PR. * FCS: render Vega-Lite scatter when the preview emits a vegaLite spec (loaders/Fcs, renderers/Fcs) + specs. * Video/transcode: request webm transcode for video previews (loaders/Video). * PDF: pre-sign the URL, raise preview resolution, wrap errors in PreviewError, fix an infinite re-render loop (loaders/Pdf, renderers/Pdf) + specs. * TextFallback: new loader/renderer with a binary-sniff text fallback (loaders/Text, loaders/TextFallback) + specs. * Perspective/h5ad: surface error / matrix_preview fields (renderers/Perspective, types.js). * Crash isolation: error boundaries around the file preview view and Summarize (File.jsx, Summarize.tsx) + specs. * usePreview/Pdf: pre-compute the signed URL with useMemoEq instead of signing inside the loader (loaders/utils.js). Verified: prettier + eslint clean; vitest 84 passed across the changed and new spec files. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feat/preview-lambda-features #4937 +/- ##
================================================================
+ Coverage 46.95% 47.74% +0.79%
================================================================
Files 833 819 -14
Lines 34383 34123 -260
Branches 5834 5780 -54
================================================================
+ Hits 16145 16293 +148
+ Misses 16239 15859 -380
+ Partials 1999 1971 -28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4 tasks
…ting
- Pdf.js: re-throw the raw error instead of pre-building
PreviewError.Unexpected with retry: null. The pre-built error passed through
useErrorHandling's R.unless(PreviewError.is, …) unchanged, so transient
failures (timeouts, temporary 5xx) lost their retry button. Re-throwing lets
useErrorHandling attach data.fetch as the retry handler (original behavior).
- Text.js: throw PreviewError.Unexpected when info is null/undefined before
destructuring it, so a { info: null } envelope shows the clean custom message
instead of a raw TypeError caught by R.tryCatch.
- Apply prettier 3.4.2 formatting to Perspective.tsx and Search/Table/Table.tsx
(flagged by CI's prettier --check), unblocking test-catalog.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The File/ErrorBoundary test helper threw without a return annotation, so TS inferred `void` and the production build (ForkTsCheckerWebpackPlugin, which type-checks spec files too) rejected it with TS2786 "cannot be used as a JSX component". Annotate it `: never`, matching the working sibling helper in Summarize.ErrorBoundary.spec.tsx. (The requests.spec.ts CI failure was a transient flake — the test passes reliably under CI-matched deps; no change needed there.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The test waited with waitForValueToChange(() => result.current), which only
resolves on a reference change. The tuple ref could update while
result.current[0] was still undefined, so the immediate toBeNull() assertion
raced and failed intermittently in CI ("expected undefined to be null").
Poll with waitFor(() => expect(result.current[0]).toBeNull()) instead, which
settles deterministically regardless of timing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Austin-s-h
force-pushed
the
feat/preview-lambda-features
branch
from
June 2, 2026 17:41
0c1aab6 to
7362800
Compare
…into feat/preview-frontend
Austin-s-h
force-pushed
the
feat/preview-frontend
branch
from
June 2, 2026 17:41
b4f7405 to
6231088
Compare
2 tasks
preview.py was migrated from fcsparser to flowio for FCS parsing, but the `preview` optional-dependency in lambdas/shared/pyproject.toml still pinned `fcsparser~=0.2.1`. CI installs deps from the lockfiles, so `import flowio` raised ModuleNotFoundError and every FCS code path fell through to the "Unable to parse data or metadata" fallback — failing test_fcs in the shared, indexer, and preview lambda suites. Swap the extra to `flowio~=1.4` and regenerate the workspace + preview locks (shared and indexer resolve flowio transitively via t4-lambda-shared[preview]). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Austin-s-h
force-pushed
the
feat/preview-lambda-features
branch
from
June 2, 2026 19:14
3552c62 to
49aad46
Compare
Collaborator
Author
|
@greptile re-review |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
10 tasks
Copilot
AI
changed the title
feat(catalog): preview rendering features and crash isolation
fix(catalog): resolve test-catalog build failure in Pdf.spec.ts
Jun 7, 2026
Collaborator
Author
|
Closing in favor of smaller, independently-reviewable PRs harvested from this work and rebased cleanly onto The preview frontend work is superseded by:
Closing to keep the review queue clean; happy to reopen if any of the split PRs miss something. |
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.
Description
Frontend companion to the preview/lambda feature PR (#4936). Adds catalog
rendering for the new preview-lambda capabilities, hardens preview error
handling, and isolates preview crashes so one bad file can no longer blank an
entire page. Also includes the CI-unblocking fixes that landed on this branch.
Stacked PR: base is
feat/preview-lambda-features(#4936); this branch is thebase for
feat/local-catalog(#4938).Preview rendering features
vegaLitespec (loaders/Fcs.js,renderers/Fcs.jsx,types.js).video/webmtranscoding for video previews(
loaders/Video.tsx).useMemoEq, raise preview resolution tow2048h1536, and fix an infinite re-render loop in the renderer by holdingsign/firstPageBlobin refs (loaders/Pdf.js,renderers/Pdf.jsx,loaders/utils.js).claimed by a type-specific loader is previewed as text via the preview
lambda, with a binary-sniff fallback that shows a clean
"Binary file — no text preview available" message instead of dumping bytes
(
loaders/TextFallback.tsx, registered inload.jsximmediately before thegeneric fallback).
errorandmatrix_preview/matrix_preview_errorfields; render an explicitPreviewErrorinstead of ablank Perspective panel when the tabular_preview lambda returns an error
envelope (
loaders/Tabular.tsx,renderers/Perspective/Metadata.tsx).Error handling & crash isolation
pre-building
PreviewError.Unexpectedwithretry: null, souseErrorHandlingattaches
data.fetchand transient failures (timeouts, temporary 5xx) keeptheir retry button (
loaders/Pdf.js).PreviewErrorwhen the lambdareturns
{ info: null }or a payload missinginfo.data, instead of a rawTypeError(loaders/Text.js,loaders/TextFallback.tsx).PreviewError.Unsupportednow carries an optionalmessagerendered byPreviewDisplay(types.js,Display.jsx).File.jsx) and eachSummarize file preview (
Summarize.tsx) in error boundaries that reset onhandle change, so a single failing preview no longer crashes the whole view.
CI / build fixes on this branch
Pdf.spec.ts— correct a TypeScript-incompatibleuseErrorHandlingmock return value (
{ tag: 'Handled' }→{ value, options }shape) thatfailed
npm run buildwithTS2345.File/ErrorBoundaryandSummarize.ErrorBoundaryspec helpers annotated: neverso the production build (ForkTsCheckerWebpackPlugin type-checks specfiles) accepts the throwing JSX child.
useQueryRunempty-database test by polling withwaitForinstead of
waitForValueToChange.Routes.ts—fromBucketPathParamshelper to keep the path-params schematypes consistent across routes.
prettier --checkflagged it.TODO
optipngon any new PNGs (none added)build.pyfor new docstrings (no Python docstring changes)docs/Catalog/Preview.md: FCS scatter + binary-file fallback; linked fromSUMMARY.md)TextFallback.tsx,Tabular.tsx)unreleased)