7open type Fabulous.Avalonia.View
19 | Chat of pubkey: string * compose: string
20 | AddContact of pubkey: string
22 | EditProfile of displayName: string * bio: string * photo: byte[] option
32 | Online of token: string
36 | Identified of identity: Identity * conn: ConnStatus
38 [<RequireQualifiedAccess>]
40 | TextMessage of id: string * body: string
41 | DeliveryAck of ackIds: string list
42 | ProfileMessage of profile: Profile
46 Timestamp: DateTimeOffset
55 Contacts: Map<string, Contact>
57 Messages: Map<string, ChatMessage list>
60 Profile: Profile option
63 KeyboardHeight: float }
70 | SetServerUrl of string
77 | PollResult of events: IncomingEvent list * status: string * cursor: int64
80 | StateLoaded of Identity option * Data option * Profile option
82 | PhotoPicked of byte[] option
85 | FlushResult of sent: bool
88 | KeyboardHeightChanged of float
93 | CmdConnect of url: string * identity: Identity
94 | CmdEnqueue of recipientHex: string * envelope: Envelope
95 | CmdFlushOutbox of session: Session
96 | CmdPoll of session: Session * cursor: int64 * retries: int
97 | CmdCopyToClipboard of string
99 | CmdSaveIdentity of Identity
100 | CmdSaveData of Data
102 | CmdSaveProfile of Profile
103 | CmdSubscribeKeyboard
105 // ── Shared Helpers ──
107 let hexToOb (hex: string) = Crypto.fromHex hex |> Phonemic.toOb
109 let truncKey (hex: string) =
111 let parts = ob.Split('-')
113 if parts.Length <= 4 then
116 $"{parts.[0]}-{parts.[1]}..{parts.[parts.Length - 2]}-{parts.[parts.Length - 1]}"
118 let contactName (contacts: Map<string, Contact>) (pk: string) =
119 match Map.tryFind pk contacts with
120 | Some c when c.Nickname <> "" -> c.Nickname
121 | Some c when c.DisplayName <> "" -> c.DisplayName
124 let messagesFor (pk: string) (messages: Map<string, ChatMessage list>) =
125 messages |> Map.tryFind pk |> Option.defaultValue []
127 let connStatusLabel =
130 | Identified(_, Offline) -> "OFFLINE"
131 | Identified(_, Connecting) -> "CONNECTING"
132 | Identified(_, Online _) -> "ONLINE"
136 let viewErrorBanner (error: string option) =
140 TextBlock(err).foreground(SolidColorBrush(Colors.Red)).fontSize (12.)
141 Button("Dismiss", DismissError)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list