SurfSense/surfsense_web/components/layout/ui/sidebar
Vonic 4eb6ed18d6 Epic 5 Complete: Billing, Subscriptions, and Admin Features
Resolve all 5 deferred items from Epic 5 adversarial code review:
- Migration 124: Add CASCADE to subscriptionstatus enum drop (prevent orphaned references)
- Stripe rate limiting: In-memory per-user limiter (20 calls/60s) on verify-checkout-session
- Subscription request cooldown: 24h cooldown before resubmitting rejected requests
- Token reset date: Initialize on first subscription activation
- Checkout URL validation: Confirmed HTTPS-only (Stripe always returns HTTPS)

Implement Story 5.4 (Usage Tracking & Rate Limit Enforcement):
- Page quota pre-check at HTTP upload layer
- Extend UserRead schema with token quota fields
- Frontend 402 error handling in document upload
- Quota indicator in dashboard sidebar

Story 5.5 (Admin Seed & Approval Flow):
- Seed admin user migration with default credentials warning
- Subscription approval/rejection routes with admin guard
- 24h rejection cooldown enforcement

Story 5.6 (Admin-Only Model Config):
- Global model config visible across all search spaces
- Per-search-space model configs with user access control
- Superuser CRUD for global configs

Additional fixes from code review:
- PageLimitService: PAST_DUE subscriptions enforce free-tier limits
- TokenQuotaService: PAST_DUE subscriptions enforce free-tier limits
- Config routes: Fixed user_id.is_(None) filter on mutation endpoints
- Stripe webhook: Added guard against silent plan downgrade on unrecognized price_id

All changes formatted with Ruff (Python) and Biome (TypeScript).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 03:54:45 +07:00
..
AllPrivateChatsSidebar.tsx chore: ran linting 2026-04-07 05:55:39 +05:30
AllSharedChatsSidebar.tsx chore: ran linting 2026-04-07 05:55:39 +05:30
AnnouncementsSidebar.tsx refactor: unify sidebar state management in LayoutDataProvider to allow only one slide-out panel open at a time 2026-03-22 00:01:31 +05:30
ChatListItem.tsx feat: implement dropdown menu state management in DocumentNode and sidebar components 2026-03-28 02:32:03 +05:30
DocumentsSidebar.tsx feat: show spinner on export button during export 2026-04-09 14:00:25 +02:00
InboxSidebar.tsx chore: ran linting 2026-04-08 05:20:03 +05:30
index.ts refactor: unify sidebar state management in LayoutDataProvider to allow only one slide-out panel open at a time 2026-03-22 00:01:31 +05:30
MobileSidebar.tsx feat: enhance chat sidebar functionality and UI 2026-03-17 03:55:49 +05:30
NavSection.tsx chore: linting 2026-03-31 21:42:03 -07:00
PageUsageDisplay.tsx Epic 5 Complete: Billing, Subscriptions, and Admin Features 2026-04-15 03:54:45 +07:00
Sidebar.tsx Epic 5 Complete: Billing, Subscriptions, and Admin Features 2026-04-15 03:54:45 +07:00
SidebarButton.tsx refactor: update document processing status handling and improve sidebar components 2026-03-31 21:29:46 -07:00
SidebarCollapseButton.tsx feat: enhance sidebar and toolbar components with shortcut key display, improving user interaction and accessibility 2026-03-07 02:50:01 +05:30
SidebarHeader.tsx fix: remove unused useRouter and useParams in SidebarHeader 2026-03-25 10:32:53 +08:00
SidebarSection.tsx chore: ran linting 2026-03-17 04:40:46 +05:30
SidebarSlideOutPanel.tsx refactor: update SidebarSlideOutPanel animation to use width instead of x for smoother transitions 2026-04-09 17:37:31 +05:30
SidebarUserProfile.tsx feat: implement download functionality for different OS in SidebarUserProfile and DownloadButton components, enhance user experience with localized download messages 2026-04-10 19:53:13 +05:30