deephaven / web-client-ui

Deephaven Web Client UI
Apache License 2.0
28 stars 30 forks source link

Keyed Selection #2140

Open dgodinez-dh opened 1 month ago

dgodinez-dh commented 1 month ago

This is in reference to Deephaven Enterprise ticket DH-9378.

Currently, we maintain and operate on selection as an array of GridRange. For tables with key columns, we should implement keyed selection.

Keyed selection means:

Some thoughts on implementation:

There are two ways to implement:

  1. Update Selection on Table Changed

    • On user selects rows, store keys for selected rows. If the selection is out of viewport, request keys from server.
    • When the table updates (sort, filter, row update):
    • show loading spinner on table (or maintain it if already shown)
    • Request updated GridRange selection for keys from server
    • Render selection as normal
    • Operate on selection as normal
  2. Update Selection when Selection is Used

    • On user selects rows, store keys for selected rows. If the selection is out of viewport, request keys from server.
    • If getting keys from the server, disable operations that use selection until the keys are returned.
    • On render, check if a row's key is in the set of selected keys and render it as selected.
    • When the user operates on selection (Copy, Export, etc...):
    • request updated GridRange selection for keys from server
    • operate on the updated selection
    • Alternatively, we could update the API to operate on selected keys