|
1 | 1 | # 📚 ByteBox – Project Overview |
2 | 2 |
|
3 | | -**Last Updated**: March 2, 2026 |
| 3 | +**Last Updated**: March 5, 2026 |
4 | 4 | **Version**: 2.5.0 |
5 | 5 | **Author**: [Pink Pixel](https://pinkpixel.dev) |
6 | 6 | **License**: Apache 2.0 |
|
22 | 22 | - 💻 **Code-Friendly** — Syntax highlighting for 100+ languages (Shiki) |
23 | 23 | - 🖼️ **Image Storage** — Save screenshots and images with full-screen lightbox preview, download, and clipboard support |
24 | 24 | - 📋 **Copy & Delete** — One-click content copying and safe two-step card deletion |
25 | | -- 🌌 **Customize** — Glassmorphic UI with accent/icon themes, custom gradients/solids, wallpaper library or uploads, font picks, and saveable presets |
| 25 | +- 🌌 **Customize** — Glassmorphic UI with accent/icon themes, saveable custom solids/gradients, wallpaper library or uploads, font/size controls, resizable sidebar/columns, and saveable presets |
26 | 26 | - 🌫️ **Tune the Glow** — Real-time glass transparency slider that adapts blur, opacity, and shadows to your wallpaper |
27 | 27 |
|
28 | 28 | --- |
|
84 | 84 |
|
85 | 85 | A cohesive customization stack that keeps the UI consistent while giving users deep control over color, texture, and type. |
86 | 86 |
|
87 | | -- **Theme Registry (`src/lib/themeRegistry.ts`)** – Curated accent palettes (Byte Classic, Neon Night, Rainbow Sprint, Midnight Carbon, Sunset Espresso, Pastel Haze) and icon palettes (Neon Grid, Carbon Tech, Espresso Circuit, Rainbow Loop, Pink Pulse, Custom Single) plus gradient presets and built-in wallpaper data URIs. |
88 | | -- **Theme Context (`src/contexts/ThemeContext.tsx`)** – Loads settings from the database API on mount (with localStorage for instant hydration fallback), applies CSS variables (`--accent-*`, `--icon-*`, `--glass-*`, `--font-*`, background tokens), and keeps uploads/gradients/solids/presets in sync. Saves changes to both localStorage and API with 500ms debouncing. Supports 17 UI fonts and 13 mono fonts including stylized options. |
89 | | -- **Global Tokens (`src/app/globals.css`)** – Glass utilities (`.glass`, `.glass--dense`), surface helpers, accent gradients, and configurable background stack (custom gradient, preset wallpaper, or user upload). |
90 | | -- **Settings UI (`src/app/settings/page.tsx`)** – Light/dark toggle, glass slider, accent/icon pickers, custom accent builder (2–6 colors), solid + gradient background editors with angle control, wallpaper library (12 built-in wallpapers) plus upload support, UI + mono font selectors, and named presets for saving/loading the whole appearance. All settings database-backed with localStorage as hydration fallback. |
| 87 | +- **Theme Registry (`src/lib/themeRegistry.ts`)** – Curated accent palettes (Byte Classic, Neon Night, Rainbow Sprint, Midnight Carbon, Sunset Espresso, Pastel Haze) and icon palettes (Neon Grid, Carbon Tech, Espresso Circuit, Rainbow Loop, Pink Pulse, Custom Single) plus gradient presets, solid-color presets, and wallpaper metadata. |
| 88 | +- **Theme Context (`src/contexts/ThemeContext.tsx`)** – Loads settings from the database API on mount (with localStorage for instant hydration fallback), applies CSS variables (`--accent-*`, `--icon-*`, `--glass-*`, `--font-*`, sizing/width tokens, background tokens), and keeps uploads/gradients/solids/presets in sync. Saves changes to both localStorage and API with 500ms debouncing. Supports 17 UI fonts and 13 mono fonts including stylized options. |
| 89 | +- **Global Tokens (`src/app/globals.css`)** – Glass utilities (`.glass`, `.glass--dense`), surface helpers, dynamic typography classes, and configurable background stack (custom gradient, preset wallpaper, or user upload). |
| 90 | +- **Settings UI (`src/app/settings/page.tsx`)** – Glass slider, accent/icon pickers, custom accent builder (2–6 colors), solid + gradient editors with saveable custom color/gradient libraries, wallpaper library (12 built-in wallpapers) plus upload support, UI + mono font selectors, UI/body/category/card/code size controls, sidebar/column width controls, and named presets for saving/loading the whole appearance. |
91 | 91 | - **Component Integration** – Layout, cards, filters, search, and stats all subscribe to the theme hooks so changes propagate instantly across the app. |
92 | 92 |
|
93 | 93 | All customizations are database-backed with localStorage as a fast hydration layer, ensuring consistent rendering on first paint and persistence across browser sessions. |
@@ -144,7 +144,6 @@ bytebox/ |
144 | 144 | │ │ ├── Lightbox.tsx # Full-screen image preview modal |
145 | 145 | │ │ ├── SearchBar.tsx # Global search input (Cmd+K) |
146 | 146 | │ │ ├── Tag.tsx # Tag badge component |
147 | | -│ │ ├── ThemeToggle.tsx # Light/dark toggle with accent-aware styles |
148 | 147 | │ │ └── ViewModeSelector.tsx # View mode dropdown (All/Recent/Starred/By Tag) |
149 | 148 | │ │ |
150 | 149 | │ ├── contexts/ |
@@ -262,13 +261,13 @@ bytebox/ |
262 | 261 | **UserSettings** (Singleton) |
263 | 262 |
|
264 | 263 | - `id`: Fixed value "default" (singleton pattern) |
265 | | -- `mode`: Theme mode (dark/light) |
| 264 | +- `mode`: Base appearance mode value used by the theme engine |
266 | 265 | - `accentThemeId`: Selected accent theme ID |
267 | 266 | - `iconThemeId`: Selected icon theme ID |
268 | 267 | - `customIconColor`: Custom icon hex color |
269 | 268 | - `glassIntensity`: Glass transparency level (0-100) |
270 | | -- `backgroundConfig`: JSON object with background settings |
271 | | -- `fontConfig`: JSON object with UI and mono font selections |
| 269 | +- `backgroundConfig`: JSON object with active background plus saved solid-color and gradient libraries |
| 270 | +- `fontConfig`: JSON object with UI/mono font selections, UI/body/category/card/code sizes, and persisted sidebar/column widths |
272 | 271 | - `customAccentThemes`: JSON array of user-created accent themes |
273 | 272 | - `settingsPresets`: JSON array of saved settings presets |
274 | 273 | - `createdAt`: Timestamp when created |
@@ -306,18 +305,18 @@ bytebox/ |
306 | 305 | **Implementation**: |
307 | 306 |
|
308 | 307 | - `Board.tsx` wraps the entire dashboard with `DndContext` |
309 | | -- `DraggableBoard.tsx` uses CSS Grid with `repeat(n, minmax(280px, 1fr))` for responsive columns |
310 | | -- Columns stretch evenly to fill the viewport width |
311 | | -- Minimum column width of 280px ensures cards remain readable |
312 | | -- Horizontal scrolling only activates when minimum widths can't be maintained |
| 308 | +- `DraggableBoard.tsx` uses CSS Grid with user-configurable fixed column width (`repeat(n, {width}px)`) |
| 309 | +- Columns are drag-reorderable and resizeable via column-edge drag handles |
| 310 | +- Default column width is 320px and user-adjustable in Settings or by direct drag |
| 311 | +- Horizontal scrolling activates naturally as column count or width grows |
313 | 312 | - `DraggableCard.tsx` wraps each card with `useDraggable` and `useSortable` |
314 | 313 | - Drag events (`onDragStart`, `onDragEnd`) handle reordering and category changes |
315 | 314 | - On drop, PATCH `/api/cards` with updated order/categoryId |
316 | 315 | - Database updates persist the new state |
317 | 316 |
|
318 | 317 | **User Experience**: |
319 | 318 |
|
320 | | -- Columns automatically resize based on screen/viewport size |
| 319 | +- Column width is user-controlled and persisted as part of appearance settings/presets |
321 | 320 | - Drag cards within a category to reorder |
322 | 321 | - Drag cards between categories to move them |
323 | 322 | - Visual feedback with hover states and active indicators |
@@ -381,14 +380,14 @@ bytebox/ |
381 | 380 | - `syntax.ts` initializes Shiki with multiple languages |
382 | 381 | - `CodeBlock.tsx` renders highlighted code blocks |
383 | 382 | - Supports 100+ languages via validated dropdown (JavaScript, Python, Go, Rust, etc.) |
384 | | -- Light and dark themes match app theme |
| 383 | +- Syntax theme tokens follow the active appearance profile |
385 | 384 | - Copy-to-clipboard button for easy code copying |
386 | 385 |
|
387 | 386 | **User Experience**: |
388 | 387 |
|
389 | 388 | - Code snippets are beautifully highlighted |
390 | 389 | - One-click copy to clipboard |
391 | | -- Theme-aware (dark/light mode) |
| 390 | +- Theme-aware color tokens from the current appearance profile |
392 | 391 |
|
393 | 392 | --- |
394 | 393 |
|
@@ -501,54 +500,52 @@ bytebox/ |
501 | 500 |
|
502 | 501 | --- |
503 | 502 |
|
504 | | -### 8️⃣ Dark Mode & Theme System |
| 503 | +### 8️⃣ Appearance & Theme System |
505 | 504 |
|
506 | 505 | **Technology**: React Context API + localStorage |
507 | 506 |
|
508 | 507 | **Implementation**: |
509 | 508 |
|
510 | | -- `ThemeContext.tsx` manages base mode, accent theme, icon palette, custom icon color, wallpaper, and the new glass intensity state (0–100). |
| 509 | +- `ThemeContext.tsx` manages the appearance profile, accent theme, icon palette, custom icon color, wallpaper, and glass intensity state (0–100). |
511 | 510 | - Preferences persist to localStorage (`bytebox-*`) and hydrate once the app mounts. |
512 | | -- System preference detection (respects OS theme) |
513 | | -- `ThemeToggle.tsx` renders the sole sun/moon icon button for mode switching |
514 | | -- Tailwind CSS `dark:` classes style components |
515 | | -- Logo shadow effects are mode-aware (dark mode uses drop-shadow, light mode uses none to prevent visual artifacts) |
| 511 | +- Tailwind + CSS variable tokens style components consistently across customized appearances |
| 512 | +- Logo shadow effects are appearance-aware (drop-shadow is only applied where it improves clarity) |
516 | 513 |
|
517 | 514 | **User Experience**: |
518 | 515 |
|
519 | | -- Dark mode is the default |
520 | | -- Click the icon toggle to switch bases—no duplicate buttons in Settings |
521 | 516 | - Drag the Glass Transparency slider to move from airy to frosted instantly |
522 | 517 | - All theme settings persist across sessions with smooth transitions |
523 | 518 |
|
524 | 519 | --- |
525 | 520 |
|
526 | | -### 9️⃣ Collapsible Sidebar |
| 521 | +### 9️⃣ Collapsible + Resizable Sidebar |
527 | 522 |
|
528 | 523 | **Technology**: React state + Tailwind CSS transitions + Next.js Link |
529 | 524 |
|
530 | 525 | **Implementation**: |
531 | 526 |
|
532 | | -- `AppLayout.tsx` manages `sidebarOpen` state for expand/collapse behavior |
| 527 | +- `AppLayout.tsx` manages both `sidebarOpen` (expand/collapse) and persisted `sidebarWidth` |
533 | 528 | - Uses Next.js `Link` component for all sidebar navigation (Dashboard, Search, Tags, Settings) |
534 | 529 | - Client-side navigation preserves React state and theme settings across page transitions |
535 | | -- Sidebar transitions smoothly between 320px (expanded) and 96px (collapsed) widths |
| 530 | +- Sidebar transitions between a user-configurable expanded width (240–460px, default 240px) and 96px collapsed width |
536 | 531 | - **Logo Switching**: |
537 | 532 | - Expanded: Shows full `logo_banner.png` (240×120) |
538 | 533 | - Collapsed: Shows square `icon.png` (48×48) |
539 | | - - Both logos use React `key` prop with current mode to prevent rendering issues on theme switch |
540 | | -- **Toggle Button**: |
| 534 | + - Both logos use a stable React `key` strategy to avoid visual rendering artifacts during appearance updates |
| 535 | +- **Sidebar Button**: |
541 | 536 | - Uses `ChevronLeftIcon` when expanded (indicates collapse) |
542 | 537 | - Uses `ChevronRightIcon` when collapsed (indicates expand) |
543 | 538 | - Dynamic `aria-label` for accessibility |
544 | 539 | - **Layout Adaptation**: |
545 | 540 | - Collapsed state uses vertical flex layout (`flex-col`) to center icon and button |
546 | 541 | - Navigation items hide text labels when collapsed, showing only icons |
547 | 542 | - Export/Import section and Quick Add text hidden when collapsed |
| 543 | + - Expanded width can be changed by dragging the sidebar edge and is saved in settings/presets |
548 | 544 |
|
549 | 545 | **User Experience**: |
550 | 546 |
|
551 | 547 | - Click chevron arrow to collapse/expand sidebar |
| 548 | +- Drag the right edge of the sidebar to resize it |
552 | 549 | - Icons-only view when collapsed saves screen space |
553 | 550 | - Square logo icon maintains branding in collapsed state |
554 | 551 | - Smooth 300ms transition animation |
@@ -602,10 +599,10 @@ bytebox/ |
602 | 599 | | -------------------- | --------- | --------------------------------------- | |
603 | 600 | | **Pink** | `#ec4899` | Primary accent, gradients, focus states | |
604 | 601 | | **Purple** | `#8b5cf6` | Secondary accent, gradients | |
605 | | -| **Dark Background** | `#0a0a0a` | Main background (dark mode) | |
606 | | -| **Light Background** | `#ffffff` | Main background (light mode) | |
607 | | -| **Text Dark** | `#1f2937` | Primary text (light mode) | |
608 | | -| **Text Light** | `#f9fafb` | Primary text (dark mode) | |
| 602 | +| **Surface Base** | `#0a0a0a` | Primary app background surface | |
| 603 | +| **Surface Contrast** | `#ffffff` | High-contrast background/surface option | |
| 604 | +| **Text Primary Dark**| `#1f2937` | Dark text token for bright surfaces | |
| 605 | +| **Text Primary Light** | `#f9fafb` | Light text token for deep surfaces | |
609 | 606 |
|
610 | 607 | ### Typography |
611 | 608 |
|
@@ -738,7 +735,7 @@ npm run dev # → http://localhost:3000 |
738 | 735 | - [ ] Build succeeds (`npm run build`) |
739 | 736 | - [ ] Manual testing (drag & drop, search, filters, etc.) |
740 | 737 | - [ ] Export/import works |
741 | | -- [ ] Theme toggle works |
| 738 | +- [ ] Appearance settings apply and persist |
742 | 739 | - [ ] Keyboard shortcuts work (`Cmd+K`, `ESC`) |
743 | 740 |
|
744 | 741 | --- |
|
0 commit comments