WIP: Support for pinned messages #49

Draft
istalri wants to merge 9 commits from istalri/nexus:support_pinned_messages into main
Showing only changes of commit 92f53c9aca - Show all commits

use EventRenderer card for pins

Henry Hiles 2026-07-06 20:39:48 -04:00
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -52,43 +52,23 @@ class PinnedEventsDrawer extends HookConsumerWidget {
), ),
), ),
Henry-Hiles marked this conversation as resolved Outdated

I would say instead of this, a SuperSliverView should be used, like we do in the main chat view, and instead of an extra card, just wrap EventRenderer with an InkWell or something. And then, you don't need to set textOnly on EventRenderer.

I would say instead of this, a `SuperSliverView` should be used, like we do in the main chat view, and instead of an extra card, just wrap `EventRenderer` with an `InkWell` or something. And then, you don't need to set `textOnly` on `EventRenderer`.

Okay, I take it back about SuperSliverView, the performance of ListView seems acceptable here.

Okay, I take it back about `SuperSliverView`, the performance of `ListView` seems acceptable here.

I've done my other suggestion with not using textOnly.

I've done my other suggestion with not using `textOnly`.
AsyncData(:final value) => ListView.builder( AsyncData(:final value) => ListView.builder(
padding: .symmetric(vertical: 18), padding: .symmetric(horizontal: 8),
itemCount: value.length, itemCount: value.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final event = value[index]; final event = value[index];
return Card( return InkWell(
margin: .only(bottom: 8),
child: InkWell(
borderRadius: .circular(12), borderRadius: .circular(12),
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
// TODO: // Close drawer, then scroll to the message // TODO: // Close drawer, then scroll to the message
}, },
child: Padding(
padding: .all(12),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.push_pin,
size: 16,
color: theme.colorScheme.primary,
),
SizedBox(width: 8),
Expanded(
child: EventRenderer( child: EventRenderer(
event, event,
textOnly: true,
maxLines: 2, maxLines: 2,
isGrouped: false, isGrouped: false,
getEventOptions: getEventOptions, getEventOptions: getEventOptions,
), ),
),
],
),
),
),
); );
}, },
), ),