Table feat: maintain sorting when input data changes
Lately I did some accounts in a Framework notebook.
I was in a loop of categorising my data and then reviewing it in a few Inputs.tables and my big takeaway was that I can't really use Inputs.table (In Framework or Observable Notebooks) in such a loop (hot loop: many many repeats) for one reason: It resets the view (especially sort config) every time inputs change. Otherwise I liked this experience!
You can see the issue if you edit the cell for penguins here, after setting a sort in the table - even if you only add a comment to the penguins cell: https://observablehq.com/@observablehq/input-table
Maybe I need to make a different custom table since the solution here would change the implementation of Inputs.table a lot - I guess - but putting here in case it is simpler or desirable!
For reference, the Mosaic table component maintains sorting state whenever selected rows change. The Olympic Athletes dashboard is an example where you can test this.
Also, the OHQ data table cell supports this
It's also probably better for my usecase if it gets ported to Framework