Selecting a container space recurses into sub-spaces like desktop
Sonar / Sonar Quality Checks (push) Has been cancelled
Code Quality Checks / Search for forbidden patterns (push) Has been cancelled
Code Quality Checks / Search for invalid screenshot files (push) Has been cancelled
Code Quality Checks / Search for invalid dependencies (push) Has been cancelled
Code Quality Checks / Konsist tests (push) Has been cancelled
Code Quality Checks / Compose tests (push) Has been cancelled
Code Quality Checks / Android lint check (push) Has been cancelled
Code Quality Checks / Detekt checks (push) Has been cancelled
Code Quality Checks / Ktlint checks (push) Has been cancelled
Code Quality Checks / Doc checks (push) Has been cancelled
Create release App Bundle and APKs / Create App Bundle Enterprise (push) Has been cancelled
Create release App Bundle and APKs / Create APKs (FDroid) (push) Has been cancelled
Test / Runs unit tests (push) Has been cancelled
Code Quality Checks / Project Check Suite (push) Has been cancelled
Code Quality Checks / Check shell scripts (push) Has been cancelled
Code Quality Checks / Run zizmor (push) Has been cancelled
Create release App Bundle and APKs / Create App Bundle (Gplay) (push) Has been cancelled

mautrix-discord nests server/DM spaces inside a top-level Discord space;
filtering on the container's direct children matched no rooms, so the rail
tap looked dead. The selection filter now walks child spaces recursively
(cycle-guarded), matching element-web's SpaceStore behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-30 08:13:53 -07:00
parent c7630b409b
commit 36ba06c9b9
@@ -156,7 +156,6 @@ class RoomListPresenter(
}
}
}
val blapSpaceChildIds = blapSpaceChildren[selectedSpaceId].orEmpty()
// Blap: union of everything owned by any space (real children + SDK descendants),
// persisted so Home is clean right away on cold start. Grows immediately as spaces
// report in; replaced exactly once every space has reported (so rooms removed from
@@ -333,12 +332,29 @@ class RoomListPresenter(
}
}
LaunchedEffect(filtersState.filterSelectionStates, spaceFiltersState.selectedFilter(), blapSpaceChildIds) {
LaunchedEffect(filtersState.filterSelectionStates, spaceFiltersState.selectedFilter(), blapSpaceChildren, spaceFilters) {
val selectedFilters = filtersState.selectedFilters().map { filter -> filter.into() }
// Blap: union the space's real child list into the SDK's descendants — bridge
// spaces whose children are DM portals (mautrix-telegram) otherwise come up empty.
// Expansion is RECURSIVE like desktop's SpaceStore: container spaces (mautrix-discord
// nests server/DM spaces inside a top space) contribute their sub-spaces' rooms too,
// otherwise selecting the container matches no rooms at all.
val selectedSpaceFilter = spaceFiltersState.selectedFilter()?.let { filter ->
RoomListFilter.Identifiers((filter.descendants.toSet() + blapSpaceChildIds).toList())
val descendantsBySpace = spaceFilters.associate { it.spaceRoom.roomId to it.descendants }
val ids = mutableSetOf<RoomId>()
val visited = mutableSetOf<RoomId>()
val queue = ArrayDeque(listOf(filter.spaceRoom.roomId))
while (queue.isNotEmpty()) {
val spaceId = queue.removeFirst()
if (!visited.add(spaceId)) continue
val direct = blapSpaceChildren[spaceId].orEmpty() + descendantsBySpace[spaceId].orEmpty()
for (id in direct) {
ids += id
// Known space → recurse into its children as well.
if (id in blapSpaceChildren || id in descendantsBySpace) queue += id
}
}
RoomListFilter.Identifiers(ids.toList())
}
val allFilters = RoomListFilter.All(selectedFilters + listOfNotNull(selectedSpaceFilter))
roomListDataSource.updateFilter(allFilters)