eleven / ocho Public

Clone
git clone https://amadan.net/eleven/ocho

Plain git — no account needed to clone.

Download

Download this file

1import SwiftUI
2
3// 🤖 The feed's inline status line — the transcript's twin of the reply-thread
4// view's note (ReplyThreadView's `note`), and of the web's .chatapp-feed-note.
5// Deliberately NOT a floating banner: mounted through .safeAreaInset it takes
6// real layout space above the transcript, so it never curtains a message
7// someone is reading or about to tap (the project's no-toast rule).
8//
9// Today it answers a jump that has to page history back for its target —
10// "looking…", and when the walk can't reach it, why — so a tap on a quote card
11// is never a silent no-op. It renders nothing for a nil/empty note, so callers
12// can bind it straight to an optional.
13public struct FeedNoteBar: View {
14 private let text: String?
15
16 public init(_ text: String?) { self.text = text }
17
18 public var body: some View {
19 if let text, !text.isEmpty {
20 VStack(spacing: 0) {
21 Text(text)
22 .font(.system(size: 12))
23 .foregroundStyle(.secondary)
24 .frame(maxWidth: .infinity, alignment: .leading)
25 .padding(.horizontal, 16)
26 .padding(.vertical, 8)
27 Divider()
28 }
29 // A material, not a flat colour: the note sits over a scrolling
30 // transcript, so it must stay legible whatever slides under it.
31 .background(.bar)
32 .accessibilityElement(children: .combine)
33 .accessibilityLabel(Text(text))
34 }
35 }
36}
37