Skip to content
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-61717] Refresh Settings Modal without Bootstrap #3337

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

devinbinnie
Copy link
Member

@devinbinnie devinbinnie commented Feb 15, 2025

Summary

This PR introduced a completely redesigned Settings Modal, that completely abandons the original Bootstrap-based design (and Bootstrap itself) and introduces a look and feel similar to the rest of our Mattermost apps. Credit to @abhijit-singh for the work on these designs :)

The page is broken down into a number of individual Setting components that represent individual controls that can be re-used and re-purposed for different settings. All of the settings themselves are then defined in definition.tsx which references these components. A few exceptions needed to be made where either additional data was required, special designs were need, or some dependencies needed to be satisfied. However, the hope is that adding/modifying/removing settings should be pretty easy from now on.

I would highly recommend downloading one of the available PR builds for this, and trying it out on different OSes to make sure that all of the settings are working and that no unexpected UI/UX bugs show up. I have done some preliminary testing on each OS to ensure nothing glaring exists, but to make this bulletproof it will take some time and a fine tooth comb.

Ticket Link

https://mattermost.atlassian.net/browse/MM-61717

Device Information

This PR was tested on:

  • macOS Sonoma 15.3
  • Windows 10 22H2
  • Ubuntu 24.04

Screenshots

Light Mode (macOS) Dark Mode (Windows/Linux)
Screenshot 2025-02-15 at 10 20 06 AM Screenshot 2025-02-15 at 10 18 48 AM
Screenshot 2025-02-15 at 10 20 14 AM Screenshot 2025-02-15 at 10 18 56 AM
Screenshot 2025-02-15 at 10 20 23 AM Screenshot 2025-02-15 at 10 19 04 AM
Screenshot 2025-02-15 at 10 20 38 AM Screenshot 2025-02-15 at 10 19 35 AM
Screenshot 2025-02-15 at 10 20 48 AM Screenshot 2025-02-15 at 10 19 43 AM

Release Note

Refresh Settings Modal designs

@devinbinnie devinbinnie added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester 1: UX Review Requires review by a UX Designer labels Feb 15, 2025
@devinbinnie devinbinnie added this to the v5.12.0 milestone Feb 15, 2025
@devinbinnie devinbinnie requested review from abhijit-singh, a team and enahum and removed request for a team February 15, 2025 15:35
@devinbinnie devinbinnie requested a review from hmhealey February 15, 2025 15:35
@enahum
Copy link
Contributor

enahum commented Feb 15, 2025

@devinbinnie in the description you ask for us to test on the builds generated by the PR but they seem to be failing

@abhijit-singh abhijit-singh added the Build Apps for PR Builds signed builds for testing label Feb 18, 2025
@abhijit-singh
Copy link

@enahum Looks like it went through - https://github.com/mattermost/desktop/actions/runs/13389165374

Base automatically changed from MM-61716_MM-62643 to master February 18, 2025 15:58
@devinbinnie devinbinnie removed the Build Apps for PR Builds signed builds for testing label Feb 18, 2025
@devinbinnie devinbinnie added Build Apps for PR Builds signed builds for testing Run Desktop E2E Tests This label will trigger the workflow that runs e2e automation tests labels Feb 18, 2025
Copy link

Here are the test results below:

Test Summary for Linux on commit ed79ac3

New failed tests found on Linux:

  • dark_mode MM-T2465 Linux Dark Mode Toggle
  • Settings Options Start app on login MM-T4392 should appear on win32 or linux
  • Settings Options Show icon in menu bar / notification area Save tray icon theme on linux MM-T4393_3 should be saved when it's selected
  • Settings Options Enable automatic check for updates MM-T4549 should save selected option

Test Summary for macOS on commit ed79ac3

All stable tests passed on macOS.

Test Summary for Windows on commit ed79ac3

