From c4d23cf235e3e0cee954ddd52d4d80410d991aeb Mon Sep 17 00:00:00 2001 From: ZdenekSrotyr Date: Sat, 2 May 2026 22:18:21 +0200 Subject: [PATCH] feat(admin-prompt): update editor UX + docs for banner context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - admin_welcome.html: update subtitle, description, placeholder cheatsheet (drop tables/metrics/marketplaces/sync_interval; add user-null note and security note). Textarea initial value is now empty (no default template to show). Preview pane uses innerHTML (HTML output). refreshStatus sets editor to empty when no override. Preview pane styled as light surface. Reset modal copy updated (no banner shown, not "OSS-shipped template"). - config/claude_md_template.txt: deleted (markdown template is gone; default is now no banner). - docs/agent-setup-prompt.md: rewritten for variant C — describes the /setup banner, smaller placeholder table, security/sanitization notes, anonymous-user guard, example HTML snippet. --- app/web/templates/admin_welcome.html | 48 ++++--- config/claude_md_template.txt | 195 --------------------------- docs/agent-setup-prompt.md | 127 +++++++++-------- 3 files changed, 85 insertions(+), 285 deletions(-) delete mode 100644 config/claude_md_template.txt diff --git a/app/web/templates/admin_welcome.html b/app/web/templates/admin_welcome.html index c8e3d12..8c508df 100644 --- a/app/web/templates/admin_welcome.html +++ b/app/web/templates/admin_welcome.html @@ -116,17 +116,16 @@ .welcome-preview-col { border: 1px solid var(--border, #e5e7eb); border-radius: 8px; - background: #1e1e2e; - color: #cdd6f4; + background: var(--surface, #fff); + color: var(--text-primary, #111827); padding: 16px; - font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, monospace); - font-size: 13px; - white-space: pre-wrap; + font-family: var(--font-primary, system-ui, sans-serif); + font-size: 14px; overflow: auto; max-height: 600px; } .welcome-preview-col h4 { - color: #cdd6f4; margin: 0 0 8px; font-size: 12px; opacity: 0.7; + color: var(--text-secondary, #6b7280); margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; } .welcome-preview-error { @@ -203,7 +202,7 @@

Agent Setup Prompt

-

Customise the CLAUDE.md generated for analysts on da analyst setup.

+

Customise the banner shown above the setup commands on /setup.

{% if is_override %} @@ -220,33 +219,32 @@

- Edit the template below to customise onboarding instructions for analysts on this instance. - Leave empty or click Reset to default to revert to the OSS-shipped template. - The override is rendered server-side — placeholders like - {{ "{{ user.name }}" }} are substituted at delivery time. + This banner is shown above the setup commands on /setup. Empty by default. + Use it for organisation-specific notes: VPN requirements, support channel, data classification + policy, platform onboarding steps, etc. + The override is rendered server-side as HTML — Jinja2 placeholders like + {{ "{{ user.name }}" }} are substituted at render time. + Output is sanitised post-render: inline <script> tags and + on*= event handlers are stripped as a safety net.

Available placeholders
- {{ "{{ instance.name }}" }} — instance display name -{{ "{{ instance.subtitle }}" }} — operator name -{{ "{{ server.url }}" }} — full server URL -{{ "{{ server.hostname }}" }} — host part -{{ "{{ sync_interval }}" }} — refresh cadence (instance.yaml) -{{ "{{ data_source.type }}" }} — keboola | bigquery | local -{{ "{{ tables }}" }} — list of {name, description, query_mode} -{{ "{{ metrics.count }}" }}, {{ "{{ metrics.categories }}" }} -{{ "{{ marketplaces }}" }} — RBAC-filtered list of {slug, name, plugins[]} + {{ "{{ instance.name }}" }} — instance display name +{{ "{{ instance.subtitle }}" }} — operator / org name +{{ "{{ server.url }}" }} — full server URL +{{ "{{ server.hostname }}" }} — host part only {{ "{{ user.email }}" }}, {{ "{{ user.name }}" }}, {{ "{{ user.is_admin }}" }}, {{ "{{ user.groups }}" }} -{{ "{{ now }}" }}, {{ "{{ today }}" }} + (user may be null for anonymous visitors — guard with {{ "{% if user %}" }}) +{{ "{{ now }}" }}, {{ "{{ today }}" }} — server time (UTC) / date string
- +

Live preview

@@ -266,7 +264,7 @@