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
2 changes: 1 addition & 1 deletion mobile/lib/features/channels/channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Channel {
: null,
);

bool get isEphemeral => ttlSeconds != null;
bool get isEphemeral => ttlSeconds != null || ttlDeadline != null;

bool get isStream => channelType == 'stream';
bool get isForum => channelType == 'forum';
Expand Down
70 changes: 60 additions & 10 deletions mobile/lib/features/channels/channel_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import 'channels_provider.dart';
import 'compose_bar.dart';
import 'date_formatters.dart';
import 'day_divider.dart';
import 'dm_channel_labels.dart';
import 'ephemeral_channel_display.dart';
import 'manage_channel_sheet.dart';
import 'members_sheet.dart';
import 'message_actions.dart';
Expand Down Expand Up @@ -159,11 +161,23 @@ class ChannelDetailPage extends HookConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
resolvedChannel.displayLabel(
currentPubkey: currentPubkey,
),
overflow: TextOverflow.ellipsis,
Row(
mainAxisSize: MainAxisSize.min,
children: [
Flexible(
child: Text(
resolveDmChannelDisplayLabel(
resolvedChannel,
currentPubkey: currentPubkey,
),
overflow: TextOverflow.ellipsis,
),
),
if (resolvedChannel.isEphemeral) ...[
const SizedBox(width: Grid.quarter),
_HeaderEphemeralBadge(channel: resolvedChannel),
],
],
),
if (resolvedChannel.isStream)
Text(
Expand Down Expand Up @@ -977,6 +991,28 @@ class _ReadOnlyNotice extends StatelessWidget {
}
}

class _HeaderEphemeralBadge extends StatelessWidget {
final Channel channel;

const _HeaderEphemeralBadge({required this.channel});

@override
Widget build(BuildContext context) {
final display = ephemeralChannelDisplay(channel);
if (display == null) return const SizedBox.shrink();

return Tooltip(
message: display.tooltipLabel,
child: Icon(
LucideIcons.clockFading,
key: const Key('chat-ephemeral-badge'),
size: 16,
color: context.colors.onSurfaceVariant,
),
);
}
}

class _DetailConnectionBanner extends StatelessWidget {
final SessionStatus status;

Expand Down Expand Up @@ -1233,11 +1269,25 @@ class _DmAppBarTitle extends ConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
channel.displayLabel(currentPubkey: currentPubkey),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: context.textTheme.titleSmall,
Row(
mainAxisSize: MainAxisSize.min,
children: [
Flexible(
child: Text(
resolveDmChannelDisplayLabel(
channel,
currentPubkey: currentPubkey,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: context.textTheme.titleSmall,
),
),
if (channel.isEphemeral) ...[
const SizedBox(width: Grid.quarter),
_HeaderEphemeralBadge(channel: channel),
],
],
),
Text(
presenceLabel,
Expand Down
Loading