-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MM-10586] Desktop App Window/Tabs Update #1056
Conversation
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.
since its wip, I did a quick review in case it helps you
const doubleClickAction = remote.systemPreferences.getUserDefault('AppleActionOnDoubleClick', 'string'); | ||
const win = remote.getCurrentWindow(); | ||
if (doubleClickAction === 'Minimize') { | ||
win.minimize(); | ||
} else if (doubleClickAction === 'Maximize' && !win.isMaximized()) { | ||
win.maximize(); | ||
} else if (doubleClickAction === 'Maximize' && win.isMaximized()) { | ||
win.unmaximize(); | ||
} |
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.
Maybe you want to have here some sort of strategy pattern, where you don't really care if it's win or mac, but define the behaviours on initialization and here you just apply whatever is configured.
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.
So there's two completely different systems at play here. The Mac one relies on this function and a drag
region, whereas the Windows/Linux one is a custom toolbar npm package that handles all this. I'm not really sure how I'd want to 'inject' them separately, since the app doesn't really provides the correct points of insertion, nor do they require the same points.
I think if we were to change the application to be more dependency injection receptive, then it might make sense to modularize these.
src/browser/components/MainPage.jsx
Outdated
if (process.platform === 'darwin') { | ||
topBarClassName += ' macOS'; | ||
if (this.state.isDarkMode) { | ||
topBarClassName += ' darkMode'; |
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.
is this for debugging purposes?
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.
No, but I guess that raises the question why I'm using state
. I'll switch it to an instance variable.
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.
Actually, I forgot. It should be a state
variable, since it can change as the OS changes from light to dark mode.
src/browser/components/TabBar.jsx
Outdated
@@ -71,13 +74,15 @@ export default class TabBar extends React.Component { // need "this" | |||
title='Add new server' | |||
draggable={false} | |||
> | |||
<Glyphicon glyph='plus'/> | |||
<div className='TabBar-tabSeperator'> | |||
{'+'} |
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.
are we no longer using fonts for icons?
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.
Not across the board, but the new design uses just a generic +
@devinbinnie do you know why the |
We don't have an automated builder setup for desktop app currently, which I guess is a bit of a problem... |
@devinbinnie thanks for clarifying 😄 Who's the best person to bring this issue up with? |
there is no
at some point it would be great if we posted back with a bot the link to the build, but currently that's not implemented |
All features complete! Still needs a bit of work here and there, but is mostly ready! |
The file |
@esethna answers to your previous comment:
|
@devinbinnie is this ready for final review? |
Yep! |
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.
Thanks Devin!
We can merge this |
re-running the workflow as it doesn't make any sense to fail there |
@Willyfrog could you do a quick re-review before we merge to make sure everything is up to standards? |
/update-branch |
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.
looking mostly good, but I have a few concerns/changes to request
package.json
Outdated
"mocha": "^5.2.0", | ||
"mocha-circleci-reporter": "0.0.3", | ||
"npm-run-all": "^4.1.5", | ||
"react": "^16.6.3", | ||
"react-dom": "^16.6.3", | ||
"react-smooth-dnd": "github:devinbinnie/react-smooth-dnd#a72095d3fa1fd6ffc3a6b797174d019a07d7b011", |
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.
if we are using a fork of a library, shouldn't it be under mattermost and have an associated pull request so we are sure of the changes being introduced?
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.
Yes, though i'm not sure how to go about adding a fork to the MM repo.
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.
You'll have to transfer ownership of it to someone who has admin access to the GitHub organization. I'll message you more details.
@@ -0,0 +1,13 @@ | |||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. |
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.
why is the file called debug
? we should rename it
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.
It's only used for debug mode, I think the name's okay.
case 'mouse-move': | ||
this.handleMouseMove(event.args[0]); | ||
break; | ||
case 'mouse-up': | ||
this.handleMouseUp(); | ||
break; |
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.
why do we need to handle movement and release of button?
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.
This is a fix for the tab dragging and dropping, since if you leave the bounds of the DnD area before dropping, it doesn't drop the tab. This does it manually/
if (input.key === 'Alt' && input.type === 'keyUp' && altLastPressed) { | ||
altLastPressed = false; | ||
mainWindow.webContents.send('focus-three-dot-menu'); | ||
return; | ||
} | ||
|
||
// Hack to detect keyPress so that alt+<key> combinations don't default back to the 3-dot menu | ||
if (input.key === 'Alt' && input.type === 'keyDown') { | ||
altLastPressed = true; | ||
} else { | ||
altLastPressed = false; | ||
} |
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.
why is ALT a shorcut? wouldn't that interfere not only with alt+up/down but with anything regarding the OS from the user if he has any shortcut using that? whouldn't it make more sense to use a separate shortcut for that that doesn't use a modifier key as the only one?
non-comprehensive list of things that might break:
- alt+f4 on windows (as an example of OS related)
- alt+right click for mark as unread (as an example of MM related)
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.
It's a manual override to do something the OS already does, which is open a window context menu when you press ALT. It was part of @esethna's suggestions for accessibility.
I agree it would be better to use a different shortcut, but that's why we're checking for keyup and keydown to make sure it's not being used as a combo.
useSpellChecker: Joi.boolean().default(true), | ||
enableHardwareAcceleration: Joi.boolean().default(true), | ||
autostart: Joi.boolean().default(true), | ||
spellCheckerLocale: Joi.string().regex(/^[a-z]{2}-[A-Z]{2}$/).default('en-US'), |
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.
i wouldn't change it in this PR as it has grown big enough, but shouldn't we consider using system's locale as default? we should create a ticket for that
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.
Probably a good idea!
Co-Authored-By: Guillermo Vayá <guivaya@gmail.com>
Co-Authored-By: Guillermo Vayá <guivaya@gmail.com>
* [MM-19054] Added new server tab look and feel, still missing proper hover states and session expired icon * [MM-19055] Added window controls and removed border for macOS * [MM-19055] Add dark mode for macOS * [MM-19054] Added session expired icon * Test windows titlebar * Fixed the menu issue and added non-macOS dark mode * Blank commit * Fixed a lint issue * Fixed more lint issues * Fixed more issues * New tray icons * [MM-19603] Drag and drop tabs * Fixed some assets and fixed build output to include missing assets * Fixed a couple small issues * Only show tabs for only 1 server on Mac * Fixed some more tests * Fixed another test * Revert "Fixed another test" This reverts commit 3604029. * Fixed another test * Trial and error! * A bunch of additional fixes * Fixed a lint issue * Fixed restore focus on add server tab causing bad UX * Trial and error on flaky test again * Fixed some bugs based on PR feedback. * blank commit to push tests * Revert "Test windows titlebar" This reverts commit 9cd46b7. * Remove the rest of the old new titlebar and fixes * Added three-dot link * New menu * Rest of new windows menu and other fixes * Fixed lint errors * Added windows 10 style title bar buttons for non mac OS * Lint fixes and enabled the tab bar regardless of number of servers * Missed one * Fixed unicode characters * Commenting out test that should no longer be applicable * Removed Windows 10 style titlebar icons and used material design instead * Fixed a lint issue * Some small UX fixes * blank commit * Fixed an issue where dropping the first tab moves it too far over before snapping into place * Additional style fixes * Another small issue fix * Back to Windows 10 style * Lint fixes * Accessible three dot menu * Lint fixes * Shrinking tabs when window is too small * Gradient between tabs and title bar buttons when window is too small * Add drag to gradient * Replaced icons, drag and drop cursor sticking fix, slight tab change * Lint and some mac fixes * Light theme fix to three dot menu * Hack for tab sticking to cursor on macOS * Fixes for the find utility * Fix for Catalina dark mode * Revert "Fix for Catalina dark mode" This reverts commit 45da05d. * Fixed a couple issues Dean found * More fixes * Three dot hover effect to circle * PR feedback * Test fixes * Test and config fixes * Disable dragging when there are GPO servers * [MM-20757] Fixed dark mode on debug when running macOS Catalina * Allow future config versions to use v2 config if launching this version of the app * Oops * New titlebar icons, blur for titlebar on inactive * Lint fix * Set unfocused opacity to 0.4 * Final FINAL icons * Fixed closing menu not returning focus to the app * Lint fix * Update src/browser/components/TabBar.jsx Co-Authored-By: Guillermo Vayá <guivaya@gmail.com> * Update src/main/Validator.js Co-Authored-By: Guillermo Vayá <guivaya@gmail.com> * Lint fixes * Moved react-smooth-dnd fork to MM org and fixed another merge issue Co-authored-by: mattermod <mattermod@users.noreply.github.com> Co-authored-by: Guillermo Vayá <guivaya@gmail.com>
Before submitting, please confirm you've
npm run lint:js
for proper code formattingPlease provide the following information:
Summary
New Server Tabs look and feel.
Issue link
https://mattermost.atlassian.net/browse/MM-10586