Skip to content

Commit 642ce41

Browse files
ebroderickcoderbrowsquare-tombstudio
authored
fix(mobile): show shared chats under Solo (#9348)
## Summary Mobile puts agent-created and shared Solo chats under Team because it checks who created the chat. Show unarchived Solo chats the viewer belongs to under Solo and exclude them from Team. Preserve membership checks, guest read-only access, legacy chats, and owner-only composing. This changes mobile classification; it needs no relay changes or data migration. **Desktop:** <img width="557" height="695" alt="Screenshot 2026-11-11 at 10 00 07 AM" src="https://github.com/user-attachments/assets/d338fa19-7b6f-4b52-a3a6-061025216ed3" /> **Mobile (missing solo chats created by agents):** <img width="423" height="754" alt="Screenshot 2026-11-12 at 11 19 47 AM" src="https://github.com/user-attachments/assets/18b5da75-38e9-4cca-906c-d0a949cc8cbb" /> ### Code Changes Separate Solo list and unread classification from owner-only composing. Add regression coverage for shared and agent-created chats, Team exclusion, membership/archive filters, legacy chats, and ordinary sending from Solo. ### Related issue Related: #8963 adds mobile access controls and Solo sharing. This PR fixes the separate Solo/Team placement mismatch. No duplicate found in searches for mobile Solo issues and PRs. ### Testing Independent agent review found no blockers. Device testing could not be completed. Android emulators stalled at launch, iOS Simulator sign-in was blocked, and iPhone installation required capabilities unavailable to the Personal Team. Shared Solo placement and sending remain unverified in an authenticated app; before/after screenshots remain pending. Remaining manual checks: - Have an agent create a Solo chat and include the viewer as a member. - Confirm it appears once under Solo and is absent from Team. - Open it, send a message, and confirm owner-only Solo settings are absent. Generated with Codex --------- Signed-off-by: Evan Broderick <[email protected]> Signed-off-by: Tom Brow <[email protected]> Co-authored-by: coder <e509b66797ba43fd355dc12801a0c1ba376b06924147c65abdafa7ababcf8e2e@buzz.block.builderlab.xyz> Co-authored-by: Tom Brow <[email protected]> Co-authored-by: Tom Brow <[email protected]> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
1 parent 8436d22 commit 642ce41

10 files changed

Lines changed: 361 additions & 188 deletions

File tree

‎mobile/lib/features/channels/channel.dart‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ class Channel {
122122
/// Solo presentation is carried by NIP-CL metadata, not project filing.
123123
bool get isSolo => isStream && isPrivate && labels.contains('buzz.solo');
124124

125-
/// Keep old mobile-created chats visible while older clients migrate.
125+
/// Solo inventory placement, including old mobile-created chats. Callers
126+
/// still enforce membership and archive visibility.
127+
bool isSoloChat(Iterable<String> legacyChannels) =>
128+
isSolo || legacyChannels.contains(id);
129+
130+
/// The owner's Solo composer, with compatibility for old mobile chats.
126131
bool isPersonalChat(String? viewer, Iterable<String> legacyChannels) => isSolo
127132
? viewer != null && createdBy == viewer
128133
: legacyChannels.contains(id);

‎mobile/lib/features/channels/channel_detail_page/placement_route.dart‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ class ChannelDetailPage extends ConsumerWidget {
3232
final details = ref.watch(channelDetailsProvider(channel.id)).value;
3333
final current = details == null ? channel : channel.mergeDetails(details);
3434
final placed =
35-
current.isPersonalChat(ref.watch(myPubkeyProvider), const []) ||
35+
current.isPersonalChat(
36+
ref.watch(myPubkeyProvider),
37+
groups?.channels ?? const [],
38+
) ||
3639
personalChat ||
37-
placement == ChannelRoutePlacement.solo ||
38-
(groups?.channels.contains(channel.id) ?? false);
40+
placement == ChannelRoutePlacement.solo;
3941
final lookup = ref.watch(meSearchPlacementProvider(channel.id));
4042
if (!placed &&
4143
placement != ChannelRoutePlacement.ordinary &&

‎mobile/lib/features/channels/channels_page.dart‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,10 @@ class ChannelsPage extends HookConsumerWidget {
302302
if (channelsAsync.asData?.value case final data?) {
303303
cachedChannels.value = data;
304304
}
305-
final soloViewer = ref.watch(myPubkeyProvider);
306305
final personalIds =
307306
ref.watch(meGroupsProvider).asData?.value.channels ?? const <String>[];
308307
final channels = cachedChannels.value
309-
?.where((channel) => !channel.isPersonalChat(soloViewer, personalIds))
308+
?.where((channel) => !channel.isSoloChat(personalIds))
310309
.toList();
311310
Future<void> openChannel(Channel channel) async {
312311
if (!context.mounted) return;

0 commit comments

Comments
 (0)