-
-
Notifications
You must be signed in to change notification settings - Fork 431
[ATL-959] Remove settings icon from sidebar #209
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
Conversation
|
||
export const CLOSE: Command = { | ||
id: 'arduino-settings-close', | ||
label: 'Close Preferences...', | ||
category: 'Arduino' | ||
} |
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 don't think this approach is really necessary as the Dialog provides a Promise that, when resolved (usually with close()
, closes the UI.
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 agree. We do not need a command for it. Especially, a command that is available from the Commnad Palette. Note: if you add a label
to the command, users can execute it from the Commad Palette.
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 for the tip about the label
!
<div className='flex-line'> | ||
<button className='theia-button shrink' onClick={this.openExtendedSettings}>Extended Settings</button> | ||
</div> |
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.
@kittaakos This is just a draft button in the Arduino settings panel. When clicked it opens the "theia" settings in a tab, and - supposedly - closes the current Arduino settings panel.
I don't really like the way I close this dialog, as I don't think I need an extra command, as the SettingsComponent
shouldn't be aware it's being used in a dialog.
In my opinion a better approach should be sending a message to the parent (Widget) stating that the extended settings are being opened. The Widget should communicate somehow to the Dialog to call the .close()
.
This communication between
Dialog > Widget > Settings Component is the real pain here. Do you have ideas on how to address this in an elegant way>?
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.
as I don't think I need an extra command
I agree. Let's do it without a command.
</div>; | ||
} | ||
|
||
protected openExtendedSettings = (e: React.MouseEvent<HTMLElement>) => { | ||
this.props.commands.executeCommand(CommonCommands.OPEN_PREFERENCES.id); | ||
this.props.commands.executeCommand('arduino-settings-close'); |
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.
Even if I defined CommonCommands.CLOSE_PREFERENCES
I'm not even able to use it here, as it causes a loop in the dependencies.
If we go the "commands path" we should move these preference commands to another file, but my understanding is we don't do that usually.
b4d382f
to
ba60402
Compare
|
||
export const CLOSE: Command = { | ||
id: 'arduino-settings-close', | ||
label: 'Close Preferences...', | ||
category: 'Arduino' | ||
} |
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 agree. We do not need a command for it. Especially, a command that is available from the Commnad Palette. Note: if you add a label
to the command, users can execute it from the Commad Palette.
@@ -13,6 +13,8 @@ import { FileService } from '@theia/filesystem/lib/browser/file-service'; | |||
import { ThemeService } from '@theia/core/lib/browser/theming'; | |||
import { MaybePromise } from '@theia/core/lib/common/types'; | |||
import { WindowService } from '@theia/core/lib/browser/window/window-service'; | |||
import { CommandRegistry } from "@theia/core"; |
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.
Please use single quotes. I have to add linter for it. Thanks!
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.
nice, we don't use prettier or editorconfig, correct? do we plan to use it in the future?
<div className='flex-line'> | ||
<button className='theia-button shrink' onClick={this.openExtendedSettings}>Extended Settings</button> | ||
</div> |
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.
as I don't think I need an extra command
I agree. Let's do it without a command.
@@ -681,12 +693,17 @@ export class SettingsWidget extends ReactWidget { | |||
@inject(WindowService) | |||
protected readonly windowService: WindowService; | |||
|
|||
@inject(CommandRegistry) |
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.
FYI: There is the CommandService
API, which's sufficient for this case, as you want to only execute a command. No need to change, just wanted to share this with you.
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'm gonna check the difference between the CommandService
and the CommandRegistry
I have two questions regarding the UX, I guess you have already discussed it with the designers:
Thanks! FYI: if the user changes anything in the advanced settings editor, it is very likely that the change goes to the workspace settings. There will be a new |
ba60402
to
8cb5398
Compare
any change to the Arduino preferences before the advanced preferences should be saved
which setting would be invalid? for instance characters in the scaling percentage?
as far as I understand that advanced settings tab is just a GUI rendering of a setting file, and by trying to open it twice from the gear icon it will just receive focus, not open into another tab
excellent point. I have to say that while for basic users that Thank you for now 👍🏼 |
8cb5398
to
0ac6030
Compare
We had a chat @giannicolab and I about the "open extended preferences from standard preferences" and how friendly this flow is to the user. @giannicolab is suggesting to have 2 menu items, such as "quick preferences" and "extended preferences", rather than having a button in the quick preferences that closes a modal and radically change how the user should interact with the settings. At the moment I think his approach is the best for the user, removing noise from the quick settings (no more extended button) and having to interaction flows which are distinct and separated. @ubidefeo what is your opinion on this? |
Yes. Or a completely invalid path pointing to the sketchbook.
@fstasi, if the changes have to be saved, we need
|
Improved preference Dialog UI
0ac6030
to
f7fb744
Compare
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.
LGTM
I tested that the advanced settings helper came up with the shortcut.
we're good
A gear icon is shown prominently in the side bar
This PR removes the gear icon from the sidebar
Jira Task
Github Issue: fixes #15