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

[Suggestion] Back button on transaction view should navigate to previous page #133

Open
avee87 opened this issue Dec 17, 2024 · 3 comments

Comments

@avee87
Copy link
Contributor

avee87 commented Dec 17, 2024

I.e., it should act as a browser back button.

When I'm looking at a list of transactions for a particular account, I want to be able to click on one to edit it and then go back to the list - ideally, keeping the scroll position. I imagine, it also requires caching transaction lists to avoid reloading them on every navigation.

@cioraneanu
Copy link
Owner

cioraneanu commented Dec 17, 2024

Also related with #101.

It is a nice idea but needs testing to see if it can work on all browsers / devices / scenarios.

Some thoughts:

  • changing the behaviour of the toolbar back buttons can be done in useToolbar.js to perform router.go(-1) if there is a history available and current implementation as fallback

  • saving scroll position is ok but deciding if a list should be refetched/untouched on page mount can become messy

  • browser back button will perform an app reload while the toolbar button will not. If possible both should look identical to the user.

@avee87
Copy link
Contributor Author

avee87 commented Dec 17, 2024

Out of curiosity, did you consider using GraphQL to fetch data as opposed to how it’s done today?
IMO that would make code easier to reason about due to colocation of UI and data fetching and we also could utilise caching provided by modern clients to avoid refetching transaction lists on every navigation.

I’m tempted to set up some basic API and see if it makes things easier…

@cioraneanu
Copy link
Owner

Not a fan of GraphQL. Also for this project REST makes more sense since the Pico backend is acting like a proxy towards the Firefly III API which is also REST based.

You can already implement response caches fairly easy inside the dataStore actions or inside the BaseRepository.js with something like useLocalStorage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants