feat(terminal): drag & drop reorder for terminal slots#18
Merged
Conversation
Added styles and internationalization keys for drag-and-drop interactions within terminal slots. Introduced new methods for reordering terminal slots and growing the workspace grid to accommodate additional slots. Enhanced user experience by allowing users to drag and drop terminal slots, with visual feedback during the drag operation. Updated multiple locale files to support new drag-and-drop features across 13 languages.
…nal slot management Updated styles for drag-and-drop interactions, replacing box-shadow with an outline for better visibility. Introduced a new method to retrieve the live index of terminal slots in the workspace grid, improving the drag-and-drop experience. Refactored drag session management to prevent stale UI updates and ensure accurate slot reordering during drag operations.
Added functionality to reorder terminal slots using a drag-and-drop interface, allowing users to swap positions of slots within the same workspace grid. Introduced visual feedback during the drag operation, including opacity changes and outlines for better user experience. Updated documentation to reflect the new drag-and-drop feature and its usage, along with internationalization support for new UI elements across 13 locales.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LuGripVertical) in every terminal titlebar lets you reorder entire slots (including split panes and agent labels) by dropping them on another slot in the same workspace grid.Vecpermutation acrossslot_ids/slot_agent_labels/slot_pane_states→ PTYs and xterm sessions are preserved (Forkey isslot.id,terminal_keystays stable).TerminalSlotDragService(Leptos context); source and target are resolved live byslot_idagainst the workspace state (newWorkbenchService::terminal_slot_index), so repeated reorders compose without stale array indices.Out of scope (V1)
setDragImage(crashes WebKitGTK / Wry with both live and cloned DOM)Implementation notes
src/workbench/terminal_slot_dnd.rs— MIMEapplication/x-blxcode-terminal-slot, payload helpers, drag service (non-reactiveStoredValue<bool>session + generation guard against stale deferred updates), ghost-style helper.src/workbench/state.rs) —reorder_terminal_slots(workspace_id, from, to)+ pure-Rustreorder_workspace_slots, plusterminal_slot_index.src/workbench/terminal_cell.rs— grip handle on each slot, deferredtry_set_active(gen, meta)so Leptos doesn't re-render mid-dragstart(which would otherwise cancel the drag on WebKitGTK).src/workbench/workspace_panel.rs—dragover/drophandlers on thews-term-slotwrapper, ghost overlay at the target cell,ws-term-grid--drag-activedisables pointer events on foreign xterm canvases while a drag is in flight.styles.css) —.ws-term-cell__drag-handle,.ws-term-slot--drag-source(opacity 0.55),.ws-term-slot--drag-over(3px dashed outline),.ws-term-slot-ghost(2px dashed border, transluscent).WsTermDragHandleAriaauthored in all 13 locales.state::terminal_slot_tests(3 unit tests: parallel permutation, no-op onfrom == to, swap first slot).docs/user/workspaces.md; entry under[Unreleased] / AddedinCHANGELOG.md.Disabled states
Test plan
cargo check -p blxcode-ui --target wasm32-unknown-unknowncleancargo test -p blxcode-ui terminal_slot— 3/3 passingcargo tauri dev): 4 terminals runningsleep 999each → repeated reorders in both directions, PTY output keeps flowing, agent labels travel with the slot