Improve login and signup error feedback for better user experience
Description
This PR improves error feedback on both the login and signup pages. Users now see clear, user-friendly messages for common issues such as invalid credentials, missing accounts, unverified emails, weak passwords, and network errors. This enhances the user experience and accessibility.
Fixes: No specific issue, but addresses user confusion on failed login and signup attempts.
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
- Tried logging in with invalid credentials (shows “Invalid email or password. Please try again.”)
- Tried logging in with a non-existent email (shows “No account found with this email.”)
- Disconnected network and tried login (shows fallback error message)
- Tried signing up with an existing email, weak password, and network issues (shows appropriate messages)
- Confirmed no new warnings in the console
Test Configuration:
- Node version: 18.16.0
- Browser: Chrome 125
- Operating System: Windows 10
Screenshots (if applicable)
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules
Additional context
This PR improves the user experience for failed logins and signups, helping users understand what went wrong and reducing confusion and support requests.
Summary by CodeRabbit
-
New Features
- Introduced snapping functionality in the timeline editor, including a SnapIndicator, snapping controls, and snapping to playhead or element edges.
- Added a detailed Roadmap page to the app, accessible from the footer.
- Added Discord link and Roadmap to the footer's resources.
-
Enhancements
- Improved error messages for login and sign-up to be more user-friendly.
- Media and text items can now be added directly to the timeline at the current playback time from the media panel.
- Timeline elements for images and videos now use tiled backgrounds for better visual representation.
- Added a toggle for snapping in the timeline toolbar.
-
Bug Fixes
- Updated tooltip color scheme for better readability.
- Fixed removal of real-time waitlist count from the landing page.
-
Chores
- Centralized and validated environment variable management using new env and keys modules.
- Removed Google OAuth environment variables and documentation.
- Updated dependencies and added new packages for environment and markdown support.
-
Database
- Updated database schema and migration to set default email verification status and added a new schema snapshot.
-
Documentation
- Added Vercel OSS Program badge to README.
- Updated contributing guide and .env.example to reflect removal of Google OAuth variables.
-
Refactor
- Refactored timeline store and environment variable access for improved maintainability and consistency.
Deploy request for appcut pending review.
Visit the deploys page to approve it
| Name | Link |
|---|---|
| Latest commit | cfddc15b7b8f0adcc8f720e8b05671f694edee7e |
@anishghanwat is attempting to deploy a commit to the OpenCut OSS Team on Vercel.
A member of the Team first needs to authorize it.
Walkthrough
This update introduces a centralized, type-safe environment variable management system across the codebase using @t3-oss/env and custom keys() functions. It removes Google OAuth support and related environment variables, updates authentication and database configuration to use the new env system, adds timeline snapping functionality in the editor, improves error messaging for login and signup, and enhances the UI with a roadmap page, Discord footer link, and visual timeline improvements.
Changes
| Files/Paths | Change Summary |
|---|---|
.github/CONTRIBUTING.md, README.md, apps/web/.env.example, docker-compose.yaml |
Removed Google OAuth environment variable documentation and usage. |
apps/web/drizzle.config.ts, apps/web/src/env.ts, apps/web/src/lib/rate-limit.ts, apps/web/src/middleware.ts, packages/db/drizzle.config.ts, packages/db/src/index.ts, packages/db/src/keys.ts, packages/db/package.json, packages/auth/src/keys.ts, packages/auth/package.json, packages/auth/src/server.ts, packages/auth/src/client.ts, packages/auth/src/index.ts |
Refactored to use centralized, type-safe environment variable management with @t3-oss/env and keys() functions. Added new env modules and updated config, DB, and auth code. |
apps/web/package.json, packages/auth/package.json, packages/db/package.json |
Added dependencies for environment management (@t3-oss/env-nextjs, zod), updated Next.js and other dependencies, added new export paths. |
apps/web/migrations/0002_cuddly_pretty_boy.sql, apps/web/migrations/meta/0002_snapshot.json, apps/web/migrations/meta/_journal.json |
Added a migration and schema snapshot for setting default value of email_verified to false in the users table. |
apps/web/src/app/layout.tsx, apps/web/src/components/development-debug.tsx |
Removed the DevelopmentDebug development-only component and its usage from the app layout. |
apps/web/src/app/metadata.ts |
Updated Open Graph and Twitter image URLs in metadata. |
apps/web/src/app/page.tsx, apps/web/src/components/landing/hero.tsx |
Removed waitlist signup count logic and prop from the home page and hero component. |
apps/web/src/app/roadmap/page.tsx |
Added a new Roadmap page with markdown-rendered milestones and contribution links. |
apps/web/src/components/footer.tsx |
Added Discord link and Roadmap link to the footer. |
apps/web/src/components/editor/media-panel/views/media.tsx, apps/web/src/components/editor/media-panel/views/text.tsx, apps/web/src/components/ui/draggable-item.tsx |
Improved drag-and-drop for media/text, added direct "Add to timeline" button/callback. |
apps/web/src/components/editor/snap-indicator.tsx, apps/web/src/hooks/use-timeline-snapping.ts, apps/web/src/components/editor/timeline-playhead.tsx, apps/web/src/components/editor/timeline-track.tsx, apps/web/src/components/editor/timeline.tsx, apps/web/src/constants/timeline-constants.ts, apps/web/src/stores/timeline-store.ts |
Introduced timeline snapping: new snapping state, UI indicator, snapping logic, toolbar toggle, and store actions for snapping and element addition. |
apps/web/src/components/editor/timeline-element.tsx |
Updated timeline element rendering to use tiled backgrounds for images and videos. |
apps/web/src/components/ui/tooltip.tsx |
Changed tooltip color scheme. |
apps/web/src/hooks/auth/useLogin.ts, apps/web/src/hooks/auth/useSignUp.ts |
Improved error handling with user-friendly error message mapping for login and signup. |
Sequence Diagram(s)
Timeline Snapping Feature (High-Level)
sequenceDiagram
participant User
participant Timeline
participant TimelineStore
participant useTimelineSnapping
participant SnapIndicator
User->>Timeline: Drag timeline element
Timeline->>TimelineStore: Get snappingEnabled, dragState
Timeline->>useTimelineSnapping: snapElementPosition(...)
useTimelineSnapping-->>Timeline: { snappedTime, snapPoint }
Timeline->>SnapIndicator: Show snap indicator (if snapPoint)
Timeline->>TimelineStore: Add element at snapped position (if dropped)
Centralized Environment Variable Access
sequenceDiagram
participant AppCode
participant keys() / env
participant @t3-oss/env
participant process.env
AppCode->>keys() / env: Import and call for config
keys() / env->>@t3-oss/env: Validate env vars with schema
@t3-oss/env->>process.env: Read raw env vars
@t3-oss/env-->>keys() / env: Return validated config
keys() / env-->>AppCode: Provide typed config values
Possibly related PRs
- OpenCut-app/OpenCut#275: Adds a Discord link to the footer, matching the new Discord link added in this PR.
- OpenCut-app/OpenCut#274: Alters the "users" table and updates the schema snapshot, directly related to the migration changes here.
- OpenCut-app/OpenCut#272: Refactors environment variable access to use centralized management, closely related to the env refactor in this PR.
Poem
A rabbit hops through fields of code,
Centralized envs now safely bestowed.
Snapping on timelines, elements align,
Roadmaps and Discord—community signs!
Old OAuth secrets now left behind,
With friendly errors, users won’t mind.
🐇✨ Hop, hop, hooray—what a fine deploy day!
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
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.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Explain this complex logic.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.