Skip to content

Commit 329f69f

Browse files
committed
feat: Complete admin state simulator integration and authentication fixes
🎭 Admin State Simulator: - Add comprehensive admin state simulator with authentication, subscription, and token earnings simulation - Integrate simulator with WriterTokenDashboard to properly reflect simulated token states - Support unfunded (logged-out/no-subscription), funded pending, and locked available token states - Add proper USD value calculations (10 tokens = ) matching real system 🔐 Authentication & Session Management: - Fix session-based authentication for account switching functionality - Update auth helpers to properly handle session cookies vs Firebase Auth - Resolve permission-denied errors in earnings page by using correct auth context - Add SessionAuthInitializer for hybrid session system 🧹 Code Cleanup: - Remove deprecated test files and debug scripts - Delete unused UserDonorKPI component and related hooks - Clean up old demo code from WriterTokenDashboard - Remove obsolete middleware backup and test files 📊 Analytics & Admin Dashboard: - Add analytics backfill API route for missing data - Improve admin dashboard with consolidated tools section - Add email verification alerts and enhanced error handling - Update token allocation displays and pie charts 🐛 Bug Fixes: - Fix compilation errors in WriterTokenDashboard - Resolve TypeScript issues with token data structures - Update middleware for proper session handling - Fix pledge bar integration with simulated states This comprehensive update establishes a robust admin state simulation system for testing various user scenarios and fixes critical authentication issues that were preventing proper functionality of the earnings system.
1 parent 96eb0ca commit 329f69f

62 files changed

Lines changed: 3439 additions & 3945 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/admin/dashboard/dashboard.css

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
.options-bar-compact {
2323
scrollbar-width: thin;
2424
scrollbar-color: hsl(var(--border)) transparent;
25+
/* Smooth scrolling on mobile */
26+
-webkit-overflow-scrolling: touch;
27+
/* Prevent vertical scrolling */
28+
overflow-y: hidden;
29+
/* Ensure proper spacing */
30+
padding-right: 1rem;
2531
}
2632

2733
.options-bar-compact::-webkit-scrollbar {
@@ -41,6 +47,48 @@
4147
background-color: hsl(var(--muted-foreground));
4248
}
4349

50+
/* Mobile-specific optimizations for filter bar */
51+
@media (max-width: 768px) {
52+
.options-bar-compact {
53+
/* Hide scrollbar on mobile for cleaner look */
54+
scrollbar-width: none;
55+
-ms-overflow-style: none;
56+
/* Add padding for better touch scrolling */
57+
padding-bottom: 0.5rem;
58+
}
59+
60+
.options-bar-compact::-webkit-scrollbar {
61+
display: none;
62+
}
63+
64+
/* Ensure filter items don't wrap */
65+
.options-bar-compact > * {
66+
flex-shrink: 0;
67+
}
68+
69+
/* Slightly larger touch targets on mobile */
70+
.options-bar-compact button {
71+
min-height: 32px;
72+
min-width: 32px;
73+
}
74+
75+
/* Compact date inputs on mobile */
76+
.options-bar-compact input[type="date"] {
77+
width: 120px;
78+
font-size: 12px;
79+
}
80+
81+
/* Compact switch on mobile */
82+
.options-bar-compact .scale-75 {
83+
transform: scale(0.8);
84+
}
85+
86+
/* Ensure proper spacing between filter groups */
87+
.options-bar-compact .flex-shrink-0 {
88+
margin-right: 0.25rem;
89+
}
90+
}
91+
4492
/* Override react-grid-layout default styles to match WeWrite theme */
4593
.react-grid-layout {
4694
position: relative;

app/admin/dashboard/page.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -310,24 +310,18 @@ export default function AdminDashboardPage() {
310310
</div>
311311
) : (
312312
<>
313-
{/* Date Range and Granularity Filters */}
313+
{/* Combined Filters - Single Horizontal Row */}
314314
<DateRangeFilter
315315
dateRange={dateRange}
316316
onDateRangeChange={setDateRange}
317317
granularity={granularity}
318318
onGranularityChange={setGranularity}
319+
globalFilters={globalFilters}
320+
onGlobalFiltersChange={handleGlobalFiltersChange}
319321
className="border-0 shadow-none p-0 bg-transparent"
320322
compact={true}
323+
combined={true}
321324
/>
322-
323-
{/* Global Analytics Filters */}
324-
<div className="border-t border-border pt-4">
325-
<GlobalAnalyticsFilters
326-
filters={globalFilters}
327-
onFiltersChange={handleGlobalFiltersChange}
328-
className="w-full"
329-
/>
330-
</div>
331325
</>
332326
)}
333327
</div>

0 commit comments

Comments
 (0)