Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

[FEATURE] Remembering the scroll position for Accounts and Categories screens #2938

Closed
3 tasks done
nvllz opened this issue Feb 9, 2024 · 11 comments · Fixed by #2977
Closed
3 tasks done

[FEATURE] Remembering the scroll position for Accounts and Categories screens #2938

nvllz opened this issue Feb 9, 2024 · 11 comments · Fixed by #2977
Assignees
Labels
approved Approved by the Ivy Wallet team. Ready for dev good first issue Good for newcomers keep Keep it from automatically getting closed by Stale P1 Important but can wait user request Feature/improvement requested by an user

Comments

@nvllz
Copy link
Contributor

nvllz commented Feb 9, 2024

Please confirm the following:

  • I've checked the current issues for duplicate issues.
  • I've requested a single (only one) feature/change in this issue. It complies with the One Request Per GitHub Issue (ORPGI) rule.
  • My issue is well-defined and describes how it should be implemented from UI/UX perspective.

What do you want to be added or improved?

I want the Accounts and Categories screens to retain the scroll position when I go back from the Details dialog.

Now both screens don't preserve the list position (when going back the list is scrolled to the top):

a7a2fece-5637-422a-95f6-f89135719abc.mp4

Why do you need it?

It would be much more intuitive to have these menus work this way. Especially if one's got a long list of items.

How do you imagine it?

I want it to work the same way as in the dashboard screen, so when I go back from the transaction details dialog, the list position is preserved.

1c2e17e5-1a82-4f2d-8744-f241529d3501.mp4
@nvllz nvllz added the user request Feature/improvement requested by an user label Feb 9, 2024
@ivywallet
Copy link
Collaborator

Thank you @nvllz for raising Issue #2938! 🚀
What's next? Read our Contribution Guidelines 📚.

Tagging @ILIYANGERMANOV for review & approval 👀

@ILIYANGERMANOV ILIYANGERMANOV added approved Approved by the Ivy Wallet team. Ready for dev P1 Important but can wait keep Keep it from automatically getting closed by Stale good first issue Good for newcomers labels Feb 9, 2024
@anuraganandwork
Copy link

I'm on it

@ivywallet
Copy link
Collaborator

Thank you for your interest @anuraganandwork! 🎉
Issue #2938 is assigned to you. You can work on it! ✅

If you don't want to work on it now, please un-assign yourself so other contributors can take it.

Also, make sure to read our Contribution Guidelines.

@madhavbhavsar
Copy link
Contributor

madhavbhavsar commented Feb 13, 2024

Hey, need help... @anuraganandwork . I found this but its not working

    val listState = rememberScrollPositionListState(
        key = "home_lazy_column",
        initialFirstVisibleItemIndex = ivyContext.transactionsListState
            ?.firstVisibleItemIndex ?: 0,
        initialFirstVisibleItemScrollOffset = ivyContext.transactionsListState
            ?.firstVisibleItemScrollOffset ?: 0
    )

I tried to change the key, and context.liststate, and then setted it to lazycolumn's state, but its not working.

@madhavbhavsar
Copy link
Contributor

Hey @ILIYANGERMANOV , I solved the above issue like this.

  var listState = rememberLazyListState()
    if (!state.accountsData.isEmpty()){
        listState = rememberScrollPositionListState(
            key = "accounts_lazy_column",
            initialFirstVisibleItemIndex = ivyContext.accountsListState?.firstVisibleItemIndex ?: 0,
            initialFirstVisibleItemScrollOffset = ivyContext.accountsListState?.firstVisibleItemScrollOffset ?: 0
        )
    }

  LazyColumn(
        modifier = Modifier
            .fillMaxSize(),
            state = listState,
    ) { }

I'm not able to find another way.

@ILIYANGERMANOV
Copy link
Collaborator

Hey @ILIYANGERMANOV , I solved the above issue like this.

  var listState = rememberLazyListState()
    if (!state.accountsData.isEmpty()){
        listState = rememberScrollPositionListState(
            key = "accounts_lazy_column",
            initialFirstVisibleItemIndex = ivyContext.accountsListState?.firstVisibleItemIndex ?: 0,
            initialFirstVisibleItemScrollOffset = ivyContext.accountsListState?.firstVisibleItemScrollOffset ?: 0
        )
    }

  LazyColumn(
        modifier = Modifier
            .fillMaxSize(),
            state = listState,
    ) { }

I'm not able to find another way.

Hey @madhavbhavsar that should be fine. Submit a PR, and I'll review you it

@madhavbhavsar
Copy link
Contributor

I'm on it

@ivywallet
Copy link
Collaborator

⚠️ Hey @madhavbhavsar, this issue is already taken by @anuraganandwork.
Do not start working on it!
Please, pick another one.

Also, make sure to read our Contribution Guidelines.

@ILIYANGERMANOV
Copy link
Collaborator

@madhavbhavsar say the magic words again

@madhavbhavsar
Copy link
Contributor

I'm on it

@ivywallet
Copy link
Collaborator

Thank you for your interest @madhavbhavsar! 🎉
Issue #2938 is assigned to you. You can work on it! ✅

If you don't want to work on it now, please un-assign yourself so other contributors can take it.

Also, make sure to read our Contribution Guidelines.

@madhavbhavsar madhavbhavsar mentioned this issue Feb 20, 2024
5 tasks
madhavbhavsar added a commit to madhavbhavsar/ivy-wallet that referenced this issue Feb 20, 2024
@madhavbhavsar madhavbhavsar mentioned this issue Feb 20, 2024
5 tasks
ILIYANGERMANOV pushed a commit that referenced this issue Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Approved by the Ivy Wallet team. Ready for dev good first issue Good for newcomers keep Keep it from automatically getting closed by Stale P1 Important but can wait user request Feature/improvement requested by an user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants