Skip to content

eng-301: portal-listings#439

Open
Connorbelez wants to merge 1 commit intoportal-availabilityfrom
codex/eng-301-portal-listings
Open

eng-301: portal-listings#439
Connorbelez wants to merge 1 commit intoportal-availabilityfrom
codex/eng-301-portal-listings

Conversation

@Connorbelez
Copy link
Copy Markdown
Owner

No description provided.

@linear
Copy link
Copy Markdown

linear Bot commented Apr 21, 2026

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, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@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: d8cee34e-06bb-4774-a5f0-71b800917cdd

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:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/eng-301-portal-listings

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 marked this pull request as ready for review April 21, 2026 03:32
Copilot AI review requested due to automatic review settings April 21, 2026 03:32
Copy link
Copy Markdown
Owner Author

Connorbelez commented Apr 21, 2026

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

Implements ENG-301 by introducing explicit portal listing query contracts (public teaser + lender list/detail) and wiring thin frontend route consumers to those contracts via TanStack Query, with supporting tests and spec documentation.

Changes:

  • Added Convex portal-aware listing query endpoints and shared snapshot helpers for consistent pricing/filter behavior.
  • Updated / (portal hosts) and /lender/listings (+ detail) to consume the explicit portal query contracts and render host-scoped empty/unavailable states.
  • Added/updated frontend and backend tests plus ENG-301 spec/audit artifacts.

Reviewed changes

Copilot reviewed 36 out of 37 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/test/routes/portal-home-route.test.tsx Adds portal-home teaser consumer coverage (TanStack Query + explicit portal query options).
src/test/routes/lender-listings-route.test.tsx Adds /lender/listings route coverage for portal-host gating and query-option wiring.
src/test/listings/marketplace-listings-page.test.tsx Extends listings page tests to validate detailRoute link behavior.
src/test/lender/listing-detail-page.test.tsx Refactors lender detail tests to TanStack Query + portal detail query options and host gating states.
src/routes/lender.listings.tsx Implements lender listings index surface with portal-host gating, search parsing, and explicit portal list query usage.
src/routes/index.tsx Replaces portal-host root debug surface with public teaser listings consumer using explicit portal query options.
src/routeTree.gen.ts Regenerates route tree to reflect updated route structure/order.
src/components/listings/search.ts Adds helper to map backend effective filters into route search state.
src/components/listings/portal-query-options.ts Introduces React Query option builders for portal teaser/list/detail Convex endpoints.
src/components/listings/marketplace-types.ts Adds portal snapshot/effective-filter types derived from new Convex endpoints.
src/components/listings/MarketplaceListingsPage.tsx Makes heading/eyebrow/description/detailRoute configurable; routes cards via detailRoute.
src/components/lender/listings/LenderListingDetailPage.tsx Moves lender detail reads to TanStack Query and explicit portal detail contract; adds portal-host required state.
specs/ENG-301/tasks.md Tracks ENG-301 task execution state.
specs/ENG-301/summary.md Documents ENG-301 scope/constraints and linked planning artifacts.
specs/ENG-301/status.md Records execution status and validation notes.
specs/ENG-301/execution-checklist.md Captures requirements/DoD checklist and validation expectations.
specs/ENG-301/chunks/manifest.md Summarizes chunk breakdown and completion status.
specs/ENG-301/chunks/chunk-04-tests-validation-and-audit/tasks.md Records validation/audit tasks for chunk 04.
specs/ENG-301/chunks/chunk-04-tests-validation-and-audit/status.md Records completion/validation results for chunk 04.
specs/ENG-301/chunks/chunk-04-tests-validation-and-audit/context.md Context/plan excerpts for validation/audit chunk.
specs/ENG-301/chunks/chunk-03-lender-list-route-and-detail/tasks.md Records tasks for lender list/detail consumer chunk.
specs/ENG-301/chunks/chunk-03-lender-list-route-and-detail/status.md Records completion/validation notes for chunk 03.
specs/ENG-301/chunks/chunk-03-lender-list-route-and-detail/context.md Context for lender list/detail consumer chunk.
specs/ENG-301/chunks/chunk-02-public-portal-teaser/tasks.md Records tasks for portal teaser consumer chunk.
specs/ENG-301/chunks/chunk-02-public-portal-teaser/status.md Records completion/validation notes for chunk 02.
specs/ENG-301/chunks/chunk-02-public-portal-teaser/context.md Context for portal teaser consumer chunk.
specs/ENG-301/chunks/chunk-01-backend-portal-contracts/tasks.md Records tasks for backend portal contracts chunk.
specs/ENG-301/chunks/chunk-01-backend-portal-contracts/status.md Records completion/validation notes for chunk 01.
specs/ENG-301/chunks/chunk-01-backend-portal-contracts/context.md Context for backend portal contracts chunk.
specs/ENG-301/audit.md Spec compliance audit output and remaining manual-validation gaps.
convex/test/moduleMaps.ts Registers new portalQueries module in Convex test module map.
convex/listings/queries.ts Extracts reusable snapshot helpers and reuses them from existing endpoints.
convex/listings/portalQueries.ts Adds explicit portal public/lender list/detail query contracts with pricing + filter clamping.
convex/listings/marketplace.ts Exposes shared marketplace snapshot helper and filter validator for reuse by portal queries.
convex/listings/tests/queries.test.ts Adds backend test coverage for portal teaser, lender list clamping, and lender detail contract.
convex/admin/origination/commit.ts Removes unused import from origination commit flow.
convex/_generated/api.d.ts Updates generated API types to include new portalQueries module.

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

Comment on lines +66 to +70
if (!allowed?.length) {
return requested ? [...requested] : undefined;
}

if (!requested?.length) {
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.

clampEnumValues returns allowed values directly (and casts them to T[]) when the request omits that filter. Because allowedMortgageTypes / allowedPropertyTypes are stored as string[] in the DB schema, invalid values can propagate into effectiveFilters without validation. Consider sanitizing allowed against the known marketplace enums before returning it.

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +39
const min = Math.max(
requested?.min ?? allowed?.min ?? Number.NEGATIVE_INFINITY,
allowed?.min ?? Number.NEGATIVE_INFINITY
);
const max = Math.min(
requested?.max ?? allowed?.max ?? Number.POSITIVE_INFINITY,
allowed?.max ?? Number.POSITIVE_INFINITY
);

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.

With the current min = max(requested.min, allowed.min) / max = min(requested.max, allowed.max) approach, it’s possible to produce an inverted range (min > max) when the requested range falls entirely outside the allowed bounds. Since this value is returned in effectiveFilters, it can break client range UI. Consider clamping each endpoint into the allowed bounds (and/or collapsing to the nearest boundary) so the returned range always satisfies min <= max while still enforcing constraints.

Suggested change
const min = Math.max(
requested?.min ?? allowed?.min ?? Number.NEGATIVE_INFINITY,
allowed?.min ?? Number.NEGATIVE_INFINITY
);
const max = Math.min(
requested?.max ?? allowed?.max ?? Number.POSITIVE_INFINITY,
allowed?.max ?? Number.POSITIVE_INFINITY
);
const allowedMin = allowed?.min ?? Number.NEGATIVE_INFINITY;
const allowedMax = allowed?.max ?? Number.POSITIVE_INFINITY;
let min = requested?.min ?? allowed?.min ?? Number.NEGATIVE_INFINITY;
let max = requested?.max ?? allowed?.max ?? Number.POSITIVE_INFINITY;
min = Math.min(Math.max(min, allowedMin), allowedMax);
max = Math.min(Math.max(max, allowedMin), allowedMax);
if (min > max) {
if (requested?.min !== undefined && requested.min > allowedMax) {
min = allowedMax;
max = allowedMax;
} else if (requested?.max !== undefined && requested.max < allowedMin) {
min = allowedMin;
max = allowedMin;
} else {
max = min;
}
}

Copilot uses AI. Check for mistakes.
… base. Backend now exposes explicit portal listing contracts in convex/listings/portalQueries.ts, backed by shared pricing-aware snapshot helpers in convex/listings/marketplace.ts and convex/listings/queries.ts. On the frontend, the new surfaces now consume root portalContext instead of reparsing hosts: src/routes/index.tsx renders public teaser listings, src/routes/lender.listings.tsx renders the authenticated lender list, and src/components/lender/listings/LenderListingDetailPage.tsx now reads through TanStack Query via src/components/listings/portal-query-options.ts.
@Connorbelez Connorbelez changed the base branch from eng-300 to graphite-base/439 April 21, 2026 20:04
@Connorbelez Connorbelez force-pushed the codex/eng-301-portal-listings branch from 599134d to e61d4c0 Compare April 21, 2026 20:04
@Connorbelez Connorbelez changed the base branch from graphite-base/439 to portal-availability April 21, 2026 20:05
@Connorbelez Connorbelez changed the title Implemented ENG-301 on codex/eng-301-portal-listings from the eng-300 base. Backend now exposes explicit portal listing contracts in convex/listings/portalQueries.ts, backed by shared pricing-aware snapshot helpers in convex/listings/marketplace.ts and co eng-301: portal-listings Apr 21, 2026
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