Skip to content

Feat/dynamic shopping#100

Merged
Bogdan-ca merged 4 commits into
mainfrom
feat/dynamic-shopping
May 26, 2026
Merged

Feat/dynamic shopping#100
Bogdan-ca merged 4 commits into
mainfrom
feat/dynamic-shopping

Conversation

@Bogdan-ca

Copy link
Copy Markdown
Collaborator

Follow-up to the initial US-8.3 wiring (already squash-merged on main as 8833464). This PR adds
the personalization + UX polish that came out of the parallel code reviews and post-deploy
testing.

What's in this PR

Click-through links

  • Recommendation cards are now <a> tags pointing at the retailer's product page
  • Opens in a new tab with rel="noopener noreferrer nofollow"
  • An ExternalLink glyph fades in on hover; the dismiss X still works (preventDefault +
    stopPropagation on the button)

No more broken-looking cards

  • AI service drops any result without a real product image (was previously falling back to a
    placehold.co URL — looked broken in the grid)
  • Browser-side onError swaps to a neutral fallback if a real CDN URL 404s later

Dismiss persists across reloads

  • Store tracks dismissed items by stable key (productUrl or name — the LLM-assigned id
    rotates on every regeneration)
  • Survives page reload AND fresh AI cache regenerations: once you reject a product, it stays gone
  • A clearDismissed() action is exposed for a future "undo" affordance

Smarter empty state

  • When the budget slider hides everything, the copy now says "N items are hidden by your budget — raise the slider" instead of the generic "no recommendations"

Brand & theme personalization

  • The wardrobe summary sent to the LLM now includes brand and tags per item
  • The analyze_gaps prompt explicitly tells the model to lean into recurring signals (e.g.
    multiple Barça pieces → suggest more Barça-aligned items; lots of Nike → favor Nike-branded
    picks)

Secondhand marketplaces

  • Whitelist gains Vinted, Depop, Grailed, eBay alongside the original 8 (Nike, Adidas, Zara,
    ASOS, Uniqlo, H&M, COS, Everlane)

CI hygiene

  • Playwright shopping spec migrated to mockBackendDefaults({ recommendations }) — local-store
    seeding stopped working when the store switched to fetching from the API
  • pip-audit ignores MAL-2026-4750 — malware-tracker false positive against the legitimate
    fastapi package

Bogdan-ca added 2 commits May 26, 2026 12:31
UX
- Recommendation cards are now clickable links to the retailer
  (target=_blank, rel=noopener noreferrer nofollow) with an external-link
  glyph on hover.
- Drop AI results that lack a real product image at the source — no more
  placeholder cards rendering as broken-looking tiles. Browser-side
  onError swaps to a neutral fallback if a real URL 404s later.
- Empty-state copy now distinguishes "no recs yet" from "your budget
  hides N items" and tells the user how to recover.

Personalization
- Wardrobe summary fed to the LLM now includes brand and tags per item,
  so recurring signals (e.g. a user with multiple Barça shirts, or all
  Nike pieces) can be reinforced.
- analyze_gaps prompt explicitly tells the LLM to bake brand/theme into
  some queries and mix gap-filling vs. reinforcement.
- Whitelist gains Vinted, Depop, Grailed, and eBay so secondhand
  jerseys / vintage finds can surface.

CI hygiene (folds in prior local fixes)
- Playwright shopping spec now mocks /api/recommendations via
  mockBackendDefaults (the store no longer reads from a local file).
- pip-audit ignores MAL-2026-4750 — malware-tracker false positive
  against the legitimate fastapi package.
Dismissed cards no longer reappear on refresh or after the AI cache
regenerates. The store tracks dismissed items by stable key
(productUrl, falling back to name) — the LLM-assigned `id` rotates on
every regeneration, so it can't be used for cross-run identity.

`getFilteredRecommendations` filters out anything whose key is in
`dismissedKeys`; a `clearDismissed()` action is available for a future
"undo" affordance.
Comment thread ai-service/recommend_purchases.py Fixed
Bogdan-ca and others added 2 commits May 26, 2026 12:38
…ring sanitization'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@Bogdan-ca Bogdan-ca merged commit cc4f652 into main May 26, 2026
9 checks passed
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