Repository navigation
Mac: AI generation as a conversation with versions and drafts (phase 1) - #85
Conversation
The AI window was one request with automatic repair and a Refine field that knew nothing of earlier requests. It is now a conversation about one widget: each turn sends the earlier requests, the current source and the selected Skills; each change that runs becomes a version the user can go back to; a change that does not run, a provider error or Stop leaves the widget and the preview as they were. Conversations are saved after every change as local JSON files and offered again as drafts. A turn makes at most four provider requests (one generation, three repairs) instead of up to twenty. Changing the preview size runs the widget again locally and sends nothing. Console lines sent with a repair are cut to 300 characters each. A saved conversation holds requests, notes, error summaries and sources. It holds no key, token, header, server or model; a test reads the file to check. The shared model, store and session are compiled for iPhone and iPad too, but their screens are unchanged. Tests use a stub provider and need no key. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Driving the window in a test build against a local stand-in provider showed three things: a conversation opened again started at its first turn instead of its last, the token line wrapped once the numbers grew, and the subtitle was cut off when the provider picker was shown. A capture of that run is added to the documentation. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Run in the app, on this Mac, after the first commit. The unsigned Debug build was started in the app's own test mode with a separate home folder, with a provider profile passed as launch arguments (nothing saved to settings) that points at a local stand-in server. No key and no real model. Worked as described: opening from File > Generate Widget with AI, sending with Return, the first widget and its preview, a change that failed once and was repaired ("Fixed automatically 1 time"), a change that never ran (widget and preview stayed, Try Again and Show Its Code shown), Go to This Version, continuing from the older version (later turn marked "left behind"), Stop (ended at once), a provider error with Retry (both a 500 from the stand-in and Apple Private Cloud Compute being unavailable), and reopening the draft after closing the window and after quitting the app. Fixed in the second commit: a reopened conversation now scrolls to its last turn, the token line no longer wraps, the subtitle is shorter. Not exercised: Save Widget. In this build the widget library folder does not exist, so saving answered "Invalid package name"; the call is the one the old window made. The size picker was not operated in the app (it is a pop-up menu); the session test covers it. A real model, a signed build and the menus of the + and … buttons were not tried. |
Skipped unless ROCKY_OPENAI_APIKEY is set, like the existing live tests. It sends a new widget, a restyling and an addition, and checks that each turn runs, that the model says what it did, and that the first turn's text is still there after the third. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Real model, on this Mac:
Turn 2 changed five lines of 24 (the background, the title's font and color, and three colors that would not read on dark blue). Turn 3 added two lines and changed nothing else. Each reply carried the one-sentence note. This is one run of one easy case; it is not a quality measurement. The result was checked as source and by the runtime, not looked at as a picture. |

What the user gets
The AI window of the Mac app is now a conversation about one widget: describe it, look at the preview, ask for a change, look again.
Empty state:
docs/images/ai-conversation-mac-empty.png. Both pictures are drawn by a test with a prepared conversation (see below); they are not captures of a session with a real model.This is phase 1 of the plan agreed with the owner. Not in it: streaming, several sizes at once, the same conversation in the editor's Copilot panel, targeted edits, a diff view, and the iPhone and iPad screens. No linked issue.
Security and compatibility
testSavedConversationRoundTripsAndHoldsNoCredentialreads the file and checks.AgentRuntimeBridgein a temporary package under the normal runtime limits.AgentLoopEventgains anotecase andAgentLoopRequest.Modeaturncase. The existing modes, the iPhone and iPad screens and the editor Copilot are unchanged.Found while doing this, not changed here
The AI preview package has no
widget.json, so it is treated as a legacy package and may use the network. A widget saved from the AI window gets a new Package 2.0 manifest with no permissions. A generated widget that fetches data therefore works in the preview and fails after saving untilnetworkand its domains are added in the editor. This was already so before this change. Android has the AI declare network use; the Apple apps do not. It is described indocs/ai-conversation.md.What ran, on this Mac
ScriptWidgetRuntimeTests, macOS, whole suite: 827 tests, 794 passed, 33 skipped, 0 failed. The 18 new tests are inAIConversationTests; they use a stub provider and no key.ScriptWidgetMacbuild: succeeded.ScriptWidget(iOS) simulator build: succeeded.ScriptWidgetRuntimeTestson the iPhone 18 Pro Max simulator,AIConversationTestsandAIGenerationTestsonly: 32 tests, 28 passed, 4 skipped, 0 failed.node Scripts/validate-doc-links.mjsandnode Scripts/validate-release.mjs: passed.What did not run
./Scripts/release-readiness.shas a whole. Its editor, Web Studio and preview-engine steps were skipped: no JavaScript changed and the worktree has nonode_modules. The rest of the iOS test suite was not run.🤖 Generated with Claude Code