New failed tests found on Windows:

  • downloads/downloads_menubar The download list has one file MM-22239 should show the downloads dropdown button and the menu item should be enabled
  • downloads/downloads_menubar The download list has one file MM-22239 should open the downloads dropdown when clicking the download button in the menubar
  • copylink MM-T125 Copy Link can be used from channel LHS
  • menu_bar/dropdown MM-T4405 should set name of menu item from config file
  • menu_bar/dropdown MM-T4407 should open the new server prompt after clicking the add button
  • menu_bar/dropdown MM-T4408 Switch Servers MM-T4408_1 should show the first view
  • menu_bar/dropdown MM-T4408 Switch Servers MM-T4408_2 should show the second view after clicking the menu item
  • file_menu/dropdown MM-T805 Sign in to Another Server Window opens using menu item
  • history_menu Click back and forward from history
  • menu/menu MM-T4404 should open the 3 dot menu with Alt
  • menu/view MM-T813 Control+F should focus the search bar in Mattermost
  • menu/view MM-T817 Actual Size Zoom in the menu bar
  • menu/view MM-T818 Zoom in from the menu bar MM-T818_1 Zoom in when CmdOrCtrl+Plus is pressed
  • menu/view MM-T818 Zoom in from the menu bar MM-T818_2 Zoom in when CmdOrCtrl+Shift+Plus is pressed
  • menu/view MM-T819 Zoom out from the menu bar MM-T819_1 Zoom out when CmdOrCtrl+Minus is pressed
  • menu/view MM-T819 Zoom out from the menu bar MM-T819_2 Zoom out when CmdOrCtrl+Shift+Minus is pressed
  • Menu/window_menu MM-T827 select next/previous tab
  • Menu/window_menu MM-T824 should be minimized when keyboard shortcuts are pressed
  • Menu/window_menu MM-T825 should be hidden when keyboard shortcuts are pressed
  • Menu/window_menu MM-T4385 select tab from menu MM-T4385_1 should show the second tab
  • Menu/window_menu MM-T4385 select tab from menu MM-T4385_2 should show the third tab
  • Menu/window_menu MM-T4385 select tab from menu MM-T4385_3 should show the first tab
  • copylink MM-T1308 Check that external links dont open in the app
  • Configure Server Modal MM-T5119 should add the server to the config file
  • server_management/drag_and_drop MM-T2634 should be able to drag and drop servers in the dropdown menu MM-T2634_1 should appear the original order
  • server_management/drag_and_drop MM-T2634 should be able to drag and drop servers in the dropdown menu MM-T2634_2 after dragging the server down, should appear in the new order
  • server_management/drag_and_drop MM-T2634 should be able to drag and drop servers in the dropdown menu MM-T2634_3 should update the config file
  • server_management/drag_and_drop MM-T2635 should be able to drag and drop tabs MM-T2635_1 should be in the original order
  • server_management/drag_and_drop MM-T2635 should be able to drag and drop tabs MM-T2635_2 after moving the tab to the right, the tab should be in the new order
  • server_management/drag_and_drop MM-T2635 should be able to drag and drop tabs MM-T2635_3 should update the config file
  • EditServerModal MM-T4391_2 should edit server when Save is pressed and name edited
  • EditServerModal MM-T4391_3 should edit server when Save is pressed and URL edited
  • EditServerModal MM-T4391_4 should edit server when Save is pressed and both edited
  • header MM-T2637 Double-Clicking on the header should minimize/maximize the app MM-T2637_2 should restore on double-clicking the header when maximized
  • RemoveServerModal MM-T4390_1 should remove existing server on click Remove
  • Settings Options Start app on login MM-T4392 should appear on win32 or linux
  • Settings Options Check spelling MM-T4397 should appear and be selectable
  • Settings Options Enable GPU hardware acceleration MM-T4398 should save selected option
  • Settings Options Enable automatic check for updates MM-T4549 should save selected option
  • startup/app MM-T4975 should show the welcome screen modal when no servers exist
  • startup/app MM-T4985 should show app name in title bar when no servers exist
  • config MM-T4402 should upgrade v0 config file
  • config MM-T4401 should show servers in dropdown when there is config file MM-T4401_1 should show correct server in the dropdown button
  • config MM-T4401 should show servers in dropdown when there is config file MM-T4401_2 should set src of browser view from config file
  • Welcome Screen Modal MM-T4976 should show the slides in the expected order
  • Welcome Screen Modal MM-T4977 should be able to move through slides clicking the navigation buttons
  • Welcome Screen Modal MM-T4978 should be able to move through slides clicking the pagination indicator
  • Welcome Screen Modal MM-T4979 should be able to move forward through slides automatically every 5 seconds
  • Welcome Screen Modal MM-T4980 should show the slides in the expected order
  • Welcome Screen Modal MM-T4981 should be able to move from last to first slide
  • Welcome Screen Modal MM-T4982 should be able to move from first to last slide
  • Welcome Screen Modal MM-T4983 should be able to click the get started button and be redirected to new server modal
  • window MM-T4403_1 should restore window bounds

