Reversing Repeating Group cells for Chat apps

Hello all

I have been away from Bubble for a bit and am recently catching up. Since the new responsive engine was employed, is there a basic method to reverse repeating group cell orders so that they mimic modern day chat apps or is the manual method described here or the plugin method described here still the only ways to go about it?

1 Like

Yes, and I have found the Reverse RG by @Thimo more reliable.

1 Like

Thanks for the tip ill have a look at it

I am actually confused now. I realize that the way bubble naturally displays repeating groups is how chat apps like whatsapp, telegram and facebook display their chats too which is the newest message showing at the bottom. These plugins reverse it to the top which is not what is standard among the chat apps mentioned. So the only issue I am left with is the scroll bar doesn’t automatically go down once a new message is sent and the user needs to manually scroll down to see the latest message. Is there a remedy to that?

As you said, dont reverse the RG. There is a native ‘scroll to entry of a repeating group” action.
In the dynamic expression, reference the RG’ list of items:last item.
This will automatically scroll to the last item of the RG

1 Like

You saved my life for the second time today

1 Like

Absolute pleasure :slight_smile: keep them coming

Won’t this load all messages in a chat and result in a bigger WU hit for long discussions?

Yes you’re absolutely right, sorry for not mentioning it.
WU consumption would go through the roof with this method.

You would have to find a way to download to the page only the last few messages from a chat instead of downloading the entire discussion.

There are multiple ways to do this but here is a basic implementation:

Before we start, don’t use lists. Lists are downloaded to the page in their entirety if any of their entries are referenced. Might be tempting to create a Discussion datathing, a message datathing, and add a list of messages field to the Discussion. DONT do this :slight_smile:

Instead of that, you could create a discussion datathing with fields for User 1 User 2 & #of messages in the discussion.
The messages datathing would have a Content + Index data.
When the user opens a discussion, populate your repeating group with ‘Do a search for Messages: [Constraint: Index > Selected discussion’s # of messages - X]’
You can choose what the starting value of X is, however you should have a button at the top of your RG which allows the user to load previous messages. This would increase the value of X, so more messages would be loaded. You could also implement a workflow which automatically does this based on user scrolling.

There are other ways of doing this, however this can get you headed in the right direction and save you lots of WU.

Also, while ‘do a search for: items from #’ might look like a good solution, it does not save WU, as the ‘:items from #’ operator is applied after the whole search is returned, so the datathings are downloaded to the page anyways.


This topic was automatically closed after 70 days. New replies are no longer allowed.