You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Second step toward the AI search results page. This PR defines the shapes of each data part between the future backend and results page. There is no UI or endpoint yet in this PR.
common/types/ai-search-types.ts: AiSearchResponse, ListingSummary, and Block types. A Block is one of text, property_cards, comparison_table, or neighborhoods.
NeighborhoodId defined as Exclude<Apartment['area'], 'OTHER'>, so it stays in sync with the existing area union
Auto reviews are disabled on this repository. 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
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: QUIET
Plan: Advanced
Run ID: 07f1aa51-b89c-4478-9469-72a8ec68bc49
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
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You have signed the CLA already but the status is still pending? Let us recheck it.
This branch has not been deployed
No deployments
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
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.
Summary
Second step toward the AI search results page. This PR defines the shapes of each data part between the future backend and results page. There is no UI or endpoint yet in this PR.
common/types/ai-search-types.ts:AiSearchResponse,ListingSummary, andBlocktypes. ABlockis one oftext,property_cards,comparison_table, orneighborhoods.NeighborhoodIddefined asExclude<Apartment['area'], 'OTHER'>, so it stays in sync with the existing area unioncommon/constants/neighborhoods.ts: static neighborhood config keyed byNeighborhoodId(display name, distance text, description)frontend/src/mocks/aiSearchMock.ts: mockAiSearchResponseusing real seed apartments and review text, covering all four block typesTest Plan
The frontend has no test suite, so this was verified with the type checker:
yarn workspaces run tsc --noEmiton Node 18; passes for bothfrontendandbackendtsc --noEmit --strictpasses oncommon/types/ai-search-types.tsandcommon/constants/neighborhoods.tsThe mock covers these edge cases:
Notes
Field names
numReviews).photoUrldiffers from the existingphotos: string[]; the backend will pick the first photo.Where the data comes from
minBeds,maxBeds,minPrice,maxPricecome from the apartment'sroomTypes, not reviews. Null whenroomTypesis empty.avgRatingis null when there are no approved reviews.featuredReviewis the approved review with the most likes, or null if none.Mock placeholders