Skip to content

Enhancement: Allow String Arrays as Values in Solo Feature #110

@zakasalaheddine

Description

@zakasalaheddine

Enhancement: Allow String Arrays as Values in Solo Feature

Summary

Currently, the solo prop accepts an object where each property can only have a single string value for filtering. This enhancement request proposes extending the Solo Feature to support string arrays as property values, enabling multi-value filtering within a single solo object.

Current Behavior

The solo parameter currently accepts:

  • Type: object
  • Description: item that should be displayed solo
  • Default: null

Current Usage:

// Only single values supported per property
solo={{ firstName: 'John', state: 'NY' }}

Proposed Enhancement

Extend the solo object properties to accept both single strings and string arrays:

Single Value (Current - Maintained)

solo={{ 
  firstName: 'John', 
  state: 'NY' 
}}

Array Values (New Feature)

solo={{ 
  firstName: ['John', 'Jane', 'Bob'],
  state: ['NY', 'CA'] 
}}

Mixed Values (New Capability)

solo={{ 
  firstName: ['John', 'Jane'],    // Multiple values
  department: 'Engineering',      // Single value
  state: ['NY', 'CA', 'TX']      // Multiple values
}}

Use Cases

This enhancement would be valuable for:

  1. Multi-Value Filtering: Display rows matching any of several values for a given property
  2. Category Analysis: Filter by multiple dimensions simultaneously
  3. Flexible Data Exploration: Allow users to select multiple filter values without complex query building
  4. Comparative Analysis: Compare data across multiple related values (e.g., different product categories)

Technical Implementation

Filtering Logic

The enhancement would apply OR logic within each property's array:

// This solo configuration:
solo={{ 
  state: ['NY', 'CA'], 
  department: ['Sales', 'Marketing'] 
}}

// Would match rows where:
// (state === 'NY' OR state === 'CA') AND (department === 'Sales' OR department === 'Marketing')

Benefits

  • Enhanced Flexibility: Support complex filtering scenarios with simple configuration
  • Improved User Experience: Enable multi-select filtering without complex UI components
  • Backward Compatibility: Zero breaking changes for existing implementations
  • Intuitive API: Natural extension of the current solo object structure
  • Performance: Efficient filtering without multiple component re-renders

Implementation Considerations

Array Handling

  • Empty arrays should be treated as "match nothing" for that property
  • Single-item arrays should behave identically to single string values
  • Mixed data types within arrays should be handled gracefully (convert to strings)

Edge Cases

  • solo={{ state: [] }} - should filter out all rows
  • solo={{ state: [''] }} - should match rows with empty/null state values
  • solo={{ state: null }} - should be ignored (current behavior)

This enhancement maintains the simplicity of the current Solo Feature while significantly expanding its filtering capabilities through intuitive array support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions