This includes temporary AI-generated frontend scaffolding, none of this will be used in production. It was just used during development for the backend.
71 lines
1.7 KiB
Plaintext
71 lines
1.7 KiB
Plaintext
/// TEMPORARY AI GENERATED FRONTEND \\\
|
|
/// NOT TO BE USED IN PRODUCTION \\\
|
|
|
|
// Data shapes shared between Rust and Slint. Rust fills models of these; the UI
|
|
// only renders them. Keep them flat and dumb.
|
|
|
|
export enum Screen { loading, login, main }
|
|
export enum ChannelKind { text, voice, category }
|
|
export enum MessageKind { message, date-divider, notice, start-of-room }
|
|
|
|
// A Discord "server" == a top-level Matrix Space.
|
|
export struct ServerItem {
|
|
id: string,
|
|
name: string,
|
|
initial: string,
|
|
color: color,
|
|
unread: bool,
|
|
mentions: int,
|
|
}
|
|
|
|
// A Discord "channel" == a Matrix room. A "category" == a sub-space.
|
|
// In Home mode the same struct carries DMs (is-dm = true).
|
|
export struct ChannelItem {
|
|
id: string,
|
|
name: string,
|
|
topic: string,
|
|
kind: ChannelKind,
|
|
unread: bool,
|
|
mentions: int,
|
|
joined: bool,
|
|
is-dm: bool,
|
|
initial: string,
|
|
color: color,
|
|
}
|
|
|
|
export struct ReactionItem {
|
|
key: string,
|
|
count: int,
|
|
mine: bool,
|
|
}
|
|
|
|
// One row of the message list. Date dividers, notices and the "start of room"
|
|
// banner are rows too, so the list is a single flat model.
|
|
export struct MessageItem {
|
|
id: string,
|
|
kind: MessageKind,
|
|
sender: string,
|
|
initial: string,
|
|
color: color,
|
|
body: string,
|
|
time: string,
|
|
short-time: string,
|
|
show-header: bool,
|
|
edited: bool,
|
|
own: bool,
|
|
pending: bool,
|
|
has-reply: bool,
|
|
reply-sender: string,
|
|
reply-body: string,
|
|
reactions: [ReactionItem],
|
|
}
|
|
|
|
// Member list rows. Header rows ("ADMINS — 2") are rows too.
|
|
export struct MemberItem {
|
|
id: string,
|
|
name: string,
|
|
initial: string,
|
|
color: color,
|
|
is-header: bool,
|
|
}
|