Hello, Context :
It’s a meetup.com-like app, so user can join groups, and groups can contain users.
It uses only hidden/showed groups with a “states” system. No pages (since it’s recommended on the forum for better performance.
When navigating through the app, each time a page is seen, a state “mode” is toggled, depending on the group, it shows or hides.
For the groups “group page” and “user profile” that both show a group or user datas depending on a new state “data” in addition of the state “mode”.
What I want to do :
I’m struggling with the “back” button. I want to create a button that sends back to the previous layer.
What I’ve tried :
Using only states, so I would create a state “previous_modes”. Each time you go to a new layer, it adds the current state. To go back, simply run through all the previous states.
Issue : The list ignores duplicate, but if a user want to see group page → then see a user → and then see a group again… it does’nt work.
Creating a separate database called “navigation” where new entry is added each time a new layer appears, with fields like the order, the current state, the user associated, the group or user object if it’s a “group page” or a “user profil”.
Then when you click on the back button, it does a “search for” to delete the last entry, and switch the states.
The entire utilities plugin costs $16 only one-time. Easylist is just one of the things in this plugin.
If you want to try, you can buy via $4/mo and then unsubscribe / resubscribe if happy. Bubble will only charge you pro-rata for the number of days used.
Undo is upto 5 times (not an unlimited one). So if you Go to A -> B -> C -> D -> E
then doing first undo at E will go to D, twice to C, thrice to B etc…
For undo you don’t need to remove any element etc. it will simply revert to its previous value.
If you’re asking about normally adding / removing items from lists you can obviously do that like a classic list with no limits.
I’ve seen your documentation, however I don’t get how can I do a nav system. Should I create a state with an easylist type ? Can you give me a hint ?
PS: I don’t see any workflow action to remove an item from the easylist
PS : I try to set a new list to the easylist, when I’m in the inspector it shows me the new elements in the list, however when I try to get the last item in the next step, bubble considers the previous list elements.
Easy list is probably the best way, here is how/why ive done it without a plugin
in order to support multitasking my app has multiple sections that must store their state when hidden (including contextual back button use) and resume their navigation state when they come back. For instance if they switch to a new section,the backbutton will go to the last page of THAT section.
in order to provide a native experience, i restore every navigation state, when the app is reloaded. They always resume right where they left off.
I animate everything (versus show/hide), again, to provide a more native experience to smart phone users.
(using only show/hide actually would make this dramatically easier)
My app has two layers
“Pages” which are groups of “views” that relate to a specific function
“Views” which are sub-pieces of those primary functions.
In my header i have a few states
Numerical Page state so i know which page im on
Numerical View state so i know which view of the above page im on
A visibility toggle for the back button (only shows when needed)
When the back button is clicked, it runs a workflow based on the combination of current page/view to go back to the appropriate place.
There are a limitless number of ways to do this, this has worked very well for my specific needs.
Here’s how I do it:
Forget all states etc. to show / hide groups. Place an easylist element which outputs the list of currently visible codes (each corresponds to a group). On your groups the condition is to show it when the easylist’s list of codes contains its code(s) and hide it otherwise. That’s pretty much it.
To navigate from any view to another all you need is to add / set the easylist codes using element action.
A back button would simply run the element action ‘revert this easylist’
Personally, I’ve found it to be much faster, simpler and flexible than doing it pure-bubble way using states
Oh yeah I have to add that. I recall this was a feature request by someone else too in the forum.
I think what’s happening is that bubble doesn’t wait for the previous action to finish before moving to the next one i.e. its’ treating it as asynchronous. Maybe use the ‘Do when’ easylists’ value is changed condition?