Commit Graph

20 Commits

Author SHA1 Message Date
Matthew Dapena-Tretter
113453a219 Convert Dock to an etch component 2018-03-06 15:45:29 -08:00
Antonio Scandurra
8077f46fdf Programmatically detect when mouse approaches the edge of a dock
Previously, we would assign dock elements a minimum width/height of 2
pixels so that we could detect when the mouse approached the edge of a
hidden dock in order to show the chevron buttons. This, however, was
causing confusion for users, who expected that extra space to be
clickable in order to scroll editors located in the center dock.

With this commit we will instead register a global `mousemove` event on
the window right when attaching the workspace element to the DOM (the
event handler is debounced, so this shouldn't have any performance
consequence). Then, when mouse moves, we will programmatically detect
when it is approaching to the edge of a dock and show the chevron button
accordingly. This allows us to remove the `min-width` property from the
dock container element, which eliminates the confusing behavior
described above.
2018-01-12 17:12:55 +01:00
Will Binns-Smith
882a1924f0 Remove one-off eslint global pragmas in favor of envs 2017-08-20 19:55:00 -07:00
Ash Wilson
dc9fe25255 Wrap temp.cleanupSync() calls in try-catch blocks 2017-08-04 14:18:43 -04:00
Jason Rudolph
1a60c450ca 👔 Remove trailing comma 2017-06-08 15:44:15 -04:00
Jason Rudolph
f62cb5d427 🐛 Don't attempt to copy items that aren't copyable 2017-06-08 15:42:39 -04:00
Jason Rudolph
296e407284 Check an item's allowed locations when moving/copying to pane 2017-06-07 12:59:54 -04:00
Jason Rudolph
e3c612b261 🔥 Remove unnecessary require 2017-05-25 09:02:32 -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
Jason Rudolph
bee12af4c1 Move directional pane movement specs up to WorkspaceElement
In preparation for providing directional pane navigation that goes
beyond the currently-active pane container, this commit:

- Moves the existing directional pane movement specs out of the
PaneContainerElement specs and into the WorkspaceElement specs
- Adjusts the specs to perform all set-up in terms of the workspace, as
opposed to manually constructing a PaneContainer.
2017-05-22 10:19:18 -04:00
Antonio Scandurra
f3c48c8b70 Register style elements change events in AtomEnvironment.initialize
...and fix spec/workspace-element-spec.js
2017-05-05 09:29:29 +02:00
Max Brunsfeld
399b70662d Fix regression in hovered dock tracking due to workspace refactor
Also, backfill tests for showing, hiding and updating the dock toggle
buttons in response to mouse movements.
2017-04-10 14:15:31 -07:00
Max Brunsfeld
63d27c5f0a Rename Dock.isOpen to .isVisible and Dock.open to .show 2017-04-06 17:23:53 -07:00
Nathan Sobo
9e1f9c0dd9 When focusing a pane, always activate its container 2017-04-06 15:47:17 -06:00
Max Brunsfeld
9ecbc85be5 Remove more usages of getView, document getElement API 2017-04-05 17:02:59 -07:00
Max Brunsfeld
2ed0724fc4 Remove unnecessary calls to ViewRegistry.getView 2017-04-05 16:50:04 -07:00
Max Brunsfeld
6f0b1947ee Use Workspace.getElement in tests 2017-04-05 15:32:00 -07:00
Matthew Dapena-Tretter
3017b28ef7 Convert workspace element to JS: Cleanup 2017-03-07 16:31:00 -08:00
Matthew Dapena-Tretter
ca4d55954b Convert workspace element to JS: Lint 2017-03-07 15:56:57 -08:00
Matthew Dapena-Tretter
ede4a2972a Convert workspace element to JS: Decaffeinate 2017-03-07 15:49:22 -08:00