Refining the User Journey: Improvements in Cronix
Building a smooth onboarding and scheduling flow is crucial for retention in any application. Recently, I focused on several key UX and stability enhancements in the Cronix project to ensure that users have a seamless experience from their first login through to scheduling their appointments.
The Challenges
Users were encountering friction during the registration and booking process. Specifically, issues with timezone discrepancies during appointment scheduling, inconsistent session handling, and a lack of clear navigation in the booking interface hindered the overall flow. Furthermore, we needed to ensure that users completed the mandatory onboarding steps before accessing sensitive application features.
Improving the Experience
To address these, we overhauled several critical paths.
Session Management
We implemented a 12-hour session limit to balance user convenience with security. By leveraging Supabase sessions, we can ensure that authentication tokens are refreshed appropriately without causing unnecessary logout events.
// Example of enforcing a session window
const { data: { session }, error } = await supabase.auth.getSession();
if (session && isExpired(session.expires_at, 12)) {
await supabase.auth.signOut();
redirectToLogin();
}
Timezone and Onboarding Logic
We corrected the timezone calculation logic in our scheduling component to match user input against UTC offsets reliably. Additionally, we introduced an 'onboarding gate' — a pattern where navigation is restricted until a user completes their profile setup.
// Logic for gating the UI
function ProtectedRoute({ user, onboardingCompleted, children }) {
if (!onboardingCompleted) {
return <Navigate to="/onboarding" />;
}
return children;
}
The Outcome
These adjustments have significantly simplified the navigation within the 'Nueva Cita' (New Appointment) flow. By standardizing the navigation buttons and enforcing profile completion, the application state remains predictable, and the data integrity regarding appointment times has improved drastically.
Actionable Takeaways
- Gate your workflows: Use conditional redirects to enforce onboarding before granting access to core app features.
- Normalize timestamps: Always store and retrieve dates in UTC, then handle conversion to local time specifically at the UI layer.
- Control your session lifecycle: Periodically audit your session duration settings to ensure they align with the expected security and user behavior patterns of your target audience.
Generated with Gitvlg.com