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

Full page extension views, containers, shared headers + footers #4655

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

pete-watters
Copy link
Contributor

@pete-watters pete-watters commented Dec 7, 2023

Try out Leather build 0f33d98Extension build, Test report, Storybook, Chromatic

This PR covers:

These changes also fix a few bugs:

There were several steps involved and lots of refactoring:

  • replace baseDrawer with Radix.Dialog and gather together all of our header code
  • deprecate components like ControlledDrawer and simplify things migrating to Dialogs
  • standardise the viewport width we use so that extension mode matches popout
  • move our CSS reliance (radix, global styles) from APP -> UI library
  • make our modals look like full pages in extension view
  • add new UI components to story book
  • refactor uses of navigate out of Dialog
  • replace all headers with new components - refactoring to remove reliance on state and navigate hooks
  • implement screen background colour change based on screen variant ('home', 'page' etc.)
  • finish work on new set-password page + onboarding pages
  • finish work on two-column layout for mnemonic keys
  • add new settings dropdown Feature: Settings #4313
  • Fix configuration of theme while locked #4826
  • test scroll behaviour app wide
  • fix settings menu sub-menu + add new icons
  • Implement signout designs
  • Implement fund layout
  • test on windows
  • fix bugs with popup content BG colours

@pete-watters pete-watters changed the title Chore/4370/design system containers WIP: add design system containers + fix modals in extension Dec 7, 2023
@kyranjamie
Copy link
Collaborator

Any reason we don't make the extension popup bigger instead of the other one smaller? If we can use one html file for both then 👍🏼

@kyranjamie
Copy link
Collaborator

@pete-watters just tested this PR and it's broken the elastic scroll behaviour on macOS

@kyranjamie
Copy link
Collaborator

kyranjamie commented Dec 7, 2023

dev

2023-12-07-000038.mp4

This PR

2023-12-07-000039.mp4

@pete-watters
Copy link
Contributor Author

dev

2023-12-07-000038.mp4
This PR

2023-12-07-000039.mp4

Thanks, I didn't know we had that or how rich you are! I'll make sure to fix it

@pete-watters
Copy link
Contributor Author

pete-watters commented Dec 7, 2023

Any reason we don't make the extension popup bigger instead of the other one smaller? If we can use one html file for both then 👍🏼

I'll check and try make it bigger. I found how we specify the pop-out size more easily than how we specify the extension size but I'll investigate. Thanks!

One reason to make it smaller is @mica000 said we use 392px in the designs for extension size. I will work with her to discuss making it bigger

@pete-watters pete-watters force-pushed the chore/4370/design-system-containers branch 4 times, most recently from 08e150b to bbf8288 Compare December 14, 2023 08:50
@pete-watters
Copy link
Contributor Author

Any reason we don't make the extension popup bigger instead of the other one smaller? If we can use one html file for both then 👍🏼

We tried a few things and went with this.

TLDR - Extension + popup are the same dimensions now - 390 x 756 . We can assess that and tweak as required

@@ -17,12 +16,14 @@ export function HighFeeDrawer(props: { learnMoreUrl: string }) {
}, [isShowingHighFeeConfirmation, setIsShowingHighFeeConfirmation]);

