-
Notifications
You must be signed in to change notification settings - Fork 4
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
UI iteration 2 #73
UI iteration 2 #73
Conversation
...n/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/uicases/trades/MyTradesScreen.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outstanding work buddha 👏
Besides my code review comments, here is my functional review
- This PR is the perfect opportunity to implement back button navigation. At the moment, once you get to the Offers screen the only way to get out is by swiping left (which is great), but we need also the standard visual left arrow on the top left (next to the title) as it has become industry std in both iOS and Android these days. If you think this is a big deal please let me know and we can do it in a separate feature.
- Search bar: I can see that is just mocked at the moment, do we have a separate issue to work this one out? I'll refrain from commenting on that one for now (unless you ask me to do it now)
That's it for this first pass, let me know if you have any questions! 💪
@@ -0,0 +1,26 @@ | |||
package network.bisq.mobile.domain.data.model | |||
|
|||
// TODO: Update later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we please be more specific with the TODO? what can of update are we referring to here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. Will update the comment!
I meant to refer Bisq2 for the data model structure of Offers and replicate the same here
...ain/src/commonMain/kotlin/network/bisq/mobile/domain/data/repository/CurrenciesRepository.kt
Show resolved
Hide resolved
//DynamicImage("drawable/${currency.flagImage}", contentDescription = null) | ||
println(currency.flagImage) | ||
DynamicImage("drawable/${currency.flagImage}", contentDescription = null) | ||
// AsyncImage( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove dead code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Will make sure this never happens again!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha no big deal but whenever we are sure let's keep it clean :)
|
||
@Composable | ||
fun BisqStaticLayout( | ||
innerPadding: PaddingValues = PaddingValues(top = 48.dp, bottom = 12.dp, start = 12.dp, end = 12.dp), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if its related to this code, but there is a ui bug for "small phones" like pixel 6a where the top title bar overlaps part of the screen you are looking at . Also the bar is not stretching to cover all the width of the screen as it should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I am not happy with this layout components. Have a few internal TODO items.
And yes, I need to test in small screens as well.
Shall I create a separate issue for the layout components/small screen testing and track this issue over there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nostrbuddha yes please - let's create a separate issue so we don't loose track of this and eventually tackle it 💪
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created one @ #79
Pls assign this to me
import network.bisq.mobile.presentation.ui.theme.BisqTheme | ||
|
||
@Composable | ||
fun BisqDialog( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the "Yes, please" is double lining on a pixel 6a. also buttons shapes are not the same size and not aligned (not good for UX)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh okay. I ll create pixel 6a emulator and start testing in it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just happen to have that testing device, but the comment is more of the UI rules applying to that component - decision buttons in general is good to have them aligned and same size to communicate "hey you have to choose from this 2 options" kinda thing :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Will cover this in #79 as well
private fun refresh() { | ||
CoroutineScope(BackgroundDispatcher).launch { | ||
try { | ||
delay(1000) // TODO: To simulate loading. Yet to be handled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good simulation
Might be a good candidate to incorporate a subtle spinner with bisq colors in the middle when we are waiting for I/O response? The idea is that the view depends on a "showLoading" presenter flag that gets turned on before the delay and turned off after. This implementation is important to get right as it will be copied every time we need to wait for I/O - please let me know if you have questions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The markets (currencies called here) are static and created on node at startup and at client we request it but we can persist (or even hard code) it as its never changing.
An open question is thought if we want to show all markets (about 150) or just show the main currencies or those where there are offers, and use the search to allow the user to add more markets (once selected from search it stays in the list). But we can delegate that for later fine tuning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General rule in mobile is don't show anything that the user cannot interact with. If there are no offers it should be hidden, but as you said let's leave this for fine tuning! ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wrong its not 150 markets as we filter for those where we have price, i guess about 30- 40 then... added the filter in my new branch. But still agree we might find a better UX to not show empty markets in a fine tune phase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to leave the loading topic for later. For the markets / currency list I doubt it will be needed (at node its instant, at client we can hard code data as its static data).
Of other screens like offer list, the list gets automatically updated with data, so data stream in. That is also the case in Desktop where at first start it takes a bit until the offers arrive and then fill up the list as they arrive.
But I think different user cases will have diff. context here, which will be easier to analyze once the core functionality is implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there is filter option
I would keep that also for later, it at all (IMO we should try to keep mobile to the most minimal feature set as possible).
I will hardcode all 150+ currnecies that are shown in Bisq2 desktop app.
No need. I have it already connected with real data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nostrbuddha your comment on the scenarios can go straight into the description of a new "Loading Spinners" UI issue ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created at #80
if (openDialog.value) { | ||
BisqDialog { | ||
ConfirmationDialog( | ||
message = "Do you want to take this trade?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we dropping the dependency on the translator or we forgot to add it here?
I'm ok if we hardcode in english for the MVP just want to make sure is a conscious decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the dialogue? In Bisq Easy we dont have it but open the take offer screens (select the available options or get review screen if nothing to select). Though we have plenty of warnings with the reputation based amount limits. That will be painful to replicate ;-(.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great question. I think we should just go to the trade details and the user can decide if they want to take it there?
For now we can just log something on click to indicate the todo
good that he developed a dialog though, I'm sure it will be handy somewhere :) ("Confirm Trade paid? Y/N e.g.")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we dropping the dependency on the translator or we forgot to add it here?
I'm ok if we hardcode in english for the MVP just want to make sure is a conscious decision.
My bad!! Missed it. I will add the translation strings everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Will remove the Dialog from here
|
You can leave that to do after the domain integration as it will likely be different than. I have already a filtered and sorted list and it will be easy to add that predicate. |
@rodvar Made some updates now. Mostly minor:
Others:
|
4f48ba6
to
6ef5893
Compare
excellenty buddha, I'll review and try to get this merge as is. Please create those issues so we don't look this track (or let me know if you want me to create them for you). Cheers! |
- Dialog component - Exchange screen improvements - Offerbook UI - Basic
…and OfferListScreen
…issed staging the files)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool buddha, just gonna fix the comment I've added now and merge it.
We need to create some GH issues to not loose track of the things we have decided to work on later in the context of this PR.
I'll add one more here:
- on iOS: standard left-to-right swipe is not going backwards on the view stack (in android back swipe which is the opposite direction works fine)
I'll let you decide if you prefer to create the issues yourself, happy to help you if you want to just keep the coding momentum - just please let me know 🙏
|
||
val myTrades: List<BisqOffer> = presenter.myTrades.collectAsState().value | ||
|
||
LaunchedEffect(Unit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid LaunchedEffect in favour of our new composable RememberPresenterLifecycle
-> I'll update this PR so we can merge it now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to creating custom hooks in React - love it!
Thanks for showing this approach. 😊
presenter.onViewAttached() | ||
} | ||
|
||
if (myTrades.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good reactive ui programming
…cle which handle both attach and unattach
MyTrades UI (3rd tab) with Presenter, model, repository and mock data
Market screen: CurrencyListing screen with Presenter, model, repository and mock data
Market screen: OfferListing screen
These are basic UI and miss functionality like search, filters, switch between buy / sell. But I guess it's good enough to pull real data from bisq libs and populate in view for testing.