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

[DDW-376] Cleanup SimpleTheme Config in Daedalus #1139

Merged
merged 70 commits into from
Nov 15, 2018

Conversation

MarcusHurney
Copy link
Contributor

@MarcusHurney MarcusHurney commented Oct 23, 2018

  • This PR refactors the theme configuration of Daedalus so that the css variables used in react-polymorph components are distinguishable from other css variables used in Daedalus internally.

  • react-polymorph css vars are organized into individual objects per component.

  • Prefixes the react-polymorph css vars with --rp and renames them to follow a uniform naming convention that describes their use from broad to specific.

    • Example: --rp-formfield-label-text-color and --rp-formfield-label-text-color-disabled.
      This convention follows --rp- prefix + component + element + property + state.
  • Removes the existing configuration of SimpleTheme in Daedalus which imports SimpleTheme from the react-polymorph module and overrides its scss variables manually.

  • Creates new react-polymorph css vars in addition to the existing set. The new ones allow nearly all of the existing css properties within each component to be themed using a configuration object / template. This reduces existing single instance css variables in Daedalus which target properties on react-polymorph elements that are not currently exposed for customization. Such as font-size, border, height, and width.

  • Creates source/renderer/app/themes/overrides directory for styles that target react-polymorph components but aren't configurable through --rp css vars. These overrides are passed to ThemeProvider's themeOverrides prop for composition with the base theme.

Review Checklist:

Basics

  • PR is updated to the most recent version of target branch (and there are no conflicts)
  • PR has good description that summarizes all changes and shows some screenshots or animated GIFs of important UI changes
  • CHANGELOG entry has been added and is linked to the correct PR on GitHub
  • Automated tests: All acceptance tests are passing (yarn run test)
  • Manual tests (minimum tests should cover newly added feature/fix): App works correctly in development build (yarn run dev)
  • Manual tests (minimum tests should cover newly added feature/fix): App works correctly in production build (yarn run package / CI builds)
  • There are no flow errors or warnings (yarn run flow:test)
  • There are no lint errors or warnings (yarn run lint)
  • Text changes are proofread and approved (Jane Wild)
  • There are no missing translations (running yarn run manage:translations produces no changes)
  • UI changes look good in all themes (Alexander Rukin)
  • Storybook works and no stories are broken (yarn run storybook)
  • In case of dependency changes yarn.lock file is updated

Code Quality

  • Important parts of the code are properly documented and commented
  • Code is properly typed with flow
  • React components are split-up enough to avoid unnecessary re-rendering
  • Any code that only works in Electron is neatly separated from components

Testing

  • New feature / change is covered by acceptance tests
  • All existing acceptance tests are still up-to-date
  • New feature / change is covered by Daedalus Testing scenario
  • All existing Daedalus Testing scenarios are still up-to-date

After Review:

  • Merge PR
  • Delete source branch
  • Move ticket to done on the Youtrack board

@nikolaglumac
Copy link
Contributor

@MarcusHurney can you please add more info in the PR description? Thanks 🙏

@MarcusHurney
Copy link
Contributor Author

@nikolaglumac
@DominikGuzei
After reviewing this PR and after I make any necessary adjustments, @a-rukin will need to review the UI before it can be merged. Thanks!

@nikolaglumac
Copy link
Contributor

@MarcusHurney can you please merge in latest develop and fix the conflicts? Thanks!

@DominikGuzei
Copy link
Member

@MarcusHurney i updated to latest develop and fixed the failing acceptance tests 👍
@nikolaglumac @a-rukin this is now ready to be tested!

@nikolaglumac
Copy link
Contributor

@MarcusHurney @DominikGuzei the changes look good but I have failing tests - it's actually the same problem as with #1156
I am puzzled how this now appeared in this branch 😱

screen shot 2018-11-14 at 13 46 20
screen shot 2018-11-14 at 13 46 17

@nikolaglumac
Copy link
Contributor

@MarcusHurney @DominikGuzei I just got the same issues on develop branch. It could be related to my local setup :-/

nikolaglumac
nikolaglumac previously approved these changes Nov 14, 2018
Copy link
Contributor

@nikolaglumac nikolaglumac left a comment

Choose a reason for hiding this comment

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

Great work guys!

@DominikGuzei DominikGuzei merged commit 018ee6a into develop Nov 15, 2018
@DominikGuzei DominikGuzei deleted the chore/ddw-376-cleanup-simple-theme branch November 15, 2018 12:21
SebastienGllmt added a commit to Emurgo/yoroi-frontend that referenced this pull request Jan 15, 2019
To upgrade to the latest version of `react-polymorph` (v8) we need to do two upgrades:

- [x] upgrade to v7.2 (based on [this PR](input-output-hk/daedalus#950))
- [x] upgrade to v8 (based on [this PR](input-output-hk/daedalus#1139))

I made both upgrades as the two commits to this PR and it's probably easier to read if you code review the two commits individually (since the changes are orthogonal). I also have a README change that explains what `react-polymorph` v8 does but you can find something similar in the Daedalus PR I linked above.

v8 also introduces large refactoring changes that makes a mess of the whole thing. I tried my best to make all the UI look the same while keeping the improvements from v8 but one thing I couldn't stop is that the font size is not 1px bigger across the app (which honestly is not a big deal so I didn't bother). There are probably small things that changed here in there but I manually compared the whole UI and everything looked close enough I don't think anybody would notice any difference that did occur.
@nikolaglumac nikolaglumac mentioned this pull request Feb 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants