ObsiViewer/docs/NOTES_LIST_ENHANCEMENT.md

5.7 KiB

Notes-List Component Enhancement - Documentation

🎯 Overview

The notes-list component has been enhanced with professional UX/UI improvements inspired by modern note-taking applications like Nimbus Notes.

New Features

1. Path Indicator with Folder Display

  • Shows the current folder path when a folder is selected
  • Displays folder icon and name
  • Appears only when a folder filter is active
  • Styled with subtle background for visual hierarchy

2. Sort Menu

  • Options: Title, Created Date, Updated Date
  • Dropdown menu accessible via sort icon
  • Current selection highlighted
  • Smooth transitions and hover effects

3. View Mode Menu

  • Options: Compact, Comfortable, Detailed
  • Dropdown menu accessible via grid icon
  • Persistent state management
  • Different layouts for each mode:
    • Compact: Title only (minimal height)
    • Comfortable: Title + File path (default)
    • Detailed: Title + Path + Status + Date

4. Request Status Indicator

  • Shows success () or error () status
  • Displays request duration in milliseconds
  • Green for success, red for errors
  • Appears below search bar
  • Real-time updates

5. New Note Button

  • Located right of search bar
  • Creates new note in current folder
  • Auto-generates unique filename
  • Opens note immediately after creation
  • Includes default YAML frontmatter:
    ---
    titre: <filename>
    auteur: Bruno Charest
    creation_date: <ISO timestamp>
    modification_date: <ISO timestamp>
    status: en-cours
    publish: false
    favoris: false
    template: false
    task: false
    archive: false
    draft: false
    private: false
    ---
    

📦 New Services

NotesListStateService

Location: src/app/services/notes-list-state.service.ts

Manages component state with Angular signals:

  • sortBy: Current sort mode (title, created, updated)
  • viewMode: Current view mode (compact, comfortable, detailed)
  • lastRequestStats: Request timing and status
  • isLoading: Loading state

Methods:

  • setSortBy(sort: SortBy): Update sort mode
  • setViewMode(mode: ViewMode): Update view mode
  • setRequestStats(success: boolean, duration: number): Update request stats
  • setLoading(loading: boolean): Update loading state

NoteCreationService

Location: src/app/services/note-creation.service.ts

Handles note creation with proper frontmatter:

  • createNote(fileName, folderPath, author?, additionalFrontmatter?): Create new note
  • generateUniqueFileName(baseName, existingFiles): Generate unique filename
  • formatFrontmatterYAML(frontmatter): Format frontmatter to YAML

🎨 UI/UX Details

Styling

  • Theme Support: Full dark/light mode support
  • Colors: Uses existing theme colors (primary, surface1, card, etc.)
  • Icons: SVG inline icons (no external dependencies)
  • Transitions: Smooth hover and menu transitions
  • Responsive: Hides "Nouvelle note" text on mobile (shows icon only)

Layout

  • Header Section: Filters, path indicator, search, buttons
  • Status Bar: Request status indicator
  • List Container: Scrollable note list with different views
  • Menus: Dropdown menus with proper z-index management

Interactions

  • Sort Menu: Closes when view mode menu opens (mutually exclusive)
  • View Mode Menu: Closes when sort menu opens
  • Search: Real-time filtering with request timing
  • New Note: Creates and opens immediately

🔧 Integration

Prerequisites

  • Angular 17+ with signals support
  • Existing NotesListComponent in place
  • TagFilterStore available
  • Tailwind CSS configured

Files Modified

  • src/app/features/list/notes-list.component.ts - Enhanced with new features

Files Created

  • src/app/services/notes-list-state.service.ts - State management
  • src/app/services/note-creation.service.ts - Note creation logic

No Breaking Changes

  • All existing inputs/outputs preserved
  • Backward compatible with existing parent components
  • Optional features (don't affect existing functionality)

📊 Performance

Change Detection

  • Uses ChangeDetectionStrategy.OnPush for optimal performance
  • Signals-based reactivity (no zone.js overhead)
  • Computed properties for filtered lists

Memory

  • Minimal state footprint
  • No memory leaks (proper cleanup)
  • Efficient signal updates

🧪 Testing

Manual Testing Checklist

  • Sort by Title works correctly
  • Sort by Created Date works correctly
  • Sort by Updated Date works correctly
  • View mode Compact displays correctly
  • View mode Comfortable displays correctly
  • View mode Detailed displays correctly
  • Path indicator shows correct folder name
  • New Note button creates note with correct frontmatter
  • Request status indicator shows timing
  • Menus close properly when clicking elsewhere
  • Dark/light theme works correctly
  • Mobile responsive (button text hidden on small screens)

🚀 Future Enhancements

Potential improvements for future versions:

  • Keyboard shortcuts for sort/view mode switching
  • Drag-and-drop to reorder notes
  • Bulk actions (select multiple notes)
  • Custom sort orders
  • Saved view preferences
  • Search history
  • Note templates

📝 Notes

  • The component maintains backward compatibility
  • All new features are optional
  • State is managed locally (no persistence yet)
  • Request stats are simulated (can be connected to real API calls)
  • Frontmatter author is hardcoded to "Bruno Charest" (can be made configurable)
  • Parent component: src/app/layout/app-shell-nimbus/app-shell-nimbus.component.ts
  • Types: src/types.ts (Note, NoteFrontmatter)
  • Stores: src/app/core/stores/tag-filter.store.ts

Created: 2025-10-23
Version: 1.0
Status: Production Ready