mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-10 01:09:43 +02:00
feat(tiles): drag a tile by its header to move it
Owner request: "give me the option to move the tiles around". A tile's header (its free area, not the buttons or the rename input) is now a native drag handle: dropped on another tile the two trade places, dropped on an empty slot it moves there (the last cell; the tiles after it close up). Escape or a drop anywhere else is the browser's own cancel and moves nothing. Every move goes through one path, _reorderTiles: the header drag, a tab of a tiled session dropped on a tile or a slot, and (next commit) the Move Tile chords. Nothing is remounted, reconnected or reloaded. Divider sizes belong to the cells, so a moved tile takes its new cell's size: each tile whose cell size changed fits once (one PTY resize, #464) and every other tile is left alone, in place of the debounced refit of every tile the swap used to schedule. The drag reuses the tab drop targets (capture phase, stopped before xterm), carries a type of its own and never text, and is not draggedTabId, so neither a text field nor the tab strip takes it. Moving is off while a tile is zoomed (draggable off, and a tab drag of a tiled session onto the zoomed tile is refused too) and with a single tile. The handle shows a grab cursor and says it drags in its tooltip (zh-CN included); the dragged tile is dimmed and the target highlighted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19671,7 +19671,8 @@ body.tile-grid-resizing--row * {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
/* A tab dragged over a tile (replace it) or an empty slot (add it). */
|
||||
/* A tab dragged over a tile (replace it) or an empty slot (add it), or a tile
|
||||
dragged there by its header (swap, move). */
|
||||
.tile.tile--drop-target,
|
||||
.tile-slot.tile--drop-target {
|
||||
border-color: var(--accent, #4a9eff);
|
||||
@@ -19679,6 +19680,23 @@ body.tile-grid-resizing--row * {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* The header's free area moves its tile (tile-grid.js _installTileMoveDrag).
|
||||
`draggable` is off while moving is (a zoomed grid, a single tile, a rename),
|
||||
and the buttons keep their own pointer. */
|
||||
.tile-header[draggable='true'] {
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.tile-header[draggable='true']:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
/* The tile being dragged by its header. Opacity only: nothing that moves
|
||||
layout, which would resize its PTY. */
|
||||
.tile.tile--dragging {
|
||||
opacity: 0.45;
|
||||
}
|
||||
|
||||
/* Zoom (tmux-style): one tile fills the grid; the others stay connected but
|
||||
hidden, so they measure nothing and send no resize. */
|
||||
.tile-grid.tile-grid--zoomed .tile:not(.tile--zoomed) {
|
||||
|
||||
Reference in New Issue
Block a user