Commit Graph

16 Commits

Author SHA1 Message Date
Jason Rudolph
81b05023db Refactor: Move directional pane fns to WorkspaceElement 2017-05-25 08:51:22 -04:00
Jason Rudolph
1dfdd84393 Add ability to move directionally across *all* visible panes
Prior to this change, the following commands successfully move between
panes in the workspace center, but they could not move between the the
panes in the workspace center and panes in the docks:

- window:focus-pane-above
- window:focus-pane-below
- window:focus-pane-on-left
- window:focus-pane-on-right
- window:move-active-item-to-pane-above
- window:move-active-item-to-pane-below
- window:move-active-item-to-pane-on-left
- window:move-active-item-to-pane-on-right
- window:copy-active-item-to-pane-above
- window:copy-active-item-to-pane-below
- window:copy-active-item-to-pane-on-left
- window:copy-active-item-to-pane-on-right

This commit updates these commands to work across all visible panes,
regardless of whether the pane is in the workspace center or a dock.

Summary of approach:

- Add tests for the `nearestVisiblePaneInDirection`, which provides the
  core logic for the higher-level methods like `focusPaneViewAbove`,
  `moveActiveItemToPaneAbove`, `focusPaneViewOnLeft`, etc.
    - Test the generic logic extensively (i.e., the logic that is
      independent of whether the given pane resides in the workspace
      center or a dock)
    - Also test the navigation between docks and the workspace center
- Since the core logic is tested in the new tests above, simplify the
  tests for the higher-level methods (e.g., `focusPaneViewAbove`,
  `moveActiveItemToPaneAbove`, `focusPaneViewOnLeft`) to avoid
  unnecessary duplication.
- Add `nearestVisiblePaneInDirection` to `WorkspaceElement`, implemented
  in terms of the existing `nearestPaneInDirection` method on
  `PaneContainerElement` for now.
2017-05-24 17:30:15 -04:00
Max Brunsfeld
9ecbc85be5 Remove more usages of getView, document getElement API 2017-04-05 17:02:59 -07:00
Aaron Contreras
6b118a8061 Add convenience commands to copy/move active item between panes
Give focus to destination pane and set the copied/moved item as active
2016-02-09 00:36:37 +01:00
Antonio Scandurra
6e915c0afd Don't use atom globals in PaneContainerElement 2015-10-07 15:25:01 -05:00
Nathan Sobo
eb30bde9a6 🔥 Remove grim require from PaneContainerElement 2015-09-22 10:37:08 -06:00
Nathan Sobo
e343125486 Drop attach/remove hook support for legacy SpacePen views 2015-09-18 20:48:46 -06:00
Nathan Sobo
4c73395608 Remove PaneContainerView and PaneView SpacePen shims 2015-09-18 20:48:45 -06:00
Kevin Sawicki
7d592c8b78 includeDeprecations -> includeDeprecatedAPIs 2015-04-03 11:29:16 -07:00
Kevin Sawicki
0c06c69cd9 Check deprecations flag for space pen shim inclusion 2015-04-03 11:29:14 -07:00
Max Brunsfeld
e4bcb96dcc Change ::setModel to ::initialize on all element classes 2014-12-01 17:52:19 -08:00
Nathan Sobo
4591f00a65 Remove view registry references from the workspace model layer
Removed various ::getView methods from the model. Using the atom.views
global in the views for now, but going to switch them over to using a
locally assigned view registry instead in a subsequent commit.
2014-12-01 16:28:33 -08:00
Nathan Sobo
eedf4894ae Use ‘atom-pane-container’ custom tag name for PaneContainerElement 2014-10-09 07:39:14 -07:00
Nathan Sobo
ee9284e228 Use ‘atom-pane’ custom tag name for PaneElement 2014-10-09 07:39:13 -07:00
Nathan Sobo
670f3e4946 Add WorkspaceElement 2014-09-25 11:41:09 -06:00
Nathan Sobo
465d2afd95 Remove the old root view properly 2014-09-24 15:28:34 -06:00