|
| 1 | +# Changelog - PR #207: Dashboard UI Overhaul |
| 2 | + |
| 3 | +**PR**: [#207](https://github.com/databuddy-analytics/Databuddy/pull/207) |
| 4 | +**Title**: Redesign the dashboard entirely |
| 5 | +**Merged**: December 2, 2025 |
| 6 | +**Commits**: 181 |
| 7 | +**Files Changed**: 354 |
| 8 | +**Additions**: +24,892 | **Deletions**: -23,838 |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## 🎨 Dashboard & UI |
| 13 | + |
| 14 | +### New Components |
| 15 | +- **RightSidebar**: Reusable right-hand sidebar component with sections, info cards, docs links, and tips |
| 16 | +- **ChartTooltip**: Unified tooltip component for charts with consistent styling |
| 17 | +- **DeleteDialog**: Reusable confirmation dialog for deletion actions with optional text input for confirmation |
| 18 | +- **LineSlider**: Slider component for selecting values along a line |
| 19 | +- **SegmentedControl**: Segmented control component for selecting options |
| 20 | +- **KeyboardShortcuts**: Component to display keyboard shortcuts for better accessibility |
| 21 | +- **TableEmptyState**: Standardized empty state for tables |
| 22 | +- **EmptyState**: Reusable empty state component with customizable icon, title, description, and action button |
| 23 | +- **PageHeader**: Reusable component for displaying page titles, descriptions, and optional action buttons |
| 24 | +- **ChartContainer** & **ChartTooltip**: Consistent chart rendering components |
| 25 | + |
| 26 | +### UI Refresh |
| 27 | +- Extensive styling updates across all `components/ui/*` components: |
| 28 | + - Badges, buttons, tables, sheets, dialogs, tooltips, inputs, tabs |
| 29 | + - Improved hover states and focus rings |
| 30 | + - Better mobile responsiveness |
| 31 | + - Consistent rounded corners (`rounded` instead of `rounded-xl` or `rounded-md`) |
| 32 | + - Updated color schemes and CSS variables |
| 33 | +- Refreshed global styles in `globals.css` with new CSS variables for colors, font sizes, and component styles |
| 34 | +- Updated authentication pages (login, register, forgot password, magic link) with modern styling |
| 35 | +- Improved organization settings pages with better layouts and consistent spacing |
| 36 | + |
| 37 | +### Dashboard Pages |
| 38 | +- **Billing Pages**: Refactored billing overview, cost breakdown, and history pages |
| 39 | + - Replaced custom empty states with `EmptyState` component |
| 40 | + - Refactored sidebars to use `RightSidebar` component |
| 41 | + - Updated usage tables with better styling |
| 42 | + - Improved invoice display and status badges |
| 43 | +- **Organization Pages**: Complete redesign of organization management |
| 44 | + - Members list with improved role badges |
| 45 | + - Invitations view with better status indicators |
| 46 | + - API keys UI overhaul with scope display and better detail views |
| 47 | + - Website settings with improved layout |
| 48 | + - Danger zone with confirmation dialogs |
| 49 | +- **Settings Pages**: New comprehensive settings structure |
| 50 | + - **Account Settings**: Profile photo, basic information, security (2FA, password), connected identities |
| 51 | + - **Appearance Settings**: Theme selection (light/dark/system), chart preferences with preview |
| 52 | + - **Placeholder Pages**: Analytics, Notifications, Privacy, Features, Integrations (coming soon) |
| 53 | + - **Two-Factor Authentication**: Complete 2FA setup and management dialog with QR codes and backup codes |
| 54 | + |
| 55 | +--- |
| 56 | + |
| 57 | +## 🔍 Analytics & Queries |
| 58 | + |
| 59 | +### Filter Improvements |
| 60 | +- **New Filter Operators**: |
| 61 | + - `contains`, `not_contains`, `starts_with`, `in`, `not_in` |
| 62 | + - Removed old operators: `like`, `ilike`, `notLike`, `gt`, `gte`, `lt`, `lte`, `isNull`, `isNotNull` |
| 63 | +- **Query String Support**: Added `query_string` to common filters and allowed filters for page-related queries |
| 64 | +- **Saved Filters**: Complete saved filters system |
| 65 | + - Add, save/rename, apply, duplicate, and manage saved query filters |
| 66 | + - New components: `AddFilters`, `FiltersSection`, `SaveFilterDialog`, `SavedFiltersMenu` |
| 67 | + - Filter hooks: `useFilters`, `useSavedFilters` |
| 68 | +- **LIKE Pattern Escaping**: Proper escaping of special characters in LIKE patterns |
| 69 | +- **GLOBAL_ALLOWED_FILTERS**: Certain filters now allowed globally regardless of query builder configuration |
| 70 | + |
| 71 | +### Query Architecture Migration |
| 72 | +- **Span-Based Tables**: Migrated vitals, errors, and custom events to span-based tables |
| 73 | + - `error_spans`, `web_vitals_spans`, `custom_event_spans` |
| 74 | + - Better support for aggregations with quantile functions |
| 75 | + - Hourly aggregate tables: `error_hourly`, `web_vitals_hourly`, `custom_events_hourly` |
| 76 | +- **New Query Builders**: |
| 77 | + - `VitalsBuilders`: `vitals_overview`, `vitals_time_series`, `vitals_by_page` |
| 78 | + - `custom_events_by_path`: Counts custom events by path |
| 79 | + - `custom_events_trends`: Daily trends of custom events |
| 80 | + - `errors_by_type`: Counts errors by type |
| 81 | +- **Updated Query Builders**: |
| 82 | + - Error queries migrated to `error_spans` table |
| 83 | + - Vitals queries migrated to `web_vitals_spans` table with EAV format |
| 84 | + - Custom events queries migrated to `custom_event_spans` table |
| 85 | + - All queries now join with `analytics.events` for context (browser, OS, country, region) |
| 86 | +- **Aggregate Functions**: |
| 87 | + - Added `quantile`, `quantileIf`, `minIf`, `maxIf` to aggregate builder |
| 88 | + - Used for richer metric aggregations (p50, p75, p90, p95, p99) |
| 89 | + |
| 90 | +### Analytics Processing |
| 91 | +- Simplified funnel/goal analytics processing |
| 92 | +- Improved referrer grouping |
| 93 | +- Support for `ignoreHistoricData` flag |
| 94 | +- Better referrer attribution logic |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +## 🌐 Websites & Billing |
| 99 | + |
| 100 | +### Active Users |
| 101 | +- Added `activeUsers` field to website schema and type |
| 102 | +- Active users per website now returned alongside mini-chart data |
| 103 | +- Improved billing usage aggregation |
| 104 | + |
| 105 | +### Billing Improvements |
| 106 | +- Better usage breakdown table with badge display for overage costs |
| 107 | +- Improved consumption chart with date range picker and view modes |
| 108 | +- Enhanced usage row display with bonus badges |
| 109 | + |
| 110 | +--- |
| 111 | + |
| 112 | +## 📤 Exports |
| 113 | + |
| 114 | +- Date range validation for exports |
| 115 | +- Improved proto/CSV formatting |
| 116 | +- Centralized data fetch logic |
| 117 | +- Better error handling and validation |
| 118 | + |
| 119 | +--- |
| 120 | + |
| 121 | +## 📦 SDK & Tracker |
| 122 | + |
| 123 | +### SDK Updates |
| 124 | +- **Version Bump**: SDK bumped to `2.3.0` |
| 125 | +- Refined script injection (excludes server-only props) |
| 126 | +- Updated README with better documentation |
| 127 | + |
| 128 | +### Tracker Improvements |
| 129 | +- **Error Filtering**: |
| 130 | + - Skip localhost errors unless in debug mode |
| 131 | + - Better error filtering (ignores browser extensions and generic "Script error.") |
| 132 | + - Improved error batching |
| 133 | +- **Performance**: |
| 134 | + - Improved batching/beacon usage |
| 135 | + - Better FPS capture for vitals |
| 136 | + - Vitals FPS batching and processing |
| 137 | + |
| 138 | +--- |
| 139 | + |
| 140 | +## 🔐 Authentication & Security |
| 141 | + |
| 142 | +### Two-Factor Authentication |
| 143 | +- Complete 2FA setup and management |
| 144 | +- Multi-step dialog flow: |
| 145 | + 1. Set password (for OAuth users) |
| 146 | + 2. Enter current password |
| 147 | + 3. Scan QR code |
| 148 | + 4. Verify TOTP |
| 149 | + 5. Save backup codes |
| 150 | + 6. Manage 2FA (disable, regenerate backup codes) |
| 151 | +- Uses `QRCodeSVG` for QR code generation |
| 152 | +- `InputOTP` component for code input |
| 153 | +- Database schema updated with `twoFactorEnabled`, `twoFactorSecret`, `twoFactorBackupCodes` |
| 154 | + |
| 155 | +### Account Management |
| 156 | +- **Password Management**: Change password functionality with validation |
| 157 | +- **OAuth Users**: Ability to set password for OAuth-only accounts before enabling 2FA |
| 158 | +- **Connected Identities**: Display and manage linked social accounts (link/unlink) |
| 159 | +- **Profile Updates**: Improved profile form with unsaved changes tracking |
| 160 | + |
| 161 | +### Session Management |
| 162 | +- Removed `AuthGuard` from main layout (handled elsewhere) |
| 163 | +- Simplified session fetching logic |
| 164 | + |
| 165 | +--- |
| 166 | + |
| 167 | +## 🧪 Testing & Types |
| 168 | + |
| 169 | +### E2E Tests |
| 170 | +- Updated tests for batching, SPA navigation, sampling/filters |
| 171 | +- Improved test coverage for new filter operators |
| 172 | + |
| 173 | +### Type Updates |
| 174 | +- Updated `DynamicQueryFilter` type for new operators |
| 175 | +- Added `activeUsers` to `Website` type |
| 176 | +- Updated validation schemas for new span-based event types |
| 177 | +- Refined shared types and filter lists |
| 178 | + |
| 179 | +--- |
| 180 | + |
| 181 | +## 📚 Documentation |
| 182 | + |
| 183 | +- Added Bento section to docs |
| 184 | +- Multiple copy/style tweaks |
| 185 | +- Improved documentation structure |
| 186 | + |
| 187 | +--- |
| 188 | + |
| 189 | +## 🛠️ Infrastructure & Backend |
| 190 | + |
| 191 | +### API Changes |
| 192 | +- Updated `getAccessibleWebsites` logic for API key access |
| 193 | +- Modified `getTimeUnit` to throw error if hourly granularity exceeds `MAX_HOURLY_DAYS` |
| 194 | +- Adjusted `parseParam` for dynamic query parameters |
| 195 | +- Updated `/types` endpoint to include `allowedFilters` from `filterOptions` |
| 196 | +- Modified `/compile` and `/` (execute) endpoints to use `website_id` and `timezone` from query parameters |
| 197 | + |
| 198 | +### Database Schema |
| 199 | +- Updated analytics table mappings to use new span-based and hourly aggregate tables |
| 200 | +- Removed old `errors`, `web_vitals`, `stripe_*` tables |
| 201 | +- Added 2FA fields to user schema |
| 202 | + |
| 203 | +### ClickHouse |
| 204 | +- Updated backup metadata to escape LIKE special characters |
| 205 | +- Added `s3_use_virtual_addressing = false` to backup/restore queries |
| 206 | +- Improved query performance with span-based tables |
| 207 | + |
| 208 | +### RPC Updates |
| 209 | +- Updated API keys procedures to include `scopes` in responses |
| 210 | +- Added `twoFactor` procedures: `enable`, `verifyTotp`, `generateBackupCodes`, `disable` |
| 211 | +- Added `changePassword` procedure |
| 212 | +- Updated websites procedures to include `activeUsers` |
| 213 | + |
| 214 | +--- |
| 215 | + |
| 216 | +## 🎯 Key Improvements |
| 217 | + |
| 218 | +### User Experience |
| 219 | +- **Keyboard Navigation**: Full keyboard support with visible focus rings |
| 220 | +- **Mobile Responsiveness**: Better mobile layouts and touch targets |
| 221 | +- **Optimistic UI**: Improved loading states and feedback |
| 222 | +- **Accessibility**: Better ARIA labels, semantic HTML, and screen reader support |
| 223 | + |
| 224 | +### Performance |
| 225 | +- More efficient queries with span-based tables |
| 226 | +- Better batching in tracker |
| 227 | +- Reduced re-renders with improved state management |
| 228 | +- Optimized chart rendering |
| 229 | + |
| 230 | +### Developer Experience |
| 231 | +- Reusable components reduce code duplication |
| 232 | +- Better type safety with updated TypeScript types |
| 233 | +- Centralized filter management |
| 234 | +- Improved code organization |
| 235 | + |
| 236 | +--- |
| 237 | + |
| 238 | +## 🐛 Bug Fixes |
| 239 | + |
| 240 | +- Fixed conflicting records in database |
| 241 | +- Fixed layout shift on refresh |
| 242 | +- Fixed skeleton loading issues |
| 243 | +- Fixed export escaping |
| 244 | +- Fixed keyboard font styling |
| 245 | +- Fixed 1px misalignment issues |
| 246 | +- Fixed type errors |
| 247 | +- Fixed organization slider |
| 248 | +- Fixed website settings page |
| 249 | +- Fixed transfer website dialog |
| 250 | +- Removed duplicate `setPasswordForOAuthUser` function |
| 251 | + |
| 252 | +--- |
| 253 | + |
| 254 | +## 🗑️ Removals & Deprecations |
| 255 | + |
| 256 | +- Removed `WARP.md` file |
| 257 | +- Removed `@elysiajs/cron` dependency |
| 258 | +- Removed `connection_type` query builder (replaced with device types) |
| 259 | +- Deprecated performance page (functionality moved to vitals page) |
| 260 | +- Removed old settings components (refactored into new structure): |
| 261 | + - `account-deletion.tsx`, `email-form.tsx`, `password-form.tsx`, `profile-form.tsx` |
| 262 | + - `sessions-form.tsx`, `settings-sidebar.tsx`, `timezone-preferences.tsx`, `two-factor-form.tsx` |
| 263 | +- Removed old filter components (replaced with new filter system): |
| 264 | + - `delete-all-dialog.tsx`, `delete-filter-dialog.tsx`, `filters-section.tsx`, `add-filters.tsx` |
| 265 | + |
| 266 | +--- |
| 267 | + |
| 268 | +## 📊 Statistics |
| 269 | + |
| 270 | +- **Total Changes**: 354 files changed |
| 271 | +- **Code Added**: +24,892 lines |
| 272 | +- **Code Removed**: -23,838 lines |
| 273 | +- **Net Change**: +1,054 lines |
| 274 | +- **Commits**: 181 commits |
| 275 | +- **Review Comments**: 120 review comments |
| 276 | + |
| 277 | +--- |
| 278 | + |
| 279 | +## 🙏 Contributors |
| 280 | + |
| 281 | +- **@izadoesdev** - Primary developer |
| 282 | +- **@ameer2468** - Collaborator |
| 283 | + |
| 284 | +--- |
| 285 | + |
| 286 | +## 🔗 Related |
| 287 | + |
| 288 | +- [PR #207](https://github.com/databuddy-analytics/Databuddy/pull/207) |
| 289 | +- [Commit: 949003d2e8004eed8b06dcff38309d3ce58b446a](https://github.com/databuddy-analytics/Databuddy/commit/949003d2e8004eed8b06dcff38309d3ce58b446a) |
| 290 | + |
0 commit comments