Skip to content

fix(subscription): add weekly digest subscribe feedback and fix base URL#1061

Open
NayansiDupare wants to merge 1 commit into
imDarshanGK:mainfrom
NayansiDupare:fix/1058-weekly-digest-subscribe-feedback
Open

fix(subscription): add weekly digest subscribe feedback and fix base URL#1061
NayansiDupare wants to merge 1 commit into
imDarshanGK:mainfrom
NayansiDupare:fix/1058-weekly-digest-subscribe-feedback

Conversation

@NayansiDupare

Copy link
Copy Markdown

Summary

Resolves the lack of visual feedback when subscribing to the Weekly Digest in the footer and fixes the Mixed Content / incorrect API base URL routing on the live site. Also addresses a lifespan console startup crash on Windows.

Related Issue

Closes #1058

Changes

  • Frontend:
    • Updated getApiBase() in frontend/index.html to resolve to window.location.origin when running on a web server instead of hardcoding localhost:8000.
    • Added an inline digestFeedback container in the footer with success/error/loading visual cues (custom SVG icons, text colors matching design tokens) and toasts.
    • Added an input listener to dynamically clear feedback once the user edits the email field.
  • Backend:
    • Replaced emojis and horizontal ellipsis in backend/app/main.py lifespan print/logging statements to prevent UnicodeEncodeError crashes on Windows CP1252 consoles.
    • Automatically call Base.metadata.create_all(bind=engine) at startup lifespan to build SQLAlchemy ORM tables (like digest_subscriptions) for clean setups.
  • Testing:
    • Converted frontend/tests/helpers.js and frontend/tests/e2e/analyze.spec.js to ES module syntax to match the tests/package.json configuration.
    • Added an E2E Playwright test case checking that subscribing to the digest correctly triggers the backend API and renders success feedback.

How to Test

  1. Start the backend: uvicorn app.main:app --reload
  2. Open the app (http://localhost:8000/app/)
  3. Scroll to the footer, type a valid email in the "Weekly Digest" input, and click Subscribe.
  4. Verify visual success feedback is rendered and input is cleared.
  5. Re-type the same email and click Subscribe to verify error feedback is displayed ("already subscribed").

@imDarshanGK imDarshanGK left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a short video demo showing the weekly digest subscribe flow with success/error feedback and base URL fix.

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.

[Bug] Weekly Digest "Subscribe" Button Has No Feedback

2 participants