Conversation
- 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
There was a problem hiding this comment.
Sorry @Connorbelez, your pull request is larger than the review limit of 150000 diff characters
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
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-distwith 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.
| 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", | ||
| }, |
There was a problem hiding this comment.
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.

portal-subdomain resolution fix
portal-availability
docs(listings): add pdf viewer design
Add inline PDF document viewer