diff --git a/app/api/welcome.py b/app/api/welcome.py index 159074f..7533a9a 100644 --- a/app/api/welcome.py +++ b/app/api/welcome.py @@ -81,7 +81,7 @@ async def get_welcome( logger.warning("Welcome render failed: %s", e, exc_info=True) raise HTTPException( status_code=500, - detail="Welcome template render failed. An admin can fix it at /admin/welcome.", + detail="Welcome template render failed. An admin can fix it at /admin/agent-prompt.", ) return WelcomeResponse(content=rendered) diff --git a/app/web/templates/_app_header.html b/app/web/templates/_app_header.html index 168ecbe..49a4790 100644 --- a/app/web/templates/_app_header.html +++ b/app/web/templates/_app_header.html @@ -14,7 +14,7 @@ Setup local agent {% if session.user.is_admin %} Marketplaces - {% set _admin_active = _path.startswith('/admin/tables') or _path.startswith('/admin/tokens') or _path.startswith('/admin/users') or _path.startswith('/admin/groups') or _path.startswith('/admin/access') or _path.startswith('/admin/server-config') or _path.startswith('/admin/welcome') or _path.startswith('/admin/setup-banner') %} + {% set _admin_active = _path.startswith('/admin/tables') or _path.startswith('/admin/tokens') or _path.startswith('/admin/users') or _path.startswith('/admin/groups') or _path.startswith('/admin/access') or _path.startswith('/admin/server-config') or _path.startswith('/admin/agent-prompt') %}
{% endif %} diff --git a/app/web/templates/admin_welcome.html b/app/web/templates/admin_welcome.html index 6571b62..c8e3d12 100644 --- a/app/web/templates/admin_welcome.html +++ b/app/web/templates/admin_welcome.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% block title %}Welcome Prompt — {{ config.INSTANCE_NAME }}{% endblock %} +{% block title %}Agent Setup Prompt — {{ config.INSTANCE_NAME }}{% endblock %} {% block content %} {% endif %} diff --git a/docs/welcome-template.md b/docs/agent-setup-prompt.md similarity index 94% rename from docs/welcome-template.md rename to docs/agent-setup-prompt.md index 7bd31fb..72c1575 100644 --- a/docs/welcome-template.md +++ b/docs/agent-setup-prompt.md @@ -1,6 +1,6 @@ -# Welcome prompt customization +# Agent Setup Prompt -The welcome prompt is the `CLAUDE.md` file generated in an analyst's local +The agent setup prompt is the `CLAUDE.md` file generated in an analyst's local workspace by `da analyst setup`. It instructs Claude Code on how to behave in that workspace — which commands to use, where to read schema metadata, what metrics exist, what plugins are available. @@ -15,7 +15,7 @@ no admin action is required. Admins can override the template via: -- **Admin UI:** `/admin/welcome` — textarea editor with placeholder cheatsheet +- **Admin UI:** `/admin/agent-prompt` — textarea editor with placeholder cheatsheet and live preview button. Save sends a `PUT` to `/api/admin/welcome-template`. - **REST API:** - `GET /api/admin/welcome-template` — returns `{content, default, updated_at, updated_by}`. `content` is `null` when no override is set. @@ -32,7 +32,7 @@ audit trail (`updated_at`, `updated_by`) is preserved. [Jinja2](https://jinja.palletsprojects.com/) with `StrictUndefined`. Any typo in a placeholder name raises an error at render time rather than silently emitting an empty string. Server returns HTTP 500 with a hint -pointing at `/admin/welcome`; the admin UI rejects syntax errors AND +pointing at `/admin/agent-prompt`; the admin UI rejects syntax errors AND undefined-placeholder errors with HTTP 400 on save (validated by rendering the template against a stub context before persisting). diff --git a/tests/snapshots/openapi.json b/tests/snapshots/openapi.json index 76e7c8b..f163fb0 100644 --- a/tests/snapshots/openapi.json +++ b/tests/snapshots/openapi.json @@ -3358,9 +3358,9 @@ ] } }, - "/admin/welcome": { + "/admin/agent-prompt": { "get": { - "operationId": "admin_welcome_page_admin_welcome_get", + "operationId": "admin_agent_prompt_page_admin_agent_prompt_get", "parameters": [ { "in": "header", diff --git a/tests/test_web_ui.py b/tests/test_web_ui.py index e054a24..73408d6 100644 --- a/tests/test_web_ui.py +++ b/tests/test_web_ui.py @@ -233,14 +233,16 @@ class TestClaudeSetupPreview: assert "da diagnose" in body assert "da auth whoami" in body - def test_dashboard_preview_visible(self, web_client, admin_cookie): + def test_dashboard_setup_cta_links_to_setup(self, web_client, admin_cookie): + """Dashboard setup CTA shows env-setup-cta and a link to /setup instead + of an inline collapsed preview.""" resp = web_client.get("/dashboard", cookies=admin_cookie) assert resp.status_code == 200 body = resp.text assert "env-setup-cta" in body - assert "setup-preview-pre" in body - assert "What Claude Code will receive" in body - assert "<will be generated on click>" in body + assert "View what Claude Code will receive on /setup" in body + # inline