Generates an always-on support widget for a host app's logged-in users. One widget, two clear intents:
Chat — a live conversation with a CodeMySpec operator.
Report a problem — file an issue (title / description / severity) that lands in the project's CodeMySpec issue queue.
$ mix cms_gen.support_widget
Both intents ride ONE connection: per logged-in user, the host app's server
opens a Slipstream connection to CodeMySpec authenticated by the project
deploy key (the key never reaches the browser). Chat relays
send_message/new_message; "Report a problem" pushes a submit_feedback
event on the same conversation:<user_id> topic, which CodeMySpec files as an
issue. No OAuth, no second transport.
This supersedes cms_gen.feedback_widget (feedback-only, OAuth/REST) — the
support widget does everything that did, plus chat, over the deploy-key socket.
Generated files
lib/<app>/code_my_spec/widget_client.ex— per-user Slipstream clientlib/<app>/code_my_spec/widget.ex— registry/supervisor interfacelib/<app>_web/live/support_widget_live.ex— the sticky nested LiveView
It also edits the four things the widget needs to work: the slipstream
dependency, the registry and supervisor in the supervision tree, the
live_render in the root layout, and the socket URL and deploy key in
runtime config. Each is skipped if already present and reported either way.
Assumptions
phx.gen.auth conventions: <Base>Web.UserAuth provides an
on_mount {_, :mount_current_scope} assigning current_scope.user, and the
app runs <Base>.PubSub. The deploy key is read from
Application.get_env(:<app>, :deploy_key) — the same key content sync uses.