Files
buzz/mobile/lib/shared/widgets/app_list_card.dart
klopez4212 e802de8777 Give mobile Solo sessions their own settings and actions (#9888)
## Summary

Long-pressing a Solo or channel in the mobile list opens a system menu
anchored to its row (UIKit context menu on iOS and a rounded Android
PopupWindow with leading icons and an anchored scale and fade). Both
menus use Buzz’s Tabler icons. The actions appear in this order when
available: Mark unread (or Mark read), Rename, Move to section (Change
workspace for personal Solos), Archive (or Unarchive). Tapping the
conversation title opens full settings.

Solo settings include Agent, Rename, workspace, members, and
role-specific management actions. Channel settings put Members below the
quick actions, include Huddle, and offer Leave to eligible members,
including co-owners. A sole owner sees Delete channel. DMs retain the
Huddle header shortcut.

## Snapshots

The iOS simulator shows a sample Solo row. The Android screenshot is
from a physical Pixel.

| UIKit context menu on iOS 26.5 | Android system popup on Pixel 10 |
| --- | --- |
| ![Simulator interaction using sample
rows](https://github.com/user-attachments/assets/dddb43e1-4d2b-4737-a3a4-0dff58ed9e63)
| ![Pixel popup cropped to its four
actions](https://github.com/user-attachments/assets/80008353-f717-41aa-a45e-2cedebafa653)
|

Flutter-rendered details previews with sample data. The previous
ellipsis opened a separate settings sheet. The updated Solo details page
includes those controls.

| Previous ellipsis sheet | Updated settings | Updated members and
management |
| --- | --- | --- |
| ![Previous Agent and Workspace
sheet](https://github.com/user-attachments/assets/75c40f2a-0093-4ebc-811e-fe31ea7acc30)
| ![Solo quick actions, agent and
workspace](https://github.com/user-attachments/assets/00a320ac-b106-4a63-9ef3-babddb98ded1)
| ![Solo roster and owner
actions](https://github.com/user-attachments/assets/3c394e74-6ad3-480d-9666-22ecabc98cb2)
|

Long-pressing a message puts Mark unread first in its quick actions.

![Message quick actions with Mark unread
first](https://github.com/user-attachments/assets/4819ad0c-473b-4f2a-b93a-e2cfb66f2e76)

## Testing

The list journey tests exercise the popover from the channel list and
Solo list, shared Solo filing, read-state changes and dismissal. The
title settings tests cover editing, roster, and lifecycle actions.

## Related issue

No matching issue found.

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-11-23 20:19:55 +00:00

112 lines
3.8 KiB
Dart

import 'package:flutter/material.dart';
import '../theme/theme.dart';
import 'app_list_inset.dart';
/// A group of list rows in a rounded container, with an optional [label] above
/// it. Rows inside are hairline-separated and inset to the card rather than the
/// page, via [AppListInset].
class AppListCard extends StatelessWidget {
const AppListCard({
super.key,
this.label,
this.dividerIndent,
this.iconColumnWidth,
this.clipBehavior = Clip.antiAlias,
this.verticalPadding = Grid.xxs,
this.horizontalPadding = Grid.gutter,
required this.children,
});
/// Rendered above the card in sentence case, as written — no uppercasing.
final String? label;
final Clip clipBehavior;
/// Separator inset from the card edge. Defaults to the standard row label
/// column, clearing a leading icon. Icon-free cards can pass [_inset] so
/// separators align with their row content on both sides.
final double? dividerIndent;
final double? iconColumnWidth;
/// Outer padding above and below this section.
///
/// Adjacent cards contribute this padding from both sides. For example,
/// passing [Grid.twelve] creates a 24dp rhythm between grouped surfaces.
final double verticalPadding;
/// Outer horizontal inset; use zero inside an already padded sheet.
final double horizontalPadding;
final List<Widget> children;
static const _inset = Grid.xs;
@override
Widget build(BuildContext context) {
final separated = <Widget>[];
for (var index = 0; index < children.length; index++) {
if (index > 0) {
separated.add(
Divider(
height: 1,
thickness: 1,
indent: dividerIndent ?? _inset + (iconColumnWidth ?? 22) + Grid.xs,
endIndent: _inset,
// The scheme's own border tokens are derived from the page surface,
// which lands them within a few levels of the card fill — invisible.
// Tinting with the text color instead keeps the hairline readable on
// the card in both brightnesses.
color: context.colors.onSurface.withValues(alpha: 0.07),
),
);
}
separated.add(children[index]);
}
return Padding(
padding: EdgeInsets.fromLTRB(
horizontalPadding,
verticalPadding,
horizontalPadding,
verticalPadding,
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (label != null)
Padding(
padding: const EdgeInsets.only(left: Grid.half, bottom: Grid.xxs),
child: Text(
label!,
style: context.textTheme.labelMedium?.copyWith(
color: context.colors.onSurfaceVariant,
fontWeight: FontWeight.w600,
),
),
),
Material(
// The softest step on the elevation ramp — a rung below the home tab
// bar's active pill (primaryContainer, see PR #2810), since a
// full-width card at the pill's contrast reads heavier than the pill
// does. The dividers carry the group structure, so the fill only has
// to separate the card from the page.
color: context.colors.surfaceContainerHighest,
borderRadius: BorderRadius.circular(Radii.container),
// Keeps row ripples inside the rounded corners.
clipBehavior: clipBehavior,
child: AppListInset(
horizontal: _inset,
iconColumnWidth: iconColumnWidth,
child: Column(
mainAxisSize: MainAxisSize.min,
children: separated,
),
),
),
],
),
);
}
}