-
Notifications
You must be signed in to change notification settings - Fork 974
Tabs transitions / drag & drop / realtime tear-off #11720
Conversation
926a744
to
9e63bc8
Compare
9e63bc8
to
745f013
Compare
f3513a8
to
f33d124
Compare
app/renderer/components/tabs/tab.js
Outdated
// Set background-color and color to active tab and private tab | ||
this.props.isActive && styles.tabArea__tab_active, | ||
this.props.isPrivateTab && styles.tabArea__tab_private, | ||
(this.props.isPrivateTab && this.props.isActive) && styles.tabArea__tab_private_active, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: let's keep the blank lines above to make those comments meaningful and understandable at a first glance :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whilst it highlights this specific area, it may harm the ability to scan of the rest of the render structure because typically blank lines should be used for component separation, and not usually in the middle of a component definition. I would suggest that the comments themselves act as padding between the lines of code, to highlight their importance or grouping. But this was your code so I’ll add the spacing back before I’m done. Thanks
f33d124
to
9e5e457
Compare
cbf9dc7
to
36127f3
Compare
24307a0
to
a197465
Compare
Updated PR and all issues to be in 0.22.x milestone since we're focusing on the single webview changes for 0.21.x 😄 |
be5e6d3
to
29cbbd3
Compare
Tab animations for appearing, removing and changing order. Platform differences in window behavior with regard to inter-window mouse event communication requires handling window moves and detection of dragging over a tab bar in a new window differently in each platform.
…t switch page too soon
…low by default. Overflow was enabled when tab preview styles showed the tab 'growing' larger than the tabs toolbar
…pty and dragging tabs
2ff5ee2
to
7382b45
Compare
Closing - @petemill evaluated if we could pull this in and unfortunately it would take 4-6 days to complete (and we'd get this for free with Brave Core) |
This is a work in progress, but very much ready for both design and engineering feedback
Fix #6242
Fix #9211
Fix #557
Closes #8459 due to feature removal (no mouse cursor icon now)
Possibly addresses #11207
Dependent on / do not merge before:
#12438
(Buffer Windows)#12492
(ReduxComponent can accept any function for mergeProps)#12373
(Standard validates flow types)#12371
(transform-class-properties babel plugin)#12116
(--debug-tab-events #flag)Main features
Dragging tabs to sort
Smooth transitions for tabs
Detaching a tab from a window
Attaching a tab to a window
Issues
Done
Remaining
Major
setTimeout
andBrowserWindow.sendInputEvent
to proxy mousemove in to that window (that would also solve the ubuntu problem)Medium
setTimeout
andBrowserWindow.sendInputEvent
browser-side, which could also solve the 1-tab-window problem above.- minimal top UI?
- transparency? (electron supports it, muon does not - transparent frameless windows have stopped working muon#373)
- remove pinned tabs
Minor
process.stdout.write
debug loggingEngineering notes
Uses the FLIP technique for checking to see where a component's DOM node has been rendered, comparing it to where it was previously rendered (when props last changed), setting the node's position back to the last position and animating it to the new position. https://aerotwist.com/blog/flip-your-animations/
The component
ListWithTransitions
is used to perform these animations on component enter / leave / move. It has nothing to do with dragging, and everything to do with responding to re-ordered tabs or new tabs or closing tabs, and animating those states. I've tried to keep it agnostic as to what is being rendered, so it can be used for other things in the future (e.g. bookmarks).The existing
Tab
component can do two things:Both these things can actually happen in separate components and windows during a drag operation, since a drag may start inside a component in one window, then move the tab to another window, where a different component and window will need to know to be
props.isDragging = true
, and listen for the mouse position.windowActions
vsappActions
:During a drag operation, it's required to dispatch several actions to the store. The most frequent is to change the display index for the dragged tab. It's important to have the operation complete within max 16ms to maintain 60fps. Whilst the browser process handles changing the tab index, the renderer process must be used to get the correct display index for the frame... (AFAIK), therefore this command gets dispatched by the
<Tab />
component, then the correct destination frame index processed by the window store, then the final tab move dispatched to the app store. Ideally we could cut out the middle, and the<Tab />
would be able to communicate which exact index is required direct to the appStore. I've used a windowAction for the first dispatch since appActions can take over 70ms to reach the windowStore. It's still not ideal as windowActions take between 2 - 20ms to get processed, but it's mostly smooth enough now.Implementation captures
Tab sorting within a single tab-page
Tab sorting between tab-pages
Detach a tab to its own window
Attach a single-tab window to another window
Attach and detach and attach!
QA
Manual Tests
https://github.com/petemill/browser-laptop/wiki/Tab-dragging,-sorting,-detaching-and-attaching
Automated Tests
TODO