// What a list or a page says while its first read is still out (292 row 5,// 290 walk: Storage stood blank for 20 s and Import's rows never came, with no// word either way). A local read lands within a frame or two and draws// nothing here; one still out past `StillReadingKnobs.after` says what this// device is doing with the database now — its own `copy` row in copy.json's// words, the line Me draws ("Catching up", "3 changes waiting to send · This// device · synced 2 min ago"). Every word is read.sync_state's, through the// definition: no sentence is composed here, and a wait names the event the// core names, never the time of this read.importCottonKitimportSwiftUIstructStillReading: View { @Environment(\.cottonCore) privatevar core @Environment(\.theme) privatevar theme @Environment(DatabaseScene.self) privatevar scene: DatabaseScene? @State privatevar line: (state: String?, when: String?)?var body: someView { VStack(alignment: .leading, spacing: 2) {iflet state = line?.state {Text(state) .font(theme.type.body(StillReadingKnobs.size)) .foregroundStyle(theme.colors.inkSecondary.color) }iflet when = line?.when {Text(when) .font(theme.type.body(StillReadingKnobs.size)) .foregroundStyle(theme.colors.inkSecondary.color) } } .frame(maxWidth: .infinity, alignment: .leading) .accessibilityElement(children: .combine) .accessibilityIdentifier("still-reading") .task(id: scene?.shownId) {try? awaitTask.sleep(for: .seconds(StillReadingKnobs.after))while !Task.isCancelled {iflet core, let own = awaitHomeSync.thisDevice(core, database: scene?.shownId), !Task.isCancelled { line = own }try? awaitTask.sleep(for: .seconds(StillReadingKnobs.every)) } } }}enumStillReadingKnobs {/// Seconds a read may be out before the line is drawn: a local read/// answers long before.staticlet after: Double = 2/// Seconds between reads of the device's state while the line stands.staticlet every: Double = 5staticlet size: CGFloat = 15}