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

Frontend.XF: added the settings icon and side menu #203

Closed

Conversation

kubaflo
Copy link

@kubaflo kubaflo commented Jan 30, 2023

iOS Android
Simulator Screen Shot - iPhone 14 Pro Max - 2023-01-30 at 15 32 04 Screenshot_1675089174
Simulator Screen Shot - iPhone 14 Pro Max - 2023-01-30 at 15 32 07 Screenshot_1675089176

@kubaflo kubaflo marked this pull request as ready for review January 30, 2023 14:08
@kubaflo kubaflo force-pushed the Frontend.XF-Added-Settings-UI branch from 9bd5499 to c6179db Compare January 30, 2023 14:30
@kubaflo kubaflo changed the title Added the settings icon and side menu Frontend.XF: Added the settings icon and side menu Jan 30, 2023
@knocte
Copy link
Member

knocte commented Jan 30, 2023

@kubaflo why do you include the two PNG logo files? there are already logo files in the iOS project

@knocte
Copy link
Member

knocte commented Jan 30, 2023

there are already logo files in the iOS project

Here: https://github.com/nblockchain/geewallet/tree/frontend/src/GWallet.Frontend.XF.iOS/Assets.xcassets/AppIcon.appiconset

@@ -141,5 +144,6 @@
<PackageReference Include="Fsdk" Version="0.6.0--date20230118-0634.git-b829db2">
<GeneratePathProperty></GeneratePathProperty>
</PackageReference>
<EmbeddedResource Include="Resources\Fonts\FontAwesomeSolid.otf" />
Copy link
Member

Choose a reason for hiding this comment

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

@kubaflo let's remove this, we can improve the design in a separate PR

Copy link
Author

Choose a reason for hiding this comment

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

Okay

this.IsPresented <- true

member this.OpenSettings_Tapped(_: obj, _: EventArgs) =
Application.Current.MainPage.DisplayAlert("Settings", "Succesfully opened the settings page", "Ok") |> ignore
Copy link
Member

Choose a reason for hiding this comment

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

@kubaflo let's hook up the real feature, same as what Frontend.Console is doing, please

Copy link
Author

Choose a reason for hiding this comment

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

But isn't it a request beyond the scope of this task? I thought I was supposed to add an icon and a side menu, not implement the things in the settings inside the app. I can do it but I don't think that it should be done in this PR

Copy link
Member

Choose a reason for hiding this comment

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

There are things that can be split to other PRs and there are things that cannot. If I merge this PR as is, then the frontend branch would be in an unreleasable state, you understand? We cannot show to end-users certain UI that does nothing.

Copy link
Author

Choose a reason for hiding this comment

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

@knocte okay, I will implement it

Copy link
Author

Choose a reason for hiding this comment

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

@knocte can I use popups to implement this functionality or you'd prefer separate pages?

Copy link
Member

Choose a reason for hiding this comment

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

it depends; if popups mean a lot of platform-specific code, I'd prefer pages

@kubaflo
Copy link
Author

kubaflo commented Jan 31, 2023

@kubaflo why do you include the two PNG logo files? there are already logo files in the iOS project

Fixed

xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:GWallet.Frontend.XF"
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
Copy link
Member

Choose a reason for hiding this comment

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

what's this iOS thing?

Copy link
Author

Choose a reason for hiding this comment

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

Without we wouldn't be able to apply a safe area to the ios version of the app

Copy link
Member

Choose a reason for hiding this comment

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

what is a safe area?

Copy link
Author

@kubaflo kubaflo Jan 31, 2023

Choose a reason for hiding this comment

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

It's an area where the notch is. Here are the screens how the app would look like without it

Simulator Screen Shot - iPhone 14 Pro Max - 2023-01-31 at 13 16 51 Simulator Screen Shot - iPhone 14 Pro Max - 2023-01-31 at 13 16 55

@knocte
Copy link
Member

knocte commented Jan 31, 2023

This branch cannot be rebased due to conflicts

What happened here? (I generally recommend rebasing PRs via git rebase command, not git merge.)

@kubaflo
Copy link
Author

kubaflo commented Feb 3, 2023

iOS Simulator Screen Shot - iPhone 14 Pro Max - 2023-02-04 at 00 27 55 Simulator Screen Shot - iPhone 14 Pro Max - 2023-02-04 at 00 28 11 Simulator Screen Shot - iPhone 14 Pro Max - 2023-02-04 at 00 28 34
Android Screenshot_1675467182 Screenshot_1675467488 Screenshot_1675467478

@knocte This is how it looks now :)

@kubaflo kubaflo force-pushed the Frontend.XF-Added-Settings-UI branch from 68a96c8 to 3901e73 Compare February 5, 2023 14:45
@kubaflo
Copy link
Author

kubaflo commented Feb 5, 2023

@knocte I did the rebase, squashed commits, removed unnecessary things and removed colours

@kubaflo kubaflo force-pushed the Frontend.XF-Added-Settings-UI branch 3 times, most recently from f575e81 to 87ff387 Compare February 5, 2023 15:06
@knocte
Copy link
Member

knocte commented Feb 5, 2023

@knocte I did the rebase,

And you also squashed commits! Nice.

But CI is red because of this warning:

geewallet/src/GWallet.Frontend.XF/SettingsPage.xaml.fs(58,17): error FS0020: The result of this expression has type 'Async<unit>' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. [/__w/geewallet/geewallet/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj]

We have warnings as errors in Release mode :)

@kubaflo kubaflo force-pushed the Frontend.XF-Added-Settings-UI branch 2 times, most recently from 73e25ec to 8327249 Compare February 5, 2023 15:40
@kubaflo
Copy link
Author

kubaflo commented Feb 5, 2023

@knocte I did the rebase,

And you also squashed commits! Nice.

But CI is red because of this warning:

geewallet/src/GWallet.Frontend.XF/SettingsPage.xaml.fs(58,17): error FS0020: The result of this expression has type 'Async<unit>' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'. [/__w/geewallet/geewallet/src/GWallet.Frontend.XF/GWallet.Frontend.XF.fsproj]

We have warnings as errors in Release mode :)

@knocte I fixed this error. However, if CI after this is still red, I will need your help :)

@kubaflo kubaflo force-pushed the Frontend.XF-Added-Settings-UI branch from 8327249 to 440e0bb Compare February 5, 2023 16:27
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="GWallet.Frontend.XF.SettingsPage">

<AbsoluteLayout>
Copy link
Member

Choose a reason for hiding this comment

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

@kubaflo question, is there any specific reason of why you used AbsoluteLayout here instead of an non-absolute alternative?

Copy link
Author

@kubaflo kubaflo Feb 6, 2023

Choose a reason for hiding this comment

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

Yes, it is necessary as I want the 'mainLayout' to occupy 70% of the page's width

<StackLayout x:Name="mainLayout"
                      AbsoluteLayout.LayoutFlags="XProportional,SizeProportional"
                      AbsoluteLayout.LayoutBounds="0.5,50,0.7,1"
                      VerticalOptions="FillAndExpand">

@kubaflo kubaflo force-pushed the Frontend.XF-Added-Settings-UI branch from 440e0bb to dadd3d3 Compare February 6, 2023 12:23
<Image HeightRequest="80"
WidthRequest="80"
Margin="0,0,0,10"
x:Name="logoInSidemenu"/>
Copy link
Member

@knocte knocte Feb 8, 2023

Choose a reason for hiding this comment

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

@kubaflo cosmetic: let's rename this to sideMenuImg (this way, in case we decide to stop using a logo in the future, we don't need to rename it again)

<Label VerticalOptions="Center" Text="#"/>
<Label Text="Check you still remember your payment password"/>
<StackLayout.GestureRecognizers>
<TapGestureRecognizer CommandParameter="Check you still remember your payment password" Tapped="OpenSettings_Tapped"/>
Copy link
Member

Choose a reason for hiding this comment

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

@kubaflo 2 cosmetic things here:

  • Let's not use underscores in method names
  • We don't need to put the full sentence here in the CommandParameter attribute right? I mean, in case we need to change the text of the UI in the future, we should be able to just change it in one place, not three

<Label VerticalOptions="Center" Text="#"/>
<Label Text="Check you still remember your secret recovery phrase"/>
<StackLayout.GestureRecognizers>
<TapGestureRecognizer CommandParameter="Check you still remember your secret recovery phrase" Tapped="OpenSettings_Tapped"/>
Copy link
Member

