Salesforce-Inspector-reloaded icon indicating copy to clipboard operation
Salesforce-Inspector-reloaded copied to clipboard

[UI] Dark Mode

Open Damecek opened this issue 1 year ago • 22 comments

Hey great job resurrecting the project. Could you please add a dark mode? Link to issue in previous project.

Damecek avatar Apr 18 '23 07:04 Damecek

Hi @Damecek , I started to work on a dark mode version few times ago but did not finished it. Since the extension is released in the Chrome Web Store I may have some contributions on this feature.

I'll keep you informed in this thread !

tprouvot avatar Apr 18 '23 07:04 tprouvot

Chrome has an automatic dark mode which can be enabled from the dev console. Can be a good starting point to reproduce those colors in the extension: image

image image

tprouvot avatar Dec 29 '23 08:12 tprouvot

@tprouvot you've put the help wanted tag, is there a branch/fork that's being used for development?

Astisme avatar Jan 10 '24 08:01 Astisme

Hi @Astisme,

Yes the link is in my comment from the 18/04/23 dark mode version. I think that for now it is easier to start from a new one.

The idea would be :

  1. Add an input toggle in the new "Options" page to enable / disable it and store the preference in localStorage
  2. Detect if dark mode is the preferred theme in browser window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches by default if no preference is stored enable the dark mode if the previous code returs true

You can find some general guidelines on the contribution section.

tprouvot avatar Jan 10 '24 20:01 tprouvot

Hey @tprouvot I'm working on this at https://github.com/Astisme/Salesforce-Inspector-reloaded/tree/feature/darkModeUI_v2 It seems like there's an issue on the addons/links.js file: chrome says Uncaught SyntaxError: Unexpected token 'export'. Do you get the same error?

Astisme avatar Jan 22 '24 17:01 Astisme

Hi @Astisme, I've seen it few months ago but this is not something which affects the functionality itself.

tprouvot avatar Jan 22 '24 17:01 tprouvot

I've also tried working on firefox but I get this error on loading: `Extension is invalid

Reading manifest: Error processing background: Value must either: contain the required "page" property, contain the required "scripts" property, or not contain an unexpected "type" property`

Reading the file

  • it doesn't seem that a page property is defind.
  • the scripts string is found only on content_scripts
  • the type property is not found

Astisme avatar Jan 22 '24 17:01 Astisme

Hi @Astisme, I've seen it few months ago but this is not something which affects the functionality itself.

It doesn't let me run the extension so I guess it does a little bit ahah

Astisme avatar Jan 22 '24 17:01 Astisme

I've also tried working on firefox but I get this error on loading: `Extension is invalid

Reading manifest: Error processing background: Value must either: contain the required "page" property, contain the required "scripts" property, or not contain an unexpected "type" property`

Reading the file

  • it doesn't seem that a page property is defind.
  • the scripts string is found only on content_scripts
  • the type property is not found

Firefox manifest needs some adjustments and the releaseCandidate branch does not reflect those (firefoxAddon does)

tprouvot avatar Jan 22 '24 20:01 tprouvot

Hi @Astisme, I've seen it few months ago but this is not something which affects the functionality itself.

It doesn't let me run the extension so I guess it does a little bit ahah

Are you experiencing this issue on releaseCandidate ?

tprouvot avatar Jan 22 '24 20:01 tprouvot

mhh it seems like the chrome issue is no longer a problem (I don't know what I've done tbh)

Astisme avatar Jan 22 '24 20:01 Astisme

Just to be clear, do you want me to test everything on firefox as well or will it be done once firefoxAddon gets merged? Without the changes on that branch it's pretty much impossible to run the addon on firefox.

Astisme avatar Jan 28 '24 20:01 Astisme

Hi @Astisme, I'm expecting that the dev you are working on are not exclusive to chrome and compatible with firefox. A test on firefox would help you to check that.

Once your devs are done, you can create a new branch based on firefoxAddon and merge your dev into it to check the behaviour on firefox. Don't hesitate to share me the link on your current branch so that I can check if it goes the way I was expected

tprouvot avatar Jan 29 '24 13:01 tprouvot

https://github.com/Astisme/Salesforce-Inspector-reloaded/tree/feature/darkModeUI_v2

image | image

Astisme avatar Jan 29 '24 17:01 Astisme

Hi @tprouvot, I'm at a good point in the implementation of this feature. Would you mind telling me where the inspect-inline.js is invoked? I only see it in the manifest and it isn't imported anywhere.

Nevermind, I guess it works just like button.js which means it's called every time by the browser.

Astisme avatar Feb 05 '24 11:02 Astisme

Hi, I'm having issues with the test-framework: it does not find AccountContactRelation during the data-export test. Do you have any insights on where it looks for this Relation?

Everything else works fine. I'm still having troubles getting it to work on firefox

  • running the firefoxAddon branch by itself does not make the addon to load
  • after branching from firefoxAddon and merging my devs, firefox refuses the manifest image

May you please check what's going on here, please?

Astisme avatar Feb 07 '24 18:02 Astisme

Here are some new insighs. image

image

image

image

Astisme avatar Feb 07 '24 23:02 Astisme

AccountContactRelation

Have you deployed the /test folder to your org as described in UnitTest section ? image

It contains account settings to enable this https://github.com/tprouvot/Salesforce-Inspector-reloaded/blob/master/test/main/default/settings/Account.settings-meta.xml

tprouvot avatar Feb 08 '24 13:02 tprouvot

Yes, I did and I've also followed the other steps. I've tried to reupload all of the metadata and Inspector_Test__c, SfInspctor and Account (settings) have been changed so I guess that the first time didn't work.

It is still not working though. The issue is still on that AccountContactRelation.

  • Account
  • AccountChangeEvent
  • AccountCleanInfo
  • AccountContactRole
  • AccountContactRoleChangeEvent
  • AccountFeed
  • AccountHistory
  • AccountPartner
  • AccountShare
  • ThirdPartyAccountLink
  • UserProvAccount
  • UserProvAccountStaging

That's 12 account autocompletes

Astisme avatar Feb 08 '24 14:02 Astisme

I found a rather interesting fact: while trying to disable the feature "contacts to multiple accounts", I found that Salesforce has not "registered" that the feature was enabled as it gives out the error You can't disable Contacts to Multiple Accounts unless the feature is enabled. It seems like there could be an issue with deploying this specific setting.

I've created a new dev org and have manually enabled this setting. Now the test-framework is working correctly on Chrome

Astisme avatar Feb 12 '24 20:02 Astisme

The edits do not work on firefox due to the export in the links.js file (I know for sure because I found a fix for this and the extension now works on firefox as well [kinda])

Astisme avatar Feb 12 '24 21:02 Astisme

Hey great job resurrecting the project. Could you please add a dark mode? Link to issue in previous project.

@Damecek hah you beat me this time. My first thought was, oh someone requested on the old project?... oh yeah it was me hah.

Saw the PR has had a lot of activity. Thanks for all the work @Astisme and @tprouvot! Was also happy to hear you on the SalesforceWay Podcast :).

Julian88Tex avatar Jun 06 '24 04:06 Julian88Tex