Skip to content

Commit 4f17d76

Browse files
ChefJulioclaude
andcommitted
Improve Settings page with category color customization and streamlined navigation
Settings Page Improvements: - Remove Settings from all navigation bars (sidebar, mobile bottom, hamburger menu) - Make Settings accessible ONLY via Profile page blue button - Remove redundant sections (Checklists, Data, About) - Focus on core settings: Account, Appearance, Categories Category Color Customization: - Add clickable color swatches (40x40px buttons with hover animation) - System categories: Users can customize colors via personal preferences - Custom categories: Full edit capabilities (label and color) - Individual reset buttons for system category colors - Auto-generate category keys from display labels - Fix disabled input styling (dark background, readable text) User Experience: - Color swatches replace separate edit buttons for cleaner design - JavaScript auto-generates keys from labels (no manual key entry) - Per-user color preferences stored in User.category_colors JSON field - Settings integrated into profile management workflow Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6cb76e8 commit 4f17d76

13 files changed

Lines changed: 2196 additions & 111 deletions

File tree

CLAUDE.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ Both `index()` route and `/api/checklists` endpoint use identical logic:
827827

828828
## UI/UX Guidelines
829829
- Sidebar navigation icons aligned to top (not center)
830-
- Settings gear icon positioned at bottom of sidebar
830+
- **Settings access**: ONLY via Profile page button (removed from nav bars)
831831
- All form labels must have good contrast (use #e6edf3 in dark, #1f2937 in light)
832832
- Checklist filter on All Entries dynamically shows/hides based on Task type selection
833833
- Collapsible sections use Bootstrap collapse with chevron rotation animation
@@ -914,6 +914,48 @@ Colors flow from **casual/ignorable** (green) to **urgent/obligatory** (red):
914914

915915
📚 **[Category System Documentation](docs/systems/category-system.md)** - database model, user creation, validation, legacy migration, sharing
916916

917+
## Settings Page - CRITICAL
918+
**Clean, focused settings page accessible only via user's profile page**
919+
920+
### Navigation
921+
- **❌ Removed from all navigation bars** (sidebar, mobile bottom bar, hamburger menu)
922+
- **✅ Accessible only via Profile page** - Blue "Settings" button in top-right corner
923+
- Why: Creates cleaner navigation, makes Settings part of profile management workflow
924+
925+
### Sections
926+
1. **Account** - Username, display name, password changes with collapsible forms
927+
2. **Appearance** - Theme selection (Dark/Light) with visual previews
928+
3. **Categories** - Built-in and custom category management
929+
930+
### Category Color Customization
931+
- **System categories**: Click color swatch (40x40px button) to edit color only
932+
- Color preferences stored per-user in `category_colors` JSON field
933+
- Overrides default system colors without affecting other users
934+
- Individual reset button to restore default color
935+
- **Custom categories**: Click color swatch to edit label and color
936+
- Key auto-generated from display label (lowercase, underscores for spaces)
937+
- Cannot change key after creation (immutable identifier)
938+
- Delete button (only if category not in use)
939+
940+
### UX Patterns
941+
- **Clickable color swatches**: 40x40px buttons with hover scale animation (1.1x)
942+
- **Disabled input styling**: Dark slate background (`#1e293b`) with gray text (`#94a3b8`)
943+
- **Auto-generated keys**: JavaScript converts "Gaming Stream" → "gaming_stream"
944+
- **Collapsible forms**: Username, display name, password changes hidden until clicked
945+
946+
### Critical Rules
947+
```python
948+
# ✅ System category color updates stored per-user
949+
category_colors = current_user.get_category_colors() or {}
950+
category_colors[category.key] = color
951+
current_user.set_category_colors(category_colors)
952+
953+
# ✅ Custom category keys auto-generated (never exposed to user)
954+
key = display_label.toLowerCase().replace(/[^a-z0-9\s]/g, '').trim().replace(/\s+/g, '_')
955+
```
956+
957+
**Removed sections**: Checklists, Data, About (redundant or premature)
958+
917959
## Help Me On A Higher Level
918960
- Never, ever, ever, EVER, make a bandaid, technical debt heavy correction to fix problems. ALWAYS suggest better ways to do things in a general sense if you sense one.
919961
- Think about what I'm asking for, scope out and consider if there's a better way to handle a parent issue that would fix it first

app.py

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,25 +2479,41 @@ def settings_update_colors():
24792479
"""Update category color preferences"""
24802480
from models import Category
24812481

2482-
# Check if user wants to reset to defaults
2482+
# Check if user wants to reset all to defaults
24832483
if request.form.get('reset'):
24842484
# Reset to defaults
2485-
current_user.set_category_colors(DEFAULT_CATEGORY_COLORS)
2485+
current_user.set_category_colors({})
24862486
db.session.commit()
24872487
flash("Category colors reset to defaults", "success")
24882488
return redirect(url_for('settings_view'))
24892489

2490-
# Update category colors from form (legacy support)
2491-
category_colors = current_user.get_category_colors() or DEFAULT_CATEGORY_COLORS.copy()
2490+
# Get all system categories to handle dynamically
2491+
system_categories = Category.query.filter_by(is_system=True, user_id=None).all()
24922492

2493-
for cat_key in ['event', 'meeting', 'reminder', 'birthday', 'holiday', 'movie_release', 'tv_show_release']:
2494-
color = request.form.get(f'color_{cat_key}')
2493+
# Update category colors from form
2494+
category_colors = current_user.get_category_colors() or {}
2495+
2496+
# Check if user wants to reset a specific category
2497+
for category in system_categories:
2498+
reset_key = f'reset_{category.key}'
2499+
if request.form.get(reset_key):
2500+
# Remove this category from user preferences (will use default)
2501+
if category.key in category_colors:
2502+
del category_colors[category.key]
2503+
current_user.set_category_colors(category_colors)
2504+
db.session.commit()
2505+
flash(f"'{category.display_label}' color reset to default", "success")
2506+
return redirect(url_for('settings_view'))
2507+
2508+
# Check form for any color_* fields matching system category keys
2509+
for category in system_categories:
2510+
color = request.form.get(f'color_{category.key}')
24952511
if color:
2496-
category_colors[cat_key] = color
2512+
category_colors[category.key] = color
24972513

24982514
current_user.set_category_colors(category_colors)
24992515
db.session.commit()
2500-
flash("Category colors updated successfully", "success")
2516+
flash("Category color updated successfully", "success")
25012517
return redirect(url_for('settings_view'))
25022518

25032519
@app.route("/settings/category/create", methods=["POST"])
@@ -3203,6 +3219,11 @@ def change_display_name():
32033219
flash(f"Display name changed from '{old_display_name}' to '{new_display_name}' successfully!", "success")
32043220
return redirect(url_for('settings_view'))
32053221

3222+
# ===== SOCIAL SYSTEM ROUTES =====
3223+
# Import and register social routes from separate module
3224+
from social_routes import register_social_routes
3225+
register_social_routes(app)
3226+
32063227
return app
32073228

32083229

0 commit comments

Comments
 (0)