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

[HelpDot] Add light mode #38107

Merged
merged 25 commits into from
Mar 26, 2024
Merged

Conversation

rushatgabhane
Copy link
Member

@rushatgabhane rushatgabhane commented Mar 11, 2024

Details

Fixed Issues

$ #37911
PROPOSAL: N.A.

Tests

  1. Start helpsite - cd docs && npm run createDocsRoutes && bundle exec jekyll serve --livereload --safe
  2. Go to your computer's settings > appearance > Enable light mode.
  3. Verify that the helpsite is in light mode.
  4. Verify that the logo is black and green in color.
  5. Navigate to an article and verify that text is following product color.
  6. Go to search and verify that colors look good.

Dark mode

  1. Enable dark mode from your computer's settings.
  2. Verify that the helpsite is in dark mode.
  3. Verify that logo is white and green.
  4. Verify that production helpsite colors match for articles, search etc.
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Light mode ### Home image

Footer

image

Search

image

Search result

image

Hubs

image

Sections

image

Article

image

Platform selector

image image

Links

image
Dark mode image image image

@rushatgabhane rushatgabhane changed the title Light mode [HelpDot] Add light mode Mar 11, 2024
@rushatgabhane rushatgabhane marked this pull request as ready for review March 21, 2024 20:52
@rushatgabhane rushatgabhane requested a review from a team as a code owner March 21, 2024 20:52
@melvin-bot melvin-bot bot requested review from Pujan92 and removed request for a team March 21, 2024 20:52
Copy link

melvin-bot bot commented Mar 21, 2024

@Pujan92 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@rushatgabhane
Copy link
Member Author

@Pujan92 could you please approve to assign internal. Thanks 🙇

@rushatgabhane
Copy link
Member Author

@shawnborton I've attached screenshot for light and dark mode. Please let me know if it looks good 🙇

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Layer_1" x="0" y="0" version="1.1" viewBox="0 0 189 30" style="enable-background:new 0 0 189 30" xml:space="preserve"><style type="text/css">.st0{fill:#002e22}@media(prefers-color-scheme: dark){.st0{fill:#fffaf0}}.st1{fill:#03d47c}</style><g><g><path d="M0,23.1h13.9V19H5.1v-3.8h7.1V11H5.1V7.4h8.8V3.3H0V23.1z" class="st0"/><path d="M31.1,7.7H25l-2,3.7l-2.1-3.7h-6.3l5.1,7.5l-5.5,8h6.1l2.4-4.1l2.4,4.1h6.3l-5.5-8L31.1,7.7z" class="st0"/><path d="M40.8,7.3L40.8,7.3c-1.7,0-3.2,0.7-4.2,2V7.7h-4.7v22h5v-7.7c0.9,0.9,2.3,1.5,3.9,1.5c4.1,0,6.9-3.1,6.9-8.1 C47.7,10.5,45,7.3,40.8,7.3L40.8,7.3z M39.7,19.4c-1.9,0-3-1.5-3-4s1.1-4,3-4c1.9,0,3,1.4,3,4S41.5,19.4,39.7,19.4z" class="st0"/><path d="M56.4,19.6c-1.5,0-2.7-0.9-3-3.1h10.6v-0.7c0-4.8-2.7-8.5-7.9-8.5c-3.7,0-7.9,2-7.9,8.1 c0,4.9,3.2,8.1,8.1,8.1c2.9,0,6.6-1.1,7.7-5.6h-5.1C58.9,18.7,58.2,19.6,56.4,19.6L56.4,19.6z M56.2,11c1.4,0,2.4,0.8,2.6,2.6 h-5.2C54,11.6,55,11,56.2,11L56.2,11z" class="st0"/><path d="M73.9,7.3c-1.7,0-3.2,0.8-4.2,2.2V7.7h-4.7v15.4h5v-8.6c0-2.1,1.1-3,2.4-3c1.5,0,2.3,0.6,2.3,3v8.6h5v-9 C79.7,9.2,77.7,7.3,73.9,7.3L73.9,7.3z" class="st0"/><path d="M97.9,0.7c-1.5,0-2.6,1.1-2.6,2.6c0,1.4,1.1,2.6,2.6,2.6c1.5,0,2.6-1.2,2.6-2.6C100.5,1.8,99.5,0.7,97.9,0.7z" class="st0"/><path d="M100.4,7.7h-5v15.4h5V7.7z" class="st0"/><path d="M88.9,13.5l-1.2-0.3c-1.3-0.3-1.8-0.9-1.8-1.4c0-0.8,0.7-1.4,1.9-1.4c1.5,0,2.2,0.5,2.2,1.9h4.3 c-0.1-3.2-2-5.1-6.8-5.1c-4.1,0-6.6,1.5-6.6,5c0,2.7,1.8,3.9,6,4.9l1.2,0.3c1.3,0.3,1.8,0.9,1.8,1.5c0,0.8-0.8,1.2-2.1,1.2 c-1.7,0-2.5-0.6-2.7-2h-4.9c0.3,3.7,2.9,5.6,7.4,5.6c4.5,0,7.2-1.7,7.2-5.1C94.9,15.7,93.1,14.4,88.9,13.5L88.9,13.5z" class="st0"/><path d="M119.9,7.7L119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.3,20.2,177.3,16.2z" class="st1"/></g></g></svg>
Copy link
Member Author

@rushatgabhane rushatgabhane Mar 21, 2024

Choose a reason for hiding this comment

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

Added a media query inside svg.

<style type="text/css">
    .st0{
         fill:#002e22
    }
    @media(prefers-color-scheme: dark){
        .st0{
            fill:#fffaf0
        }
    }
    .st1{
        fill:#03d47c
    }
</style>

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, nice. Didn't know you can do that!

Can we change the fill color for the wordmark in dark mode to be E7ECE9 please? Thanks!

@Pujan92
Copy link
Contributor

Pujan92 commented Mar 22, 2024

@Pujan92 could you please approve to assign internal. Thanks 🙇

Ok. Approved directly without review based on above comment.

summary {
font-family: "ExpensifyNewKansas", "Helvetica Neue", "Helvetica", Arial, sans-serif;
font-family: 'ExpensifyNewKansas', 'Helvetica Neue', 'Helvetica', Arial, sans-serif;
font-weight: 500;
font-size: larger;
Copy link
Contributor

Choose a reason for hiding this comment

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

Weird that we aren't using a normal font size here. I know this isn't part of your PR but maybe we can follow up with some adjustments.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah sure, created an issue - #38986

@shawnborton
Copy link
Contributor

Is there a way to make a test build for easier testing?

And how are you making the logo change across light and dark modes?

@rushatgabhane
Copy link
Member Author

@shawnborton i added a media query inside the svg to change logo colors.

See - #38107 (comment)

@rushatgabhane
Copy link
Member Author

rushatgabhane commented Mar 26, 2024

Is there a way to make a test build for easier testing

@shawnborton i deployed my branch here - https://light-mode--fastidious-unicorn-246321.netlify.app/

You can use it to preview the website.

shawnborton
shawnborton previously approved these changes Mar 26, 2024
@shawnborton
Copy link
Contributor

Looks great to me!

@rushatgabhane
Copy link
Member Author

@tylerkaraszewski all yours! we're good to merge

@tylerkaraszewski tylerkaraszewski merged commit 5596af9 into Expensify:main Mar 26, 2024
9 of 10 checks passed
@melvin-bot melvin-bot bot added the Emergency label Mar 26, 2024
Copy link

melvin-bot bot commented Mar 26, 2024

@tylerkaraszewski looks like this was merged without a test passing. Please add a note explaining why this was done and remove the Emergency label if this is not an emergency.

@rushatgabhane
Copy link
Member Author

expected. the helpdot workflow doesn't work on forks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants