Files
Synapsis/src/lib/types.ts
T
Christomatt 141b99747a feat(posts): Add swarm reply tracking and thread visualization
- Add swarm reply metadata fields (swarmReplyToId, swarmReplyToContent, swarmReplyToAuthor) to posts table for tracking replies to federated posts
- Extend swarmReplyTo schema to include optional content and author information for context preservation
- Build synthetic replyTo objects from swarm reply metadata to unify local and federated reply handling
- Include media in replyTo relations across all post queries for complete reply context
- Add thread container styling with visual line connector between parent and child posts
- Implement thread parent display mode with reduced opacity and hidden actions for context
- Add showThread and isThreadParent props to PostCard for flexible thread rendering
- Enable inline parent post visualization when viewing post details to show conversation context
2026-01-26 13:50:15 +01:00

76 lines
2.0 KiB
TypeScript

export interface User {
id: string;
handle: string;
displayName: string;
avatarUrl?: string | null;
bio?: string | null;
headerUrl?: string | null;
followersCount?: number;
followingCount?: number;
postsCount?: number;
website?: string | null;
createdAt?: string;
movedTo?: string | null;
isRemote?: boolean;
profileUrl?: string | null;
isBot?: boolean;
isSwarm?: boolean; // Whether this user is from a Synapsis swarm node
nodeDomain?: string | null; // Domain of the node this user is from (for swarm users)
botOwner?: {
id: string;
handle: string;
displayName?: string | null;
avatarUrl?: string | null;
} | null;
}
export interface MediaItem {
id: string;
url: string;
altText?: string | null;
mimeType?: string | null;
}
export interface Attachment {
id: string;
url: string;
altText?: string | null;
}
export interface Post {
id: string;
content: string;
createdAt: string;
likesCount: number;
repostsCount: number;
repliesCount: number;
author: User;
media?: MediaItem[];
linkPreviewUrl?: string | null;
linkPreviewTitle?: string | null;
linkPreviewDescription?: string | null;
linkPreviewImage?: string | null;
replyTo?: Post | null;
replyToId?: string | null;
// Swarm reply info (when replying to a post on another node)
swarmReplyToId?: string | null;
swarmReplyToContent?: string | null;
swarmReplyToAuthor?: {
handle: string;
displayName?: string | null;
avatarUrl?: string | null;
nodeDomain?: string | null;
} | null;
isLiked?: boolean;
isReposted?: boolean;
bot?: {
id: string;
name: string;
handle: string;
ownerId: string;
} | null;
nodeDomain?: string | null; // Domain of the node this post came from (for swarm posts)
isSwarm?: boolean; // Whether this is a swarm post from another node
originalPostId?: string; // Original post ID on the source node (for swarm posts)
}