mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-12-01 20:44:06 +01:00
Drag a whole column's ghost, and keep default places until reordered
The ghost of a dragged column is now its header and the cells of the rows in view, copied once when the drag starts and moved sideways by a transform, kept within the list; the column dims in place, its cells by one style rule so no row renders. A built-in column turned on before any reordering takes its default place again; once the person has an order, a newly shown column goes at the end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9ee37e4015
commit
185a4e30df
4 files changed
+198
-50
No files matched your search
@@ -243,10 +243,11 @@ export function toggleColumn(
|
||||
/**
|
||||
* Puts a column just shown after the others shown, unless the person placed it before, so it
|
||||
* goes back to that place. The columns shown before it are placed too, where they are, so the
|
||||
* ones not listed don't jump ahead of it.
|
||||
* ones not listed don't jump ahead of it. Until the person has ordered the columns, each keeps
|
||||
* its default place: a built-in one among the others, an added one at the end.
|
||||
*/
|
||||
function placeAtEnd(prefs: ColumnPrefs, id: ColumnId): ColumnPrefs {
|
||||
if (prefs.order.includes(id)) return prefs;
|
||||
if (prefs.order.length === 0 || prefs.order.includes(id)) return prefs;
|
||||
const all = allColumns(prefs);
|
||||
if (all.filter((c) => isVisible(prefs, c)).at(-1)?.id === id) return prefs;
|
||||
const placed = all.filter(
|
||||
|
||||
Reference in new issue
Block a user