Skip to content

Change the data structure to store selections in the selection store #1732

@rajatvijay

Description

@rajatvijay

Problem

The current structure is only capable to store the selected cells.
selectedCells: WritableSet<string>;
This is not usable when the table has no rows hence no cells but the user should still be able to select columns and edit their properties as mentioned in #1684

The rationale behind current implementation

The current implementation is based on the fact that when a cell is selected, a row and a column are also selected by default. Row selection can be described as selecting all the cells in a particular row.
Column selection can be described as selecting all the cells in a particular column.

Proposed solution

@pavish proposed the following design:

The selection store to utilize a different structure instead of just the identifier string array, something like:

{
   type: 'cell' | 'column' | 'row',
   identifiers: string[],
}

The identifiers here would depend on the type of selection.

Metadata

Metadata

Assignees

Labels

readyReady for implementationrestricted: maintainersOnly maintainers can resolve this issuework: frontendRelated to frontend code in the mathesar_ui directory

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions