Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions backend/src/baserow/contrib/builder/application_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def serialize_for_regression_testing(self, builder: Builder) -> dict:
regressions across template changes.

Children are grouped by slot (place_in_container) and slots are ordered by
the minimum ``order`` value among their members, so the output is stable
the minimum element ``id`` among their members, so the output is stable
regardless of cross-slot insertion history.

:param builder: The builder application instance to serialize.
Expand All @@ -613,12 +613,13 @@ def build_tree(parent_id):
by_slot[el.place_in_container or ""].append(el)
ordered = []
for slot in sorted(
by_slot, key=lambda s: min(e.order for e in by_slot[s])
by_slot, key=lambda s: min(e.id for e in by_slot[s])
):
ordered.extend(sorted(by_slot[slot], key=lambda e: (e.order, e.id)))
return [
{
"type": element.get_type().type,
"place_in_container": element.place_in_container or "",
"children": build_tree(element.id),
}
for element in ordered
Expand Down
Loading
Loading