@github-actions github-actions bot removed the Run Desktop E2E Tests This label will trigger the workflow that runs e2e automation tests label Feb 18, 2025
@devinbinnie devinbinnie added the Run Desktop E2E Tests This label will trigger the workflow that runs e2e automation tests label Feb 20, 2025
@devinbinnie
Copy link
Member Author

@abhijit-singh @enahum @hmhealey This should be ready for review at your convenience.

Copy link

Here are the test results below:

Test Summary for Linux on commit f156901

New failed tests found on Linux:

  • dark_mode MM-T2465 Linux Dark Mode Toggle

Test Summary for macOS on commit f156901

All stable tests passed on macOS.

Test Summary for Windows on commit f156901

New failed tests found on Windows:

  • downloads/downloads_menubar The download list has one file MM-22239 should show the downloads dropdown button and the menu item should be enabled
  • downloads/downloads_menubar The download list has one file MM-22239 should open the downloads dropdown when clicking the download button in the menubar
  • copylink MM-T125 Copy Link can be used from channel LHS
  • menu_bar/dropdown MM-T4405 should set name of menu item from config file
  • menu_bar/dropdown MM-T4407 should open the new server prompt after clicking the add button
  • menu_bar/dropdown MM-T4408 Switch Servers MM-T4408_1 should show the first view
  • menu_bar/dropdown MM-T4408 Switch Servers MM-T4408_2 should show the second view after clicking the menu item
  • file_menu/dropdown MM-T805 Sign in to Another Server Window opens using menu item
  • history_menu Click back and forward from history
  • menu/menu MM-T4404 should open the 3 dot menu with Alt
  • menu/view MM-T813 Control+F should focus the search bar in Mattermost
  • menu/view MM-T817 Actual Size Zoom in the menu bar
  • menu/view MM-T818 Zoom in from the menu bar MM-T818_1 Zoom in when CmdOrCtrl+Plus is pressed
  • menu/view MM-T818 Zoom in from the menu bar MM-T818_2 Zoom in when CmdOrCtrl+Shift+Plus is pressed
  • menu/view MM-T819 Zoom out from the menu bar MM-T819_1 Zoom out when CmdOrCtrl+Minus is pressed
  • menu/view MM-T819 Zoom out from the menu bar MM-T819_2 Zoom out when CmdOrCtrl+Shift+Minus is pressed
  • Menu/window_menu MM-T827 select next/previous tab
  • Menu/window_menu MM-T824 should be minimized when keyboard shortcuts are pressed
  • Menu/window_menu MM-T825 should be hidden when keyboard shortcuts are pressed
  • Menu/window_menu MM-T4385 select tab from menu MM-T4385_1 should show the second tab
  • Menu/window_menu MM-T4385 select tab from menu MM-T4385_2 should show the third tab
  • Menu/window_menu MM-T4385 select tab from menu MM-T4385_3 should show the first tab
  • copylink MM-T1308 Check that external links dont open in the app
  • Configure Server Modal MM-T5119 should add the server to the config file
  • server_management/drag_and_drop MM-T2634 should be able to drag and drop servers in the dropdown menu MM-T2634_1 should appear the original order
  • server_management/drag_and_drop MM-T2634 should be able to drag and drop servers in the dropdown menu MM-T2634_2 after dragging the server down, should appear in the new order
  • server_management/drag_and_drop MM-T2634 should be able to drag and drop servers in the dropdown menu MM-T2634_3 should update the config file
  • server_management/drag_and_drop MM-T2635 should be able to drag and drop tabs MM-T2635_1 should be in the original order
  • server_management/drag_and_drop MM-T2635 should be able to drag and drop tabs MM-T2635_2 after moving the tab to the right, the tab should be in the new order
  • server_management/drag_and_drop MM-T2635 should be able to drag and drop tabs MM-T2635_3 should update the config file
  • EditServerModal MM-T4391_2 should edit server when Save is pressed and name edited
  • EditServerModal MM-T4391_3 should edit server when Save is pressed and URL edited
  • EditServerModal MM-T4391_4 should edit server when Save is pressed and both edited
  • header MM-T2637 Double-Clicking on the header should minimize/maximize the app MM-T2637_2 should restore on double-clicking the header when maximized
  • RemoveServerModal MM-T4390_1 should remove existing server on click Remove
  • Settings Options Check spelling MM-T4397 should appear and be selectable
  • Settings Options Enable GPU hardware acceleration MM-T4398 should save selected option
  • Settings Options Enable automatic check for updates MM-T4549 should save selected option
  • startup/app MM-T4975 should show the welcome screen modal when no servers exist
  • startup/app MM-T4985 should show app name in title bar when no servers exist
  • config MM-T4402 should upgrade v0 config file
  • config MM-T4401 should show servers in dropdown when there is config file MM-T4401_1 should show correct server in the dropdown button
  • config MM-T4401 should show servers in dropdown when there is config file MM-T4401_2 should set src of browser view from config file
  • Welcome Screen Modal MM-T4976 should show the slides in the expected order
  • Welcome Screen Modal MM-T4977 should be able to move through slides clicking the navigation buttons
  • Welcome Screen Modal MM-T4978 should be able to move through slides clicking the pagination indicator
  • Welcome Screen Modal MM-T4979 should be able to move forward through slides automatically every 5 seconds
  • Welcome Screen Modal MM-T4980 should show the slides in the expected order
  • Welcome Screen Modal MM-T4981 should be able to move from last to first slide
  • Welcome Screen Modal MM-T4982 should be able to move from first to last slide
  • Welcome Screen Modal MM-T4983 should be able to click the get started button and be redirected to new server modal
  • window MM-T4403_1 should restore window bounds

@github-actions github-actions bot removed the Run Desktop E2E Tests This label will trigger the workflow that runs e2e automation tests label Feb 20, 2025
@abhijit-singh abhijit-singh added Build Apps for PR Builds signed builds for testing and removed Build Apps for PR Builds signed builds for testing labels Feb 24, 2025
Copy link
Contributor

@enahum enahum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good to me

@@ -38,16 +38,17 @@ function handleShowOnboardingScreens(showWelcomeScreen: boolean, showNewServerMo
log.debug('handleShowOnboardingScreens', {showWelcomeScreen, showNewServerModal, mainWindowIsVisible});

if (showWelcomeScreen) {
if (ModalManager.isModalDisplayed()) {
const welcomeScreen = ModalManager.modalQueue.find((modal) => modal.key === 'welcomeScreen');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not major, but it would be good to have welcomeScreen as a constant

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, we should actually do this across the board for all of the modal names.
Seems like something AI could help me hash out real quick ;)

I'll put it in a follow-up change though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const welcomeScreen = ModalManager.modalQueue.find((modal) => modal.key === 'welcomeScreen');
if (welcomeScreen?.view.webContents.isLoading()) {
welcomeScreen?.view.webContents.once('did-finish-load', () => {
const welcomeScreenTest = ModalManager.modalQueue.find((modal) => modal.key === 'welcomeScreen');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and then use it here as well

<button
id={`RadioSetting_${id}_${option.value}`}
className='RadioSetting__radio'
key={index}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is better as index.toString() or `${index}`

<div className='ServerSetting__serverList'>
{(servers.map((server, index) => (
<div
key={index}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link

@abhijit-singh abhijit-singh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @devinbinnie! Looks good. I spotted a few issues:

  1. Pressing Esc to close the settings modal crashes the app with this error:
TypeError: Cannot read properties of undefined (reading 'stack')
    at Object.createErrorReport (/private/var/folders/0c/6xhd1slj4tv6mw_bcfdt94s40000gn/T/AppTranslocation/D9C204DE-C58D-472D-8881-928B80864B47/d/Mattermost.app/Contents/Resources/app.asar/index.js:2:118270)
    at Object.showExceptionDialog (/private/var/folders/0c/6xhd1slj4tv6mw_bcfdt94s40000gn/T/AppTranslocation/D9C204DE-C58D-472D-8881-928B80864B47/d/Mattermost.app/Contents/Resources/app.asar/index.js:2:116774)
    at process.<anonymous> (/private/var/folders/0c/6xhd1slj4tv6mw_bcfdt94s40000gn/T/AppTranslocation/D9C204DE-C58D-472D-8881-928B80864B47/d/Mattermost.app/Contents/Resources/app.asar/index.js:2:116568)
    at process.emit (node:events:518:28)
    at emitUnhandledRejection (node:internal/process/promises:250:13)
    at warnWithErrorCodeUnhandledRejectionsMode (node:internal/process/promises:404:19)
    at processPromiseRejections (node:internal/process/promises:470:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)

  1. We should probably give a minimum height to the modal. How we have done it in other places (Team settings modal, user settings modal) is by having a min-height: 475px; applied to the modal body—we can add the same here.
image
  1. For the Add server, Edit server modals, we need to have another overlay, or push the original settings modal below the overlay.
image
  1. In the dark mode, some of the borders and dividers aren't visible. Can we check if they're using the center-channel-color-rgb variable with a 0.08 opacity?
image

Copy link
Contributor

@yasserfaraazkhan yasserfaraazkhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devinbinnie if we delete all servers, we still see the modal open and click through the different options.

Screenshot 2025-02-25 at 11 03 11 PM image

@devinbinnie
Copy link
Member Author

@abhijit-singh

  1. In the dark mode, some of the borders and dividers aren't visible. Can we check if they're using the center-channel-color-rgb variable with a 0.08 opacity?

This was using --border-light in dark mode which does use 0.08 opacity, however since that doesn't show up that well I've switched them to --border-dark in dark mode which is 0.16. I assume that was added for that reason, so they should look better now.

@yasserfaraazkhan

if we delete all servers, we still see the modal open and click through the different options.

I don't think that's a problem, the user may want to look at other settings while in the modal, so closing it on them would be jarring. @abhijit-singh If you're okay with this I'll leave it as-is.

@abhijit-singh
Copy link

If you're okay with this I'll leave it as-is.

It'll be great to add some empty state text, possibly along with an illustration, instead of just blank space after the heading - Figma design
image

Also, I just noticed one more small thing — Clicking just below the modal in some cases (when the modal height is less) does not close it. Ideally clicking anywhere outside the modal should close it.

@abhijit-singh
Copy link

Also, one last thing — can we call this something like Application settings instead of just Settings? I don't want people to confuse this with their user level settings modal.

image

@devinbinnie
Copy link
Member Author

Also, one last thing — can we call this something like Application settings instead of just Settings? I don't want people to confuse this with their user level settings modal.

image

I'll go with Desktop App Settings to be more specific.

@devinbinnie
Copy link
Member Author

Also, I just noticed one more small thing — Clicking just below the modal in some cases (when the modal height is less) does not close it. Ideally clicking anywhere outside the modal should close it.

Can't reproduce this, can you try again after I put a new build up? I might have inadvertently fixed it.

@devinbinnie devinbinnie added Build Apps for PR Builds signed builds for testing and removed Build Apps for PR Builds signed builds for testing labels Feb 25, 2025
@abhijit-singh
Copy link

Thanks @devinbinnie for the quick updates!

Just a couple things remaining:

  1. About the minimum height, sorry I should have been clearer— we need the min-height: 475px; to be applied to the main content of the modal below the header. Or else the entire modal can be given a min-height of 552px.
image 2. The border colour issue seems to be still there. Somehow, the divider in the `General` tab between `Download location` and the other settings seems to be behaving fine. Can we match the divider between the modal header and body, and also the dividers on the `Server` tab to match the colours of that divider in `General`? Screenshot 2025-02-26 at 4 27 06 AM Screenshot 2025-02-26 at 4 26 58 AM

@devinbinnie devinbinnie removed the 3: QA Review Requires review by a QA tester label Feb 26, 2025
@devinbinnie
Copy link
Member Author

@abhijit-singh Fixed! Issue with the CSS variables

image

Copy link

@abhijit-singh abhijit-singh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks @devinbinnie!

@devinbinnie devinbinnie removed the 1: UX Review Requires review by a UX Designer label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core committer Build Apps for PR Builds signed builds for testing release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants