Repository Public MIT
1# GlassThinkingIndicator23| | |4|---|---|5| Identifier | `glass-thinking-indicator` |6| Module | `SPGlassAI` |7| Kind | `content-component` — a chip on an opaque surface (symbol tile, text, activity dots), or a symbol and a text alone |8| Platforms | iOS 26, iPadOS 26, macOS 26 |9| Example | `Examples/Gallery/AI/GlassThinkingIndicatorExample.swift` |1011UI 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`.1213## Minimal usage1415```swift16GlassThinkingIndicator(.searching, label: "Searching the documentation")17```1819## Variants2021| Kind | Symbol |22|---|---|23| `.thinking` | `sparkles` |24| `.searching` | `magnifyingglass` |25| `.reading` | `doc.text.magnifyingglass` |26| `.writing` | `pencil.line` |27| `.waiting` | `hourglass` |28| `.custom(systemImage:)` | Any SF Symbol |2930The kind only selects the symbol. The words always come from `label`; without a label the indicator reads "Working".3132| Style | Use |33|---|---|34| `.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. |35| `.plain` | The symbol and the label in secondary text, for a status line or a toolbar. |3637## Parameters3839| Parameter | Type | Default | Meaning |40|---|---|---|---|41| `kind` | `GlassActivityKind` | `.thinking` | Selects the symbol. |42| `label` | `String?` | `nil` → "Working" | What is happening, written by the host. |43| `announcesChanges` | `Bool` | `true` | Posts a low-priority accessibility announcement when the label changes. |44| `style` | `GlassThinkingIndicatorStyle` | `.chip` | `.chip` or `.plain`. |4546## States4748The indicator is either on screen (activity in progress) or not: remove it when the activity ends. With Reduce Motion the symbol is static.4950## Advanced example5152```swift53if let activity = agent.currentActivity { // host type: { kind, label }54 GlassThinkingIndicator(activity.kind, label: activity.label)55 .transition(.opacity)56}57```5859## Accessibility6061- Symbol and text form one element with the "updates frequently" trait; the symbol is decorative.62- A change of label is announced with `AccessibilityNotification.Announcement` at low priority, so it never interrupts speech in progress. Blank and unchanged labels are not announced.63- The pulse is a symbol effect that is disabled with Reduce Motion (real or simulated).6465## Limits6667- 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.68- There is no elapsed time, progress value or step list; use `GlassAgentPanel` or `GlassProgress` for those.69- Announcements were compiled but not heard with VoiceOver during verification; the rule deciding when to announce is unit-tested.70