Choose a reason for hiding this comment

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

@kubaflo same 2 cosmetic things here ^

<Label VerticalOptions="Center" Text="#"/>
<Label Text="Wipe your current wallet, in order to start from scratch"/>
<StackLayout.GestureRecognizers>
<TapGestureRecognizer CommandParameter="Wipe your current wallet, in order to start from scratch" Tapped="OpenSettings_Tapped"/>
Copy link
Member

Choose a reason for hiding this comment

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

@kubaflo same 2 cosmetic things here ^

<controls:CircleChartView x:Name="normalChartView"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>
<controls:CircleChartView x:Name="normalChartView"
Copy link
Member

Choose a reason for hiding this comment

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

@kubaflo cosmetic: do you mind moving all the XML fragment that you didn't modify, to the left one level of indentation? I know that your change in the XAML should cause this XML fragment to move to the right, but I'd prefer if do proper formatting of the XML in a 2nd commit (I'm planning to use an automatic XML formatter for that)

Copy link
Member

Choose a reason for hiding this comment

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

@kubaflo (this way, this part will not show up in the diff)

@@ -46,6 +46,8 @@ type BalancesPage(state: FrontendHelpers.IGlobalAppState,
let contentLayout = base.FindByName<StackLayout> "contentLayout"
let normalChartView = base.FindByName<CircleChartView> "normalChartView"
let readonlyChartView = base.FindByName<CircleChartView> "readonlyChartView"
let logoInSideMenu = base.FindByName<Image> "logoInSidemenu"
Copy link
Member

Choose a reason for hiding this comment

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

@kubaflo as we decided to rename the image name to sideMenuImg, let's also change the variable name here ^

//loading & result
let resultMessage = base.FindByName<Label> "resultMessage"
let loadingIndicator = base.FindByName<ActivityIndicator> "loadingIndicator"
let option = option
Copy link
Member

Choose a reason for hiding this comment

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

@kubaflo this line above is not needed

VerticalOptions="FillAndExpand"/>
IsVisible="False"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>
Copy link
Member

Choose a reason for hiding this comment

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

@kubaflo see above ^ this space additions are not needed

@kubaflo kubaflo force-pushed the Frontend.XF-Added-Settings-UI branch 2 times, most recently from 07f32ce to e8cfa47 Compare February 9, 2023 15:57
@kubaflo kubaflo changed the title Frontend.XF: Added the settings icon and side menu Frontend.XF: added the settings icon and side menu Feb 9, 2023
@knocte
Copy link
Member

knocte commented Feb 9, 2023

We have fixed the check-password performance problem, if you rebase this PR then we can test the improvement with the settings page.

@kubaflo kubaflo force-pushed the Frontend.XF-Added-Settings-UI branch from e8cfa47 to 9f5e79c Compare February 9, 2023 22:52
@kubaflo
Copy link
Author

kubaflo commented Feb 9, 2023

We have fixed the check-password performance problem, if you rebase this PR then we can test the improvement with the settings page.

It works!!!

@kubaflo kubaflo force-pushed the Frontend.XF-Added-Settings-UI branch 7 times, most recently from 4096cd4 to 99cd00e Compare February 15, 2023 13:05
Added the settings page.
Added the settings icon and side menu.
@kubaflo kubaflo force-pushed the Frontend.XF-Added-Settings-UI branch from 99cd00e to 8d64c2b Compare March 2, 2023 14:47
@knocte knocte force-pushed the frontend branch 8 times, most recently from a02943f to 7a94774 Compare August 12, 2023 03:03
@knocte knocte deleted the branch nblockchain:frontend October 15, 2023 13:54
@knocte knocte closed this Oct 15, 2023
@knocte
Copy link
Member

knocte commented Oct 16, 2023

The closing of this PR was unintended (it happened because the 'frontend' branch has now disappeared). @aarani can you please re-create this PR as it was, but targetting the master branch now? Thanks

@aarani
Copy link
Contributor

aarani commented Oct 16, 2023

Superseded by #233

This pull request was closed.
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.

3 participants