GlassThinkingIndicator
Explicit activity indicator with a reduced-motion form; it never shows presumed reasoning.
- Content
- iOS 26 · iPadOS 26 · macOS 26
- Version 1.1.0
glass-thinking-indicator
Content on an opaque, readable surface. Glass is kept for controls.
CaptureInstallation
spglass add glass-thinking-indicatorCopies the sources and their dependencies into your project. Set up the CLI.
.package(url: "https://git.spboucher.ai/sp-glasskit.git", from: "1.1.0")
import SPGlassKit| Identifier | glass-thinking-indicator |
|---|---|
| Module | SPGlassAI |
| Kind | content-component — a chip on an opaque surface (symbol tile, text, activity dots), or a symbol and a text alone |
| Platforms | iOS 26, iPadOS 26, macOS 26 |
| Example | Examples/Gallery/AI/GlassThinkingIndicatorExample.swift |
UI only. The indicator states an activity in the host's words. It never displays reasoning, intermediate thoughts or any text the host did not pass as label.
Minimal usage
GlassThinkingIndicator(.searching, label: "Searching the documentation")Variants
| Kind | Symbol |
|---|---|
.thinking | sparkles |
.searching | magnifyingglass |
.reading | doc.text.magnifyingglass |
.writing | pencil.line |
.waiting | hourglass |
.custom(systemImage:) | Any SF Symbol |
The kind only selects the symbol. The words always come from label; without a label the indicator reads "Working".
| Style | Use |
|---|---|
.chip (default) | A capsule on an opaque themed surface: tinted symbol tile, the label, three activity dots. Stands in a conversation for the reply that is coming. |
.plain | The symbol and the label in secondary text, for a status line or a toolbar. |
Parameters
| Parameter | Type | Default | Meaning |
|---|---|---|---|
kind | GlassActivityKind | .thinking | Selects the symbol. |
label | String? | nil → "Working" | What is happening, written by the host. |
announcesChanges | Bool | true | Posts a low-priority accessibility announcement when the label changes. |
style | GlassThinkingIndicatorStyle | .chip | .chip or .plain. |
States
The indicator is either on screen (activity in progress) or not: remove it when the activity ends. With Reduce Motion the symbol is static.
Advanced example
if let activity = agent.currentActivity { // host type: { kind, label }
GlassThinkingIndicator(activity.kind, label: activity.label)
.transition(.opacity)
}Accessibility
- Symbol and text form one element with the "updates frequently" trait; the symbol is decorative.
- A change of label is announced with
AccessibilityNotification.Announcementat low priority, so it never interrupts speech in progress. Blank and unchanged labels are not announced. - The pulse is a symbol effect that is disabled with Reduce Motion (real or simulated).
Limits
- The symbol pulses for as long as the view is on screen: showing it while nothing happens would be an idle animation. Tie its presence to real activity.
- There is no elapsed time, progress value or step list; use
GlassAgentPanelorGlassProgressfor those. - Announcements were compiled but not heard with VoiceOver during verification; the rule deciding when to announce is unit-tested.
Example
import SwiftUI
import SPGlassKit
public struct GlassThinkingIndicatorExample: GlassExample {
public static let componentID = "glass-thinking-indicator"
/// Fictitious activity labels, written by the host — never text coming from a model.
private let stages: [(kind: GlassActivityKind, label: String)] = [
(.thinking, "Preparing the sample answer"),
(.searching, "Searching the sample library"),
(.reading, "Reading 3 sample documents"),
(.writing, "Writing the summary"),
(.waiting, "Waiting for your confirmation"),
]
@State private var stage = 0
public init() {}
public var body: some View {
VStack(alignment: .leading, spacing: 16) {
Text("Sample data · simulated activity")
.font(.caption)
.foregroundStyle(.secondary)
GlassThinkingIndicator(stages[stage].kind, label: stages[stage].label)
GlassButton("Next activity", systemImage: "forward.end") {
stage = (stage + 1) % stages.count
}
Divider()
ForEach(stages.indices, id: \.self) { index in
GlassThinkingIndicator(stages[index].kind, label: stages[index].label, announcesChanges: false)
}
GlassThinkingIndicator(.custom(systemImage: "arrow.down.circle"), label: "Downloading the sample model, which has a long label that wraps on narrow screens", announcesChanges: false)
GlassThinkingIndicator(announcesChanges: false)
GlassThinkingIndicator(.waiting, label: "Plain style, for a status line", announcesChanges: false, style: .plain)
Divider()
Text("Reduce Motion (simulated): static symbol")
.font(.caption)
GlassThinkingIndicator(.searching, label: "Searching the sample library", announcesChanges: false)
.glassSimulatedAccessibility(reduceMotion: true)
}
.padding()
}
}
#Preview("GlassThinkingIndicator") { GlassThinkingIndicatorExample().glassTheme(.crystal) }
Registry entry
| Identifier | glass-thinking-indicator |
|---|---|
| Version | 1.1.0 |
| Depends on | glass-foundation |
| Frameworks | SwiftUI |
| Public symbols | GlassActivityKind, GlassActivityAnnouncement, GlassThinkingIndicatorStyle, GlassThinkingIndicator |
| Licence | MIT |
| Manifest | manifest.json |
Files
AI/AI/GlassThinkingIndicator.swift7697 bytes · sha256 30f79650bfba…