fix(examples/swift): fix ChatGPTStyleChat launch issue and polish UI - #611
Conversation
- project.pbxproj: add missing productReference + PBXFileReference for ChatGPTStyleChat.app and populate the empty Products group — without these the scheme executable is "None" and the app never launches after a successful build - ChatView: iMessage-style gradient bubbles (indigo→purple for user, system card for assistant), material header with contextual toggle icon, pill composer with arrow.up.circle.fill send button activated by Return - OrderCardView: status-colored gradient header, "Live widget" badge, SF Symbols (shippingbox, calendar, truck), dot-list items panel, matching gradient Refresh button; accent color + icon keyed on status - ChatViewModel: gatherer prompt now handles out-of-scope queries with a natural explanation instead of recycling the last tool result Fixes #610 Code written by Claude (claude-sonnet-4-6), architected and approved by @cornelcroi.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d422df76bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| value = "YOUR_OPENAI_API_KEY" | ||
| isEnabled = "YES"> |
There was a problem hiding this comment.
Disable placeholder API key environment variable
With this enabled scheme variable, users who follow the documented option to paste their key into Config.swift still get OPENAI_API_KEY=YOUR_OPENAI_API_KEY, because Config.openAIKey prefers any non-empty environment value. In that setup the app launches but every model call uses the literal placeholder and fails until the scheme is edited, so either leave this disabled or make the config ignore the placeholder.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch. Fixed in cd2ecd7 — env var is now disabled in the scheme so it no longer shadows a key set in Config.swift.
| CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; | ||
| COPY_PHASE_STRIP = NO; | ||
| DEBUG_INFORMATION_FORMAT = dwarf; | ||
| DEVELOPMENT_TEAM = 3S2T8KU6X4; |
There was a problem hiding this comment.
Avoid hard-coding the signing team
This hard-codes every clone of the sample to Apple team 3S2T8KU6X4. When someone runs the app on a physical device or archives it with their own Apple account, Xcode will try to provision for this team and fail unless they manually change Signing settings; the sample previously left team selection to the user/Xcode. Please leave DEVELOPMENT_TEAM unset or move it to a user-local config.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in cd2ecd7 — DEVELOPMENT_TEAM removed from both Debug and Release build configurations.
Replace indigo/purple gradient on user bubbles with iMessage blue (0.0, 0.48, 1.0) and match toggle + send button to the same color. The status-colored widget card is now the only other accent on screen — two colors, two purposes, no visual clash. Code written by Claude (claude-sonnet-4-6), architected and approved by @cornelcroi.
…, remove team ID - Scheme: set OPENAI_API_KEY env var to isEnabled=NO so the placeholder does not shadow a key pasted in Config.swift - project.pbxproj: remove hardcoded DEVELOPMENT_TEAM so cloners are not locked to a specific Apple team ID Code written by Claude (claude-sonnet-4-6), architected and approved by @cornelcroi.
Issue Link
Fixes #610
Summary
Changes
project.pbxproj— Added missingPBXFileReferenceforChatGPTStyleChat.app, populated the empty Products group, and addedproductReferenceto the native target. Without these three entries the scheme executable was "None" and the app never launched after a successful build.ChatGPTStyleChat.xcscheme— Replaced hardcoded OpenAI API key withYOUR_OPENAI_API_KEYplaceholder.ChatView.swift— iMessage-style gradient bubbles (indigo→purple for user, system card for assistant), material blur header with contextual toggle icon, pill-shaped composer witharrow.up.circle.fillsend button; Return key now sends the message.OrderCardView.swift— Status-colored gradient header (green/blue/orange/red keyed on status string), "Live widget" badge so the card is clearly not a chat bubble, SF Symbols for shipping/calendar/truck, dot-list items panel, matching gradient Refresh button.ChatViewModel.swift— Gatherer prompt now explicitly handles out-of-scope queries (jokes, weather, general chat) with a natural explanation instead of recycling the last tool result.User experience
Before: open
.xcodeproj→ build succeeds → nothing launches. Widget is an unstyled white card.After: open → build → simulator boots and app appears. Chat looks like a real iOS messaging app. The order card is visually distinct with status-appropriate colors. Off-topic questions get a clean "outside my scope" reply.
Checklist
Code written by Claude (claude-sonnet-4-6), architected and approved by @cornelcroi.