Skip to content

pdf-viewer#442

Open
Connorbelez wants to merge 4 commits intographite-base/442from
t3code/production-pdf-viewer
Open

pdf-viewer#442
Connorbelez wants to merge 4 commits intographite-base/442from
t3code/production-pdf-viewer

Conversation

@Connorbelez
Copy link
Copy Markdown
Owner

portal-subdomain resolution fix

portal-availability

docs(listings): add pdf viewer design

Add inline PDF document viewer

  • Detect PDF public documents and expose refreshable access metadata
  • Replace listing document placeholders with shared sidebar and viewer components
  • Add PDF viewer tests and wire in react-pdf/pdfjs dependencies

- Detect PDF public documents and expose refreshable access metadata
- Replace listing document placeholders with shared sidebar and viewer components
- Add PDF viewer tests and wire in react-pdf/pdfjs dependencies
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Connorbelez, your pull request is larger than the review limit of 150000 diff characters

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9c0d2f96-8c96-4b4c-be9a-65e25b830e6d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/production-pdf-viewer

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Connorbelez Connorbelez changed the title portal-subdomain resolution fix pdf-viewer Apr 21, 2026
This was referenced Apr 21, 2026
Copy link
Copy Markdown
Owner Author

Connorbelez commented Apr 21, 2026

@Connorbelez Connorbelez marked this pull request as ready for review April 21, 2026 07:17
Copilot AI review requested due to automatic review settings April 21, 2026 07:17
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an inline PDF document viewer for marketplace listing details (including refreshable access metadata for public documents), while also bundling several backend/ops hardening changes (pagination guards, reconciliation refactors, and payments migrations/runner updates).

Changes:

  • Add shared listing document sidebar + viewer components, including an inline PDF viewer using react-pdf/pdfjs-dist with signed-URL refresh support.
  • Extend listings public-document metadata (contentType/fileName/kind) and add a single-document refresh query to avoid refetching full listing snapshots.
  • Refactor/extend several backend subsystems (reconciliation actions, recurring schedule poller batching, collection-plan runner wave draining) and add a Convex migrations module + tests.

Reviewed changes

Copilot reviewed 37 out of 39 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/test/listings/marketplace-listing-detail-page.test.tsx Updates listing detail adapter/page tests for enriched document model fields.
src/test/listings/listing-document-viewer.test.tsx Adds component test for non-PDF viewer fallback behavior.
src/test/convex/testKit.ts Registers the @convex-dev/migrations component for convex-test harnesses.
src/test/convex/single-paginate-guard.test.ts Adds an AST-based guard test to flag multi-paginate/loop-paginate patterns.
src/test/convex/onboarding/onboarding.test.ts Updates reconciliation calls from query → action.
src/test/convex/engine/hash-chain-reconciliation.test.ts Updates reconciliation calls from query → action.
src/routeTree.gen.ts Regenerates route tree definitions.
src/components/listings/query-options.ts Adds React Query options for refreshing listing document access metadata.
src/components/listings/marketplace-detail-adapter.ts Maps enriched public document metadata into ListingDocumentItem.
src/components/listings/listing-detail-types.ts Extends ListingDocumentItem shape (assetId/kind/contentType/fileName).
src/components/listings/ListingPdfViewer.tsx New inline PDF viewer with paging, loading/error states, and URL refresh retry.
src/components/listings/ListingDocumentViewer.tsx New viewer wrapper that selects PDF vs non-PDF rendering paths.
src/components/listings/ListingDocumentSidebar.tsx New reusable sidebar for document selection (desktop + mobile variants).
src/components/listings/ListingDetailPage.tsx Replaces placeholder document preview UI with shared sidebar/viewer components.
src/components/demo/listings/listing-detail-mock-data.ts Updates demo listing documents to match the new document item type.
package.json Adds react-pdf and pins pdfjs-dist for worker/API alignment.
docs/superpowers/specs/2026-04-21-marketplace-listing-pdf-viewer-design.md Adds the PDF viewer design/spec document.
convex/test/moduleMaps.ts Adds module map entry for convex/payments/migrations.ts.
convex/portals/homePortalAssignment.ts Ensures FairLend portal has a selected pricing policy during backfill/ensure.
convex/portals/tests/registry.test.ts Extends registry tests to assert pricing policy creation + host resolution.
convex/payments/transfers/reconciliation.ts Converts legacy reconciliation entrypoint into a thin delegate action.
convex/payments/recurringSchedules/queries.ts Replaces multi-paginate collector with a single-page pagination query.
convex/payments/recurringSchedules/poller.ts Adds wave-draining polling loop + preview/count actions to avoid query loops.
convex/payments/recurringSchedules/tests/providerManaged.integration.test.ts Updates integration tests for preview action + new poll summary fields.
convex/payments/migrations.ts Adds a payments migration for deleting malformed mortgage cohorts + preview/run endpoints.
convex/payments/collectionPlan/runner.ts Adds multi-wave draining to process due plan entries in one invocation.
convex/payments/collectionPlan/queries.ts Adds countDuePlannedEntries to support max-wave diagnostics.
convex/payments/collectionPlan/tests/runner.test.ts Adds test ensuring multiple due batches drain in one invocation.
convex/payments/tests/migrations.test.ts Adds tests for previewing + running malformed mortgage cleanup migration.
convex/listings/queries.ts Import reordering/cleanup related to listing queries.
convex/listings/publicDocuments.ts Enriches public document payload and adds per-asset refresh query.
convex/lib/drainLoops.ts Adds reusable cursor draining + wave loop helpers.
convex/engine/reconciliationAction.ts Refactors reconciliation layer-1 to run as an internal action with paging helpers.
convex/engine/reconciliation.ts Switches admin reconciliation endpoints from query → action and adds paging query.
convex/dispersal/selfHealing.ts Improves escalation behavior when borrower receivable account is missing (no throw).
convex/dispersal/tests/selfHealing.test.ts Updates tests for new self-healing result reasons + missing receivable coverage.
convex/admin/origination/commit.ts Removes unused imports in origination commit flow.
convex/_generated/api.d.ts Regenerates API typings for new modules/ordering.
bun.lock Locks react-pdf + pdfjs-dist dependency versions and transitive deps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 28 to 37
const standardDocuments: ListingDocumentItem[] = [
{
assetId: "appraisal-report",
contentType: "application/pdf",
id: "appraisal-report",
kind: "pdf",
label: "Appraisal Report",
meta: "PDF · 2.3 MB",
pageLabel: "Appraisal Report — Page 1 of 8",
fileName: "appraisal-report.pdf",
},
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Demo listing documents are now marked as kind="pdf" but have no url. In the demo routes that render ListingDetailPage, selecting these documents will always show the PDF viewer error state and the retry path will attempt a Convex refresh using non-Convex IDs (e.g. "first-mortgage-north-york" / "appraisal-report"), which will fail noisily. Consider either providing a real demo PDF URL (static asset) for these entries, or setting kind: "other" (and/or adding url) so the demo surface remains functional without backend access refresh.

Copilot uses AI. Check for mistakes.
@Connorbelez Connorbelez changed the base branch from eng-300 to graphite-base/442 April 21, 2026 20:04
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.

2 participants