Integrate pinned messages bar/panel

This commit is contained in:
Jamie
2025-12-15 10:14:20 -08:00
committed by GitHub
parent 8edbe6ac78
commit acc9fd604f
26 changed files with 768 additions and 338 deletions

View File

@@ -69,12 +69,14 @@ import type {
PinnedMessage,
PinnedMessageId,
PinnedMessageParams,
PinnedMessageRenderData,
} from '../types/PinnedMessage.std.js';
import type { AppendPinnedMessageResult } from './server/pinnedMessages.std.js';
import type {
RemoteMegaphoneId,
RemoteMegaphoneType,
} from '../types/Megaphone.std.js';
import { QueryFragment, sqlJoin } from './util.std.js';
export type ReadableDB = Database & { __readable_db: never };
export type WritableDB = ReadableDB & { __writable_db: never };
@@ -191,6 +193,12 @@ export const MESSAGE_COLUMNS = [
...MESSAGE_NON_PRIMARY_KEY_COLUMNS,
] as const;
export const MESSAGE_COLUMNS_FRAGMENTS = MESSAGE_COLUMNS.map(
column => new QueryFragment(column, [])
);
export const MESSAGE_COLUMNS_SELECT = sqlJoin(MESSAGE_COLUMNS_FRAGMENTS);
export type MessageTypeUnhydrated = {
json: string;
@@ -980,7 +988,7 @@ type ReadableInterface = {
getPinnedMessagesForConversation: (
conversationId: string
) => ReadonlyArray<PinnedMessage>;
) => ReadonlyArray<PinnedMessageRenderData>;
getNextExpiringPinnedMessageAcrossConversations: () => PinnedMessage | null;
getMessagesNeedingUpgrade: (