component sidebar - OldStarchy/dnd GitHub Wiki

Sidebar Component

Purpose

The Sidebar provides primary navigation and quick access to essential game management functions. It serves as the main interface for room settings, character management, and navigation between different views of the game session.

User Stories Addressed

GM Stories

  • I want to be able to invite players to my "room" without hassle of sign-ups
  • I want to manage encounter participant's (PC's and NPC's) statuses and turn order
  • I want to give players the ability to manage their own character information

Player Stories

  • I want to be able to join the GM's room easily
  • I want to record and reference information about my character

Core Features

Navigation

  • Primary Views: Switch between Initiative Table, Character Management, and Session Notes
  • Quick Actions: Fast access to common tasks (add character, advance turn, etc.)
  • Room Information: Display current room code and session details

Room Management

  • Room Code Display: Easy sharing of room access codes
  • Player List: Show connected participants and their status
  • Session Controls: Start/pause/end session functionality

Character Quick Access

  • Character List: Overview of all characters in the session
  • Quick Health Updates: Rapid health/status adjustments
  • Add/Remove Characters: Character management controls

States & Variations

Sidebar States

  • Expanded: Full navigation and information display
  • Collapsed: Icon-only view for more screen space
  • Mobile Overlay: Full-screen overlay on mobile devices

User Role Variations

  • GM View: Full administrative controls and all character access
  • Player View: Limited to own character and permitted information

Connection States

  • Connected: Full functionality available
  • Connecting: Limited functionality with loading indicators
  • Offline: Cached information only, sync pending

Wireframes

Desktop View

Sidebar Desktop

Mobile View

Sidebar Mobile

General Layout

Sidebar Overview

Interactions

Navigation Interactions

  • Click section headers: Navigate to different app views
  • Hover effects: Visual feedback for interactive elements
  • Collapse/Expand: Toggle sidebar width for more content space

Room Management Interactions

  • Copy room code: One-click sharing of room access
  • Player status: Click to see connection status and permissions
  • Session controls: Start/pause/end session with confirmation

Character Management Interactions

  • Quick health edit: Click health values for rapid updates
  • Character selection: Select characters to view in main content
  • Add character: Quick character creation workflow

Mobile-Specific Interactions

  • Swipe gestures: Open/close sidebar on mobile
  • Touch targets: Optimized button sizes for touch interaction
  • Overlay behavior: Tap outside to close sidebar

Technical Notes

Responsive Behavior

  • Desktop: Fixed sidebar with collapse/expand functionality
  • Tablet: Overlay sidebar that can be pinned open
  • Mobile: Full-screen overlay with swipe gestures

State Management

  • Persistent state: Remember collapsed/expanded preference
  • Real-time updates: Character health and status sync
  • Offline handling: Cache navigation state and sync when reconnected

Performance Considerations

  • Lazy loading: Load character details on demand
  • Efficient rendering: Only update changed sidebar elements
  • Memory management: Clean up unused character data

Related Components

Implementation Complexity

Medium - Key considerations:

  • Responsive design across multiple breakpoints
  • Real-time synchronization of player status
  • Role-based permission rendering
  • Mobile touch interaction patterns