We are building out feature-specific side panels for the map sidebar functionality. These panels will display detailed information when users click on different types of features on the map.
As always, before you begin working on the plan, read through the docs in /docs and check your .cursorrules file to ensure you are coding in accordance with our project standards
All work will be done in /src/partials/map-sidebar/
The side panels will support the following feature types, each with its own dedicated panel:
- Investment Plan Feature - Infrastructure investment information
- Bathing Site Feature - Beach and water quality data (Primary focus)
- Outfall Feature - Storm overflow outlet information
- Surface Water Outfall Feature - Surface water discharge points
- Cluster Feature - Grouped/clustered feature information
- Mutually Exclusive: Only one panel type can be displayed at a time
- Dynamic Content: Panel content changes based on the selected feature type
- Reusable Components: Similar data shapes should use shared components where possible
- Standard Header: All panels have a consistent header layout
- Symbol Space: Reserved space to the left of the header for feature-specific symbols/icons
- Collapsible Symbol Space: If no symbol is provided, the space should collapse automatically
- Responsive: Header should work across different screen sizes
/src/partials/map-sidebar/index.tsx- Main sidebar wrapper/src/components/layout/sidebar- The actual sidebar component/src/components/navigation/tabs- The tab component to use at the top of the sidebar on bathing sites/src/components/data-display/icon- The component to use to display the symbols/src/components/feedback/rag-status-banner- The component to display the RAG status banner
- Basic feature data display with generic attribute rendering
- Simple header with layer title and object ID
- Filtered attributes to hide system fields
- Responsive design using existing theme system
- Refactor existing MapSidebar to support multiple panel types
- Create panel type detection logic based on feature data
- Set up shared header component with symbol space
- Create base panel interface for consistent structure
- Design bathing site-specific layout and components
- Implement bathing site data display with relevant fields
- Add appropriate symbols/icons for bathing sites
- Create comprehensive test scenarios in Storybook
- Ensure accessibility and responsive design
- Investment Plan Panel - Basic structure and placeholder content
- Outfall Panel - Basic structure and placeholder content
- Surface Water Outfall Panel - Basic structure and placeholder content
- Cluster Panel - Basic structure and placeholder content
- Identify common data patterns across panel types
- Extract reusable components for similar data shapes
- Create shared styling utilities for consistent appearance
- Implement component library for panel building blocks
/src/partials/map-sidebar/
├── index.tsx # Main sidebar component
├── styles.module.scss # Main styles
├── map-sidebar.stories.tsx # Storybook stories
└── components/ # Panel-specific components
├── shared/ # Shared components
│ ├── panel-header/ # Header with symbol space
│ ├── data-section/ # Common data display patterns
│ └── attribute-list/ # Reusable attribute display
├── bathing-site-panel/ # Bathing site specific
├── investment-plan-panel/ # Investment plan specific
├── outfall-panel/ # Outfall specific
├── surface-water-panel/ # Surface water specific
└── cluster-panel/ # Cluster specificNote: If a component is a strong contender for being used outside of the map-sidebar partial then it should be placed in an appropriate folder in /src/components
- Feature data passed to main MapSidebar component
- Panel type determined by feature properties (layerTitle, layerType, etc.)
- Appropriate panel component rendered based on type
- Shared components used where data patterns match
- Follow existing SCSS modules pattern
- Use theme variables and utilities found in the
/themefolder, do not invent new ones. - Maintain responsive design principles
- Ensure consistent spacing and typography
- Proper ARIA labels for each panel type
- Keyboard navigation support
- Screen reader friendly content structure
- Focus management when panels change
- Bathing Site Panel: Fully functional with comprehensive data display
- Panel Placeholders: All 4 remaining panel types have basic structure
- Shared Components: Common patterns extracted into reusable components
- Header System: Consistent header with collapsible symbol space
- Test Coverage: Comprehensive Storybook stories for all panels
- Performance: No unnecessary re-renders, efficient component updates
- Accessibility: WCAG 2.1 AA compliance
- Documentation: Clear JSDoc comments and component documentation
- Begin with Phase 1: Architecture Setup
- Focus on bathing site panel implementation
- Create placeholders for other panel types
- Iterate based on feedback and testing