Skip to content

Conversation

@MathisVerstrepen
Copy link
Owner

@MathisVerstrepen MathisVerstrepen commented Dec 30, 2025

Short Summary

This PR introduces an onboarding flow for users who have not yet configured their OpenRouter API key. It adds a persistent "Welcome" state to the user profile and implements a modal on the home dashboard that prompts users to set up their API credentials, ensuring the application is usable immediately after signup.

Technical Changes

Database & Backend (api/)

  • Schema Update: Added has_seen_welcome (boolean, default False) to the User SQLModel and associated Alembic migration (b6ac4c311f9d).
  • API Endpoints:
    • Added POST /user/ack-welcome in routers/users.py to allow the frontend to mark the onboarding as complete.
    • Updated sync_user and UserRead models to return the has_seen_welcome status.
  • CRUD Operations: Implemented mark_user_as_welcomed in user_crud.py.

Frontend (ui/)

  • New Component: Created components/ui/home/welcomeModal.vue, a styled modal featuring animations and a direct link to settings.
  • Page Logic (pages/index.vue):
    • Added a watcher on isReady state.
    • Logic triggers the modal only if: The user has not seen the welcome screen AND the user has no OpenRouter API key configured in Pinia.
  • Server Middleware:
    • Added server/api/auth/ack-welcome.post.ts as a proxy to the backend endpoint, which also refreshes the user session to reflect the state change immediately.
    • Updated github.get.ts, google.get.ts, and login.post.ts to include has_seen_welcome in the session user object.
  • Type Definitions: Updated types/user.d.ts to include the new boolean field.

Impact and Scope

  • Functional Impact: Users logging in for the first time (or those without API keys who haven't acknowledged the modal) will be interrupted by a welcome modal guiding them to the Settings page.
  • System Reach:
    • Database: Requires running Alembic migrations to add the has_seen_welcome column to the users table.
    • Auth: Modifies the session payload structure.
  • Breaking Changes: None. The default value for existing users is False, meaning they may see the modal once if they haven't configured an API key, which is intended behavior.
  • Performance/Security: Minimal impact. The state check is performed client-side based on session data.

@MathisVerstrepen MathisVerstrepen self-assigned this Dec 30, 2025
@MathisVerstrepen MathisVerstrepen added the new-feature Adding entirely new capabilities or functionalities to the application. label Dec 30, 2025
@MathisVerstrepen MathisVerstrepen merged commit c584099 into nightly Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature Adding entirely new capabilities or functionalities to the application.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants