Skip to content

Frontend ai search results - #435

Open
bryanshao07 wants to merge 2 commits into
mainfrom
frontend-ai-search-results
Open

bryanshao07 wants to merge 2 commits into
mainfrom
frontend-ai-search-results

Conversation

@bryanshao07

Copy link
Copy Markdown

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.

Stacked on #434.

  • 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
  • common/constants/neighborhoods.ts: static neighborhood config keyed by NeighborhoodId (display name, distance text, description)
  • frontend/src/mocks/aiSearchMock.ts: mock AiSearchResponse using real seed apartments and review text, covering all four block types
  • Results page UI (next step)
  • Backend endpoint

Test Plan

The frontend has no test suite, so this was verified with the type checker:

  • ran yarn workspaces run tsc --noEmit on Node 18; passes for both frontend and backend
  • tsc --noEmit --strict passes on common/types/ai-search-types.ts and common/constants/neighborhoods.ts

The mock covers these edge cases:

Case Listing
Appears in two blocks 238
Null price and bedroom values 94
No featured review 96

Notes

Field names

  • Existing names are reused where they match (e.g. numReviews).
  • photoUrl differs from the existing photos: string[]; the backend will pick the first photo.

Where the data comes from

  • minBeds, maxBeds, minPrice, maxPrice come from the apartment's roomTypes, not reviews. Null when roomTypes is empty.
  • avgRating is null when there are no approved reviews.
  • featuredReview is the approved review with the most likes, or null if none.

Mock placeholders

  • Seed data has no coordinates, photos, prices, or bedroom counts, so latitude/longitude are approximate.
  • Price and bed values on listings 237, 238, and 244 are illustrative.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Important

Review skipped

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.

❤️ Share

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

@dti-github-bot

Copy link
Copy Markdown
Member

[diff-counting] Significant lines: 396.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
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
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.

3 participants