ZIm/crates/workspace/src
Dino 0ff803fe10
workspace: Add action to move focused panel to next dock position (#23317)
This Pull Request introduces a new command `workspace: move focused
panel to next position` which finds the currently focused panel, if such
panel exists, and moves it to the next valid dock position, following
the order of `Left → Bottom → Right` and then starting again from the
left position.

In order to achieve this the following changes have been introduced:

* Add a new default implementation for `PanelHandle`, namely
`PanelHandle::move_to_next_position` which leverages
`PanelHandle::position`, `PanelHandle::position_is_valid` and
`PanelHandle::set_position` methods to update the panel's position to
the next valid position.
* Add a new method to the `workspace` module, `
move_focused_panel_to_next_position`, which is responsible for finding
the currently focused panel, if such a panel exists, and calling the
`move_to_next_position` method in the panel's handle.
* Add a new action to the `workspace` module,
`MoveFocusedPanelToNextPosition`, which is handled by the
`move_focused_panel_to_next_position` method.

Tests have also been added to the `workspace` module in order to
guarantee that the action is correctly updating the focused panel's
position.

Here's a quick video of it, in action 🔽 


https://github.com/user-attachments/assets/264d382b-5239-40aa-bc5e-5d569dec0734

Closes #23115 

Release Notes:

- Added new command to move the focused panel to the next valid dock
position – `workspace: move focused panel to next position` .
2025-01-20 13:07:11 +02:00
..
persistence Fix empty title in Recent Projects (#21952) 2025-01-07 03:45:38 +00:00
shared_screen Simplify livekit config so that cargo check Just Works (#21661) 2024-12-06 13:50:59 -08:00
dock.rs workspace: Add action to move focused panel to next dock position (#23317) 2025-01-20 13:07:11 +02:00
item.rs pane: Add ability to use custom tooltip content (#22879) 2025-01-09 15:34:30 +00:00
modal_layer.rs chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
notifications.rs Remove gap in layout of notifications (#23303) 2025-01-17 23:56:45 +00:00
pane.rs Improve keymap json schema (#23044) 2025-01-13 02:34:35 +00:00
pane_group.rs Improve keymap json schema (#23044) 2025-01-13 02:34:35 +00:00
persistence.rs Move git status out of Entry (#22224) 2025-01-04 01:00:16 +00:00
searchable.rs Display buffer/project search entries in the outline panel (#16589) 2024-08-25 21:40:02 +03:00
shared_screen.rs Simplify livekit config so that cargo check Just Works (#21661) 2024-12-06 13:50:59 -08:00
status_bar.rs Status bar: Reduce right tools lateral margin (#21329) 2024-11-29 10:56:32 -03:00
tasks.rs Cleanups preparing for WindowContext refactor (#22475) 2024-12-28 21:36:14 +00:00
theme_preview.rs Remove the SwitchWithLabel component (#23240) 2025-01-16 12:18:59 -03:00
toolbar.rs Refactor Spacing into DynamicSpacing using proc macro (#20504) 2024-11-11 11:08:55 -05:00
workspace.rs workspace: Add action to move focused panel to next dock position (#23317) 2025-01-20 13:07:11 +02:00
workspace_settings.rs workspace: Fix doc comments (#22063) 2024-12-16 08:27:14 -05:00