Skip to content

Fix recommendation request failures and clean up landing page#6

Merged
MohammedAlkindi merged 1 commit into
mainfrom
codex/debug-curio-recommendation-errors
Apr 2, 2026
Merged

Fix recommendation request failures and clean up landing page#6
MohammedAlkindi merged 1 commit into
mainfrom
codex/debug-curio-recommendation-errors

Conversation

@MohammedAlkindi

Copy link
Copy Markdown
Owner

Motivation

  • Frontend calls to /recommend could be blocked by restrictive CORS settings, producing a generic "Something went wrong" UI state that offered no diagnostic information.
  • The UI needed clearer error diagnostics so HTTP status and response bodies are visible when requests fail.
  • The landing page copy and visual styling were refreshed to present a cleaner, more modern MVP experience.

Description

  • Broadened allowed origins and added a Codespaces/GitHub-hosted origin regex in backend/app/main.py and bumped the API version to 0.2.1 so common dev hostnames and Codespaces-hosted pages are permitted by CORS.
  • Added an error-detail element to frontend/index.html and wired it into the UI so request errors can surface detailed messages.
  • Improved client-side request error handling in frontend/main.js by reading response.text() on non-OK responses and passing Request failed (<status>): <body> into showState so the error panel displays actionable details.
  • Polished the landing copy and visual system in frontend/index.html and frontend/styles.css (new hero highlights, updated spacing, colors, focus states, and card polish) for a cleaner presentation.

Testing

  • Ran syntax checks with python -m py_compile backend/app/main.py backend/app/api/recommend.py backend/app/models/schemas.py backend/app/scoring/engine.py, which completed successfully.
  • Validated the frontend script with node --check frontend/main.js, which completed successfully.
  • Exercised the recommend path directly with PYTHONPATH=backend python - <<'PY' ... recommend(UserPreferences.model_validate(payload)) ... PY, which returned recommendations and a valid meta summary, indicating the scoring and response flow works as expected.

Codex Task

@MohammedAlkindi
MohammedAlkindi merged commit 750c33d into main Apr 2, 2026
1 check passed
@MohammedAlkindi
MohammedAlkindi deleted the codex/debug-curio-recommendation-errors branch April 2, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant