Skip to content

Commit 63ea4e5

Browse files
committed
feat: πŸ› Fix theme persistence and sidebar navigation issues; set dark mode as default and enhance client-side routing
1 parent 99c0ebc commit 63ea4e5

File tree

3 files changed

+56
-4
lines changed

3 files changed

+56
-4
lines changed

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
---
99

10+
## [2.1.1] - 2025-12-01
11+
12+
### πŸ› Bug Fixes: Theme Persistence & Navigation
13+
14+
This patch release fixes critical theme persistence issues where the dark theme wasn't being applied as default and theme settings would reset when clicking sidebar navigation buttons.
15+
16+
#### Fixed
17+
- **Dark Theme Not Default** – Fixed `getUserSettings()` in `queries.ts` to use correct default values when creating new user settings:
18+
- Changed `mode` default from `'light'` to `'dark'`
19+
- Changed `accentThemeId` default from `'default'` to `'byte-classic'`
20+
- Changed `iconThemeId` default from `'default'` to `'neon-grid'`
21+
- Changed `glassIntensity` default from `0` to `60`
22+
- Changed `customIconColor` default from `''` to `'#f472b6'`
23+
- Changed `backgroundConfig` default from `'{}'` to `'{"type":"default"}'`
24+
- Changed `fontConfig` default from `'{}'` to `'{"uiFont":"system","monoFont":"geist-mono"}'`
25+
- **Theme Reset on Sidebar Click** – Fixed sidebar navigation causing full page reloads which reset theme to API defaults
26+
- **Root Cause**: Sidebar navigation items used `<a href={...}>` tags instead of Next.js `<Link>` component
27+
- **Solution**: Changed all sidebar navigation items in `AppLayout.tsx` from `<a>` to `<Link>` for proper client-side navigation
28+
- Previously clicking Dashboard, Search, Tags, or Settings would trigger a full page reload
29+
- Now navigation is instant and preserves all React state including theme settings
30+
31+
#### Technical Details
32+
- **Modified Files**:
33+
- `src/lib/db/queries.ts`: Fixed `getUserSettings()` default values
34+
- `src/components/layout/AppLayout.tsx`: Changed `<a>` tags to `<Link>` components for sidebar nav
35+
- **Database**: Cleared existing `user_settings` row to allow fresh creation with correct defaults
36+
- **Import Added**: `import Link from 'next/link'` in AppLayout.tsx
37+
38+
#### Migration Notes
39+
- Users should hard refresh their browser (Ctrl+Shift+R / Cmd+Shift+R) after updating
40+
- If theme issues persist, clear localStorage keys starting with `bytebox-` or clear site data
41+
- New installations will automatically use dark theme as default
42+
43+
---
44+
1045
## [2.1.0] - 2025-12-01
1146

1247
### 🎨 Card Modal Editing & UX Improvements

β€ŽOVERVIEW.mdβ€Ž

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# πŸ“š ByteBox – Project Overview
22

33
**Last Updated**: December 1, 2025
4-
**Version**: 2.1.0
4+
**Version**: 2.1.1
55
**Author**: [Pink Pixel](https://pinkpixel.dev)
66
**License**: Apache 2.0
77
**Status**: βœ… Stable & Complete
@@ -126,7 +126,7 @@ bytebox/
126126
β”‚ β”‚ β”‚ β”œβ”€β”€ CreateCardModal.tsx # New card creation modal with file upload and dark theme support
127127
β”‚ β”‚ β”‚ └── DraggableCard.tsx # Card with @dnd-kit drag wrapper
128128
β”‚ β”‚ β”œβ”€β”€ layout/ # Layout components
129-
β”‚ β”‚ β”‚ β”œβ”€β”€ AppLayout.tsx # Main app shell (sidebar, header, collapsible with icon/banner logo)
129+
β”‚ β”‚ β”‚ β”œβ”€β”€ AppLayout.tsx # Main app shell (sidebar with Next.js Link navigation, header, collapsible with icon/banner logo)
130130
β”‚ β”‚ β”‚ β”œβ”€β”€ Board.tsx # Kanban board wrapper (drag context)
131131
β”‚ β”‚ β”‚ └── DraggableBoard.tsx # Board with @dnd-kit drop zones and CSS Grid columns
132132
β”‚ β”‚ └── ui/ # Reusable UI components
@@ -489,10 +489,12 @@ bytebox/
489489

490490
### 9️⃣ Collapsible Sidebar
491491

492-
**Technology**: React state + Tailwind CSS transitions
492+
**Technology**: React state + Tailwind CSS transitions + Next.js Link
493493

494494
**Implementation**:
495495
- `AppLayout.tsx` manages `sidebarOpen` state for expand/collapse behavior
496+
- Uses Next.js `Link` component for all sidebar navigation (Dashboard, Search, Tags, Settings)
497+
- Client-side navigation preserves React state and theme settings across page transitions
496498
- Sidebar transitions smoothly between 320px (expanded) and 96px (collapsed) widths
497499
- **Logo Switching**:
498500
- Expanded: Shows full `logo_banner.png` (240Γ—120)

β€ŽROADMAP.mdβ€Ž

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ByteBox Development Roadmap πŸ—ΊοΈ
22

33
**Last Updated:** December 1, 2025
4-
**Current Version:** 2.1.0
4+
**Current Version:** 2.1.1
55
**Next Version:** 2.2.0 (Planned - Phase 4)
66
**Status:** πŸš€ Active Development
77

@@ -85,6 +85,16 @@ _No features currently in progress. Ready for Phase 4!_
8585

8686
## βœ… Recently Completed
8787

88+
### v2.1.1: Theme Persistence & Navigation Fixes πŸ›
89+
**Status:** βœ… Complete (2025-12-01)
90+
**Priority:** Critical
91+
**Released:** v2.1.1
92+
93+
Critical bug fixes for theme persistence and sidebar navigation:
94+
- **Dark Theme Default** - Fixed `getUserSettings()` to use correct default values (dark mode, byte-classic accent, neon-grid icons, etc.)
95+
- **Sidebar Navigation** - Changed `<a>` tags to Next.js `<Link>` component for client-side navigation
96+
- **Theme No Longer Resets** - Sidebar clicks now preserve React state instead of triggering full page reloads
97+
8898
### v2.1.0: Card Modal Editing & UX Improvements 🎨
8999
**Status:** βœ… Complete (2025-12-01)
90100
**Priority:** High
@@ -319,6 +329,7 @@ Make ByteBox fully responsive and mobile-friendly with proper touch interactions
319329
| Customizable Dashboard | βœ… Complete | 1.5.0 | 2025-11-29 |
320330
| Database-Backed Settings | βœ… Complete | 2.0.0 | 2025-12-01 |
321331
| Appearance Overhaul | βœ… Complete | 2.0.0 | 2025-12-01 |
332+
| Theme Persistence Fix | βœ… Complete | 2.1.1 | 2025-12-01 |
322333
| Category Pages | πŸ’­ Concept | TBD | TBD |
323334
| Quick Links Bar | πŸ’­ Concept | TBD | TBD |
324335
| Mobile App Layout | πŸ’­ Concept | TBD | TBD |
@@ -382,6 +393,10 @@ Make ByteBox fully responsive and mobile-friendly with proper touch interactions
382393
- βœ… Prisma 7 upgrade with better-sqlite3 adapter
383394
- βœ… Custom accent themes persistence
384395
- βœ… Settings presets persistence
396+
7. βœ… ~~**Theme Persistence & Navigation Fixes**~~ DONE (v2.1.1)
397+
- βœ… Fixed default theme settings (dark mode default)
398+
- βœ… Fixed sidebar navigation to use Next.js Link
399+
- βœ… Theme no longer resets on sidebar clicks
385400

386401
### Upcoming Sprint (Phase 4)
387402
1. **Category-Specific Pages** πŸ“‘ (Next Priority)

0 commit comments

Comments
Β (0)