return (
<ControlledDrawer
icon={<ErrorIcon color="error.label" size="xl" />}
<BaseDrawer
Copy link
Contributor Author

@pete-watters pete-watters Dec 14, 2023

Choose a reason for hiding this comment

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

We pass an ErrorIcon to this. I removed it as this was the only place using it.

It was looking like this:
Screenshot 2023-12-14 at 10 21 07

I'm changing it so the warning icon will appear in the modal beside the text:
Screenshot 2023-12-14 at 10 25 21

NOTE - I forced display of this so it's missing the amount Are you sure you want to pay AMOUNT in

What do you think @mica000 @fabric-8 - is it OK to move this icon from the header? It's the only place we have one there.

I will move the close icon to the right also

Copy link

Choose a reason for hiding this comment

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

Good with me!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great, thanks! It's coming soon(tm) 🚀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@markmhendrickson this is the High Fee dialog I mentioned to you yesterday.

@fbwoolf - do you know how to test this properly / how it should work. I tried to refactor it as it was similar to other dialogs, storing open / close in jotai state. I added new simpler useState handlers but I need to make sure it works.

You can search for setIsShowingHighFeeConfirmation on my branch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kyranjamie - see this RE HighFee dialog.

I guess it shows when the fee is considered high but I am lacking knowledge here as to what is considered a high fee.

e.g. as a user when I try and transfer X stacks and the fee is Y then show the high fee warning

I think it's still working after my changes but I'm not certain so I want to check

theme/global/global.ts Outdated Show resolved Hide resolved
@pete-watters pete-watters force-pushed the chore/4370/design-system-containers branch 2 times, most recently from 0df2194 to 4ce1884 Compare December 14, 2023 12:37
@pete-watters pete-watters force-pushed the chore/4370/design-system-containers branch 2 times, most recently from 5e84a1a to 6223fd1 Compare December 14, 2023 16:21
width: { base: '100vw', md: '90vw' },
height: { base: '100vh', md: 'unset' },
maxWidth: { base: '100vw', md: '450px' },
maxHeight: { base: '100vh', md: '85vh' },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm using the panda style of responsive objects as when I was using our hooks useViewportMinWidth I was noticing some extra re-renders and jumpy behaviour.

For example on the Recieve modal, the UI was re-rendering and flashing when moving from Receive to Receive BTC

@pete-watters pete-watters linked an issue Dec 15, 2023 that may be closed by this pull request
@pete-watters pete-watters force-pushed the chore/4370/design-system-containers branch 2 times, most recently from b9effeb to 733498b Compare December 15, 2023 11:28
@pete-watters pete-watters force-pushed the chore/4370/design-system-containers branch 3 times, most recently from 74e848e to ebb1742 Compare March 19, 2024 19:28
@pete-watters
Copy link
Contributor Author

pete-watters commented Mar 19, 2024

I worked through the remaining bugfixes and changes in Notion and as discussed.

I have fixed them all apart from outstanding work to be decided on background colours globally.

There are a few issues in Notion I am now unable to reproduce:

I changed the signature headers, hopefully getting them all but I'm not sure

@fbwoolf @kyranjamie if you can please review the latest code changes that would be great. Then I can hopefully add one last commit that updates the colours.

I'm not sure if we do need to work on the receive screens also as we always need to scroll to see the address for STX / receive ordinal

Area.mp4

CC @markmhendrickson @fabric-8 @mica000


import { isKnownPopupRoute } from './get-popup-header';

function isHomePage(pathname: RouteUrls) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@pete-watters I was thinking about this implementation yesterday where you are using variants of one container with lots of detecting of routes, I am wondering what you think about an alt approach where we just have several, more specific, containers that wrap the routes that need it? I know the code might be less DRY, but sometimes it makes scaling the code a bit easier long term? Same question for headers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, its a real mess. A lot of this complication came from having different background colours for different page types e.g. Home and Page. It was also a bridge to get us away from how we were doing things before - storing Header components in application state.

We are getting rid of the colour variations now and having more normalised page backgrounds so when I am working on that I will try and simplify everything and ditch these complex variants.

Once everything is working and signed off we can assess and figure out a better pattern to use

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, yep, makes sense. 👍

@pete-watters pete-watters force-pushed the chore/4370/design-system-containers branch 4 times, most recently from c2f1ec3 to 429c842 Compare March 22, 2024 14:26
@pete-watters
Copy link
Contributor Author

pete-watters commented Mar 22, 2024

@fabric-8 @markmhendrickson @mica000 : I have updated the colour styles to match the new design. Please take a look and let me know if there are any more updates to make. We can do a further QA now and hopefully sign off on this.

@kyranjamie @fbwoolf : I squashed all the commits again. This should be code complete now bar any further updates so I'd appreciate on final review. I will think about how to implement a better software architecture design to simplify things now we have made the final decision on colours. I'll try to remove some of the spaghetti code looking up routes etc. and use more container wrappers as Fara suggested

Copy link
Collaborator

@kyranjamie kyranjamie left a comment

Choose a reason for hiding this comment

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

Huge effort, Pete. Let's get it MERGED

@pete-watters pete-watters force-pushed the chore/4370/design-system-containers branch from a0eeb00 to 0f33d98 Compare March 28, 2024 07:05
@pete-watters pete-watters added this pull request to the merge queue Mar 28, 2024
Merged via the queue into dev with commit 6262267 Mar 28, 2024
29 of 30 checks passed
@pete-watters pete-watters deleted the chore/4370/design-system-containers branch March 28, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:ui UI engineering specific tasks.
Projects
None yet
8 participants