Skip to content

Commit 2464b28

Browse files
committed
docs(demo): add inline input row styling spec
1 parent 1f9b89c commit 2464b28

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

demo/build.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Plain class (not tied to UI framework) injected into the state management layer.
5353
- **Location**: setLocationShared(bool), requestLocationPermission()
5454
- **Privacy consent**: setConsentRequired(bool), setConsentGiven(bool)
5555
- **User IDs**: getExternalId() -> nullable, getOnesignalId() -> nullable
56-
- **Live Activities** (iOS only): startDefaultLiveActivity(activityId, attributes, content), exitLiveActivity(activityId)
56+
- **Live Activities** (iOS only): startDefaultLiveActivity(activityId, attributes, content)
5757
- **REST API** (delegated to OneSignalApiService): sendNotification(type) -> async bool, sendCustomNotification(title, body) -> async bool, fetchUser(onesignalId) -> async nullable UserData, updateLiveActivity(activityId, event, eventUpdates?) -> async bool
5858

5959
### Prompt 1.4 - OneSignalApiService (REST API Client)
@@ -81,8 +81,9 @@ updateLiveActivity (iOS only):
8181
- POST `https://api.onesignal.com/apps/{app_id}/live_activities/{activity_id}/notifications`
8282
- Authorization: `Key {ONESIGNAL_API_KEY}` (requires REST API key)
8383
- Body: `{ event: "update"|"end", event_updates, name, priority: 10 }`
84-
- For end events: add `dismissal_date` (current unix timestamp), send `{ data: {} }` as `event_updates` if none provided
85-
- Returns bool success
84+
- For update events: wrap content state in `{ data: { status, message, estimatedTime } }` as `event_updates`
85+
- For end events: add `dismissal_date` (current unix timestamp), send `{ message: "Ended" }` as `event_updates`
86+
- Check `response.ok` (2xx) for success, not just 200 (API returns 201)
8687

8788
hasApiKey:
8889

@@ -141,7 +142,7 @@ Clean up listeners on teardown (if platform requires it).
141142
12. **Triggers Section** (Add/Add Multiple/Remove Selected/Clear All - IN MEMORY ONLY)
142143
13. **Track Event Section** (JSON validation)
143144
14. **Location Section** (Shared toggle, Prompt button)
144-
15. **Live Activities Section** (iOS only - Start, Update, Stop Updating, End)
145+
15. **Live Activities Section** (iOS only - Start, Update, End)
145146
16. **Next Page Button**
146147

147148
### Prompt 2.1a - App Section
@@ -279,14 +280,13 @@ Separate SectionCard titled "User":
279280
Only shown on iOS. Requires an iOS Widget Extension target with a Live Activity using `DefaultLiveActivityAttributes` from the OneSignal SDK.
280281

281282
- Title: "Live Activities" with info icon
282-
- Input card with two editable fields (pre-filled, not empty):
283+
- Input card with two editable fields (pre-filled, not empty), using Inline Input Row styling per styles.md:
283284
- "Activity ID" (default: "order-1") — identifies the Live Activity for all operations
284285
- "Order #" (default: "ORD-1234") — attribute set at start, immutable after
285286
- Four buttons:
286287
1. START LIVE ACTIVITY — calls `OneSignal.LiveActivities.startDefault(activityId, attributes, content)` with initial order status. Disabled when Activity ID is empty.
287288
2. UPDATE → {NEXT STATUS} — cycles through order statuses via REST API (`event: "update"`). Label dynamically shows the next status (e.g. "UPDATE → ON THE WAY"). Disabled when Activity ID is empty, while updating, or when no API key is configured.
288-
3. STOP UPDATING LIVE ACTIVITY — calls `OneSignal.LiveActivities.exitDefault(activityId)` to unsubscribe from remote updates. Outlined style. Disabled when Activity ID is empty.
289-
4. END LIVE ACTIVITY — ends the activity via REST API (`event: "end"`) with `dismissal_date`. Outlined style. Disabled when Activity ID is empty or when no API key is configured.
289+
3. END LIVE ACTIVITY — ends the activity via REST API (`event: "end"`) with `dismissal_date`. Outlined style. Disabled when Activity ID is empty or when no API key is configured.
290290

291291
Order status cycle (content state fields: `status`, `message`, `estimatedTime`):
292292

demo/styles.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,28 @@ Used for secondary and destructive actions. "Destructive" and "outlined" refer t
136136

137137
## Text Input Fields
138138

139+
Standalone bordered inputs used in dialogs.
140+
139141
- Corner radius: 8
140142
- Content padding: 12 horizontal, 14 vertical
141143
- Border: 1px solid osGrey700
142144
- Focused border: 2px solid osPrimary (must not cause layout shift)
143145
- Placeholder color: osGrey600
144146

147+
### Inline Input Row
148+
149+
Borderless label + input pairs displayed inside a card (e.g. Live Activity fields). The card provides the outer border; individual inputs have no border.
150+
151+
| Property | Value |
152+
| --------------- | ------------------------------------ |
153+
| Layout | Horizontal row (label left, input right) |
154+
| Row spacing | 4 vertical between rows |
155+
| Label style | bodyMedium (14), color osGrey600 |
156+
| Label min-width | 80 |
157+
| Input style | bodyMedium (14), default text color |
158+
| Input alignment | Right-aligned, flex fill |
159+
| Input border | None |
160+
145161
## Warning Banner
146162

147163
- Uses card styling with osWarningBackground color

0 commit comments

Comments
 (0)