Repository navigation
Fix preview tabs #218
Description
There have been a lot of issues created related to preview tabs. It seems like nearly all of these issues could be solved by a couple things:
- Create all tabs as 'permanent' by default and only open in a preview tab in a couple cases:
- Single clicking in the tree-view
- Single clicking in project find results pane
- And eventually (when open files is suuuper fast) opening preview tabs when arrowing through the fuzzy finder
- Close the preview tab when it loses focus
The issues
- Files opened from external source should not be temporary #170
- [Enhancement] Do not preview direct-opened tabs #206
- Keep preview open whenever the pane is double-clicked #202
- Preview tab should close when it loses focus #196
- Better indicate preview tab #180
- Double clicking on file in Tree view to open permanent tab not working if containing folder is a symlink #173
- Files opened from external source should not be temporary #170
- Files opened via fuzzy finder should not be temporary #164
- key bindings doesn't work on temporary tabs #207
- Tabs restoring with Preview Tabs enabled. #163
- Setting To Open Permanently When Using Preview Tabs fuzzy-finder#108
The short term approach
Currently preview-tabs is implemented entirely in the tabs package. When a new pane item is opened, the tabs package closes the old pane item associated with the preview tab, and creates a new tab. So atom core (or other packages) has no idea that there are preview tabs. This is kind of crappy as
- There are hacks in the tabs package to handle things like double clicking in the tree view to make a tab permanent.
- There is no way for other packages to open preview tabs, or even know about them without accessing the tabs package
- Along the same lines, a couple folks want an API, and the only way to provide an API would be to add a service or hack to the tabs package.
That said, we could probably do a quick fix to change the default behavior to open a 'permanent' tab, and hack the other packages to open preview tabs in the exceptions listed above.
The long term approach
A cleaner and more robust approach would be to bake the notion of a preview pane item into atom core. Packages could then decide to open preview items if they so choose. Then there would be no hacks: tree-view and the find results could open a preview item on single click; tabs could watch for preview items and have them all share one tab element.
@nathansobo @maxbrunsfeld not sure how much effort this longer term approach would be. Can you estimate how long it would take to add a new option to open() indicating the notion of a preview pane-item + related events?
cc @atom/feedback
Activity
benogle commentedon Oct 15, 2015
This issue was moved to atom/atom#9165