feat: change status bar color when in production org setting#5519
feat: change status bar color when in production org setting#5519PierreVanobbergen wants to merge 2 commits into
Conversation
Create a setting to allow the status bar to change color when the default org is a production one fix forcedotcom#5517
|
Thanks for the contribution! Before we can merge this, we need @PierreVanobbergen to sign the Salesforce Inc. Contributor License Agreement. |
|
Some notes about the feature/PR:
Thank you :) |
|
Hi @PierreVanobbergen, thank you for this contribution! I just saw the video you shared in the issue, and the comment I have is that the color should apply to only the org picker (that element where the org alias is displayed), because we have other items in the bottom bar that have colors according to the state and we would miss that with how this is working now. Do you think you could limit the feature to just the org picker? Thanks! |
| export const colorWhenProductionOrg = async () => { | ||
| const baseColorStatusBar = new vscode.ThemeColor('statusBar.background'); | ||
|
|
||
| const colorWHenProductionOrgHandler = async () => { |
There was a problem hiding this comment.
typo colorWHenProductionOrgHandler -> colorWhenProductionOrgHandler
| }; | ||
|
|
||
| WorkspaceContext.getInstance().onOrgChange(() => | ||
| colorWHenProductionOrgHandler() |
| */ | ||
| vscode.window.onDidChangeWindowState(async e => { | ||
| if (e.focused) { | ||
| await colorWHenProductionOrgHandler(); |
| ); | ||
| } | ||
| }); | ||
| return await colorWHenProductionOrgHandler(); |
| ); | ||
| } | ||
|
|
||
| public static async isAProductionOrg(username: string): Promise<boolean> { |
There was a problem hiding this comment.
Please review https://forcedotcom.github.io/sfdx-core/classes/org_org.Org-1.html to determine this.
There was a problem hiding this comment.
@peternhale is there an affirmative case for "this is a production org"? I'm not seeing that in these docs, so it's looking like Production would be the fallback case.
There was a problem hiding this comment.
@randi274 Yes. production should be the fallback.
There was a problem hiding this comment.
Got it! @interfaceconjurer and I were chatting about this detail today, it might be worth y'all discussing the possibility of "Production" being overly inclusive.
I thought about just changing the color of the org picker as well, but I feel that it might not be enough of an eye catcher 👀 . We might even add more element later in the picklist. What do you think about it @CristiCanizales ? |
| !authInfoFields.isSandbox && | ||
| !authInfoFields.instanceUrl?.includes('sandbox.my.salesforce.com') |
There was a problem hiding this comment.
Should this also exclude scratch orgs (!authInfoFields.isScratch)?
|
we don't think we can get close enough to "is this really a production org". We'll have too many "false positives" where it's not actually a production org but we'd be saying that it is. And there's not a good way via the APIs to be sure what the org is. |

fix #5517
What does this PR do?
Create a setting to allow the status bar to change color when the default org is a production one
What issues does this PR fix or reference?
Check #5517 for details