Setup wizard: in-chat cards alongside the PHP fallback#76
Open
lezama wants to merge 1 commit into
Open
Conversation
Adds an in-chat, card-driven first-run setup flow that mirrors the existing PHP wizard (PR #72) and writes to the same two options. The PHP wizard stays as a fallback deep-link surface at `?page=openclawp-setup`; the welcome notice now points at the Chat page so users land in chat-card mode by default. - New `OpenclaWP_Setup_Rest` exposes three REST routes (`GET /setup/state`, `POST /setup/enable-example-agent`, `POST /setup/complete`) gated on `manage_options`. - New `blocks/chat-shared/setup/` builds a single wizard card from declarative step definitions; `ChatSurface` mounts it above the existing card stack while `openclaWPConfig.setupCompleted === false`. - Bootstrap localises `setupCompleted` + `setupRestUrl` for the JS side and registers the new REST class.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Converts the first-run setup flow from server-rendered admin pages (PR #72) to in-chat cards that render on the Chat page and inside the floating admin-bar panel. The original PHP wizard at
?page=openclawp-setupstays as a fallback deep-link surface; this PR adds a card-driven path on top.OpenclaWP_Setup_Restexposes three small REST routes (GET /setup/state,POST /setup/enable-example-agent,POST /setup/complete) gated onmanage_options.blocks/chat-shared/setup/directory builds a card stack from declarative step definitions. Each step's "Continue" button POSTs to the REST surface and advances.ChatSurface.jsxmounts the wizard cards on first load whenopenclaWPConfig.setupCompleted === false.Why
PR #72 shipped a working but traditional 3-step admin wizard. With the Card UI primitive in place (PR #73) and a floating chat panel reachable from every wp-admin screen (PR #70), the wizard can be a first-class part of the chat surface — same place users will spend time after setup.
Test plan
openclawp_setup_completed === '1'.?page=openclawp-setupstill renders the original PHP wizard for deep-linkers.🤖 Generated with Claude Code