Repository navigation
Description
Objective
macOS desktop app users should get a 3-day trial of premium features with a polished, conversion-optimized experience.
Current State
The 3-day trial mechanism exists but provides a poor UX:
- Trial is invisible — no countdown, no awareness UI
- User gets hard-blocked without warning when trial expires
- No pre-expiry upgrade nudge
- Backend exposes trial state only as a boolean paywall check, not as structured trial metadata
- No trial-specific feature showcase or onboarding
What "Best Feature" Looks Like
Backend (Python)
-
Trial metadata endpoint — expose
GET /v1/users/me/trialreturning:trial_started_at(unix seconds)trial_ends_at(unix seconds)trial_remaining_seconds(computed)trial_expired(boolean)trial_features(list of premium features available during trial)plan_after_trial(what the user falls to: "Free" with 30q/month)
-
Configurable trial duration — move
TRIAL_LENGTH_SECONDSto env var (default 3 days) -
Trial notification triggers — emit events at:
- Trial start (user creation)
- 24h before expiry ("1 day left")
- 1h before expiry ("expiring soon")
- Trial expired (existing
freemium_threshold_reached)
-
Graceful degradation — don't hard-cut mid-session; let active sessions finish, paywall on next session start
Desktop macOS App (Swift)
-
Trial awareness banner — persistent subtle banner showing "Trial: X days Xh remaining"
- Positioned in settings or floating bar area
- Taps → plan comparison / upgrade page
-
Pre-expiry upgrade nudge — non-blocking notification at 24h and 1h before trial ends
- "Your premium trial ends tomorrow — upgrade to keep unlimited conversations"
- One-tap "Upgrade" action
-
Trial expired screen — replace abrupt paywall popup with a proper trial-ended view:
- Summary of what they used during trial (conversations captured, questions asked)
- Clear comparison: Free (30 questions/month) vs Operator vs Architect
- "Upgrade" primary CTA + "Continue with Free" secondary
-
Feature showcase during trial — subtle indicators on premium features:
- "Premium" badge on features that will be locked post-trial
- First-use tooltips: "This is a premium feature included in your trial"
-
Settings page trial section — show trial status, days remaining, what's included
Desktop Rust Backend
- Cache trial metadata (not just boolean) — cache
trial_ends_attimestamp for countdown UI - Pass through trial notification events to Swift client via existing event channel
Implementation Plan
Phase 1: Backend trial metadata + configurable duration
- Add
/v1/users/me/trialendpoint - Make
TRIAL_LENGTH_SECONDSenv-configurable - Add trial notification event emission (24h, 1h before expiry)
Phase 2: Desktop trial awareness UI
- Trial countdown banner (Swift)
- Pre-expiry notifications (local + backend-triggered)
- Trial expired screen redesign
Phase 3: Feature showcase + polish
- Premium badges on gated features during trial
- Trial summary on expiry (usage stats)
- A/B test conversion rates
Acceptance Criteria
- Backend returns structured trial metadata via
/v1/users/me/trial - Trial duration configurable via env var
- Desktop shows trial countdown (days/hours remaining)
- Pre-expiry nudge at 24h before trial ends
- Trial expired screen shows plan comparison + upgrade CTA
- Active sessions not hard-cut mid-conversation
- Existing paywall logic preserved (backward compatible)
- Unit tests for new endpoint + notification triggers
Context
- Current trial: 3 days, calculated from Firebase Auth
creation_timestamp - Key files:
backend/utils/subscription.py,backend/routers/users.py,desktop/Desktop/Sources/AppState.swift,desktop/Backend-Rust/src/paywall.rs - Related: Plan types are Free/Operator/Architect (Neo hidden from desktop)
- BYOK bypass must continue to work (exempts from paywall)
Priority
High — trial is the primary conversion funnel for desktop users.
Activity
Add TrialMetadata model for structured trial state response
Add get_trial_metadata() and make TRIAL_LENGTH_SECONDS env-configurable
Add GET /v1/users/me/trial endpoint for structured trial metadata
Add unit tests for trial metadata endpoint and logic (25 tests)
Register test_trial_metadata.py in test.sh
Add auth dependency verification tests per reviewer feedback
Add boundary tests for exact trial expiry edge (259199s/259201s)
feat(backend): Add trial metadata endpoint for desktop paywall UX (Ba…
feat: Free trial paywall — backend endpoint, desktop countdown UI, pr…