From 90abd6846c4d206e3fc5c84a4be7abf369b720a7 Mon Sep 17 00:00:00 2001 From: MatejGhub Date: Sat, 12 Sep 2026 23:17:23 +0200 Subject: [PATCH] dashboard page fixes v1 (visual only) --- .gitignore | 1 + apps/web/src/lib/admin-ai-roles.ts | 4 +- apps/web/src/lib/assistant/engine.ts | 8 +- apps/web/src/lib/assistant/executor.ts | 4 +- apps/web/src/lib/assistant/intents.ts | 4 +- apps/web/src/lib/assistant/state.svelte.ts | 6 +- .../src/lib/components/CommandPalette.svelte | 4 +- .../src/lib/components/DashboardHeader.svelte | 34 +- apps/web/src/lib/components/Nav.svelte | 15 - .../components/assistant/AssistantDock.svelte | 23 +- .../components/assistant/AssistantHost.svelte | 7 +- .../lib/components/docs/DocsAskGuide.svelte | 6 +- .../components/products/ProductTable.svelte | 2 +- .../components/stores/StoreSetupWizard.svelte | 8 +- .../tutorial/TutorialOverlay.svelte | 46 -- .../src/lib/components/ui/DropdownMenu.svelte | 7 +- apps/web/src/lib/docs-guide/tree.ts | 28 +- apps/web/src/lib/i18n/messages/en.ts | 459 +++++++++--------- apps/web/src/lib/nav-ui.svelte.ts | 60 +-- apps/web/src/lib/seo.ts | 10 +- apps/web/src/routes/+layout.svelte | 150 +++--- apps/web/src/routes/attributes/+page.svelte | 12 +- apps/web/src/routes/dashboard/+page.svelte | 7 - apps/web/src/routes/docs/+page.svelte | 2 +- apps/web/src/routes/feeds/+page.svelte | 9 +- apps/web/src/routes/products/+page.svelte | 6 +- apps/web/src/routes/settings/+page.svelte | 6 + .../src/routes/standard-fields/+page.svelte | 26 +- apps/web/src/routes/stores/+page.svelte | 58 +-- 29 files changed, 455 insertions(+), 557 deletions(-) diff --git a/.gitignore b/.gitignore index 43f7886..bde6117 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,4 @@ apps/web/static/.audit/ # codehelper (generated local — do not commit) .zed/ +matej.md \ No newline at end of file diff --git a/apps/web/src/lib/admin-ai-roles.ts b/apps/web/src/lib/admin-ai-roles.ts index 83f3fb0..7e63dc4 100644 --- a/apps/web/src/lib/admin-ai-roles.ts +++ b/apps/web/src/lib/admin-ai-roles.ts @@ -41,13 +41,13 @@ export const AI_ROLE_META: Record< docs_api: { label: "Docs / API", description: - "Future docs/API assistant slot — /docs Ask stays rule-based and must never call this role.", + "Future docs/API assistant slot. /docs Ask stays rule-based and must never call this role.", modelPlaceholder: "gpt-5.6-luna" }, support: { label: "Support", description: - "Ticket auto-reply AI fallback — configure provider/key/model here; enable delivery in Support knowledge → Auto-reply.", + "Ticket auto-reply AI fallback. Configure the provider/key/model here; enable delivery in Support knowledge → Auto-reply.", modelPlaceholder: "gpt-5.6-luna" } }; diff --git a/apps/web/src/lib/assistant/engine.ts b/apps/web/src/lib/assistant/engine.ts index 4e76db7..05db594 100644 --- a/apps/web/src/lib/assistant/engine.ts +++ b/apps/web/src/lib/assistant/engine.ts @@ -75,14 +75,14 @@ export function buildIdentityReply(): AssistantMessage { return makeMessage({ role: "assistant", kind: "text", - text: "I am the System assistant — I help you navigate Descrybe, run supported actions after you confirm, and guide setup using built-in workflows." + text: "I am the System assistant. I can help you navigate Descrybe, run supported actions after you confirm, and guide you through setup." }); } export function buildApiExamplesMessage(): AssistantMessage { const key = "dk_YOUR_API_KEY"; const text = [ - "Use your API key in the X-API-Key header (placeholder below — never paste a real secret into chat).", + "Use your API key in the X-API-Key header. The example below uses a placeholder. Never paste a real secret into chat.", "", "List attributes:", `curl -s -H "X-API-Key: ${key}" "https://descrybe.io/api/v1/attributes?page=1&limit=25"`, @@ -165,7 +165,7 @@ export function buildGuideMessages(intent: IntentDefinition): AssistantMessage[] makeMessage({ role: "assistant", kind: "text", - text: `Opening ${intent.route} and highlighting the control to use. Follow the steps above — tell me when you are stuck.` + text: `Opening ${intent.route} and highlighting the control to use. Follow the steps above. Tell me if you get stuck.` }) ]; } @@ -175,7 +175,7 @@ export function buildFailureSupportOffer(issueDetail: string): AssistantMessage return makeMessage({ role: "assistant", kind: "quick_replies", - text: `That action failed${safe ? ` (${safe})` : ""}. You can open a support ticket with this error summary (no secrets).`, + text: `That action failed${safe ? ` (${safe})` : ""}. You can open a support ticket with this error summary. Do not include any secrets.`, quickReplies: ["Open a support ticket", "Help", "Cancel"] }); } diff --git a/apps/web/src/lib/assistant/executor.ts b/apps/web/src/lib/assistant/executor.ts index a4a0f8a..28e2193 100644 --- a/apps/web/src/lib/assistant/executor.ts +++ b/apps/web/src/lib/assistant/executor.ts @@ -134,7 +134,7 @@ export async function executeIntent( const lines = [ `API key created${prefix ? ` (${prefix}…)` : ""}.`, secret - ? `Copy this secret now — it will not be shown again:\n${secret}` + ? `Copy this secret now. It will not be shown again:\n${secret}` : "Secret was not returned (you may lack permission). Create one in Settings → API Keys.", "", "Example (placeholder if you already copied the secret elsewhere):", @@ -317,7 +317,7 @@ export async function executeIntent( message: [ `Based on ~${productCount} product(s) in your catalog, ${fit.name} fits (${cap}${credits}).`, fit.description ? fit.description : "", - "Open Billing to review usage or upgrade. Prices follow your live plan list — not invented here." + "Open Billing to review usage or upgrade. Prices come directly from your live plan list." ] .filter(Boolean) .join("\n"), diff --git a/apps/web/src/lib/assistant/intents.ts b/apps/web/src/lib/assistant/intents.ts index 8072bb4..996d937 100644 --- a/apps/web/src/lib/assistant/intents.ts +++ b/apps/web/src/lib/assistant/intents.ts @@ -507,7 +507,7 @@ export const INTENT_REGISTRY: IntentDefinition[] = [ guideSteps: [ { title: "Open Settings → API Keys", detail: "Company admin required to create keys" }, { title: "Click Create API Key", detail: "Name the key, then create" }, - { title: "Copy the secret once", detail: "It is shown only at creation — store it safely" } + { title: "Copy the secret once", detail: "It is shown only when created, so store it safely" } ] }, { @@ -704,11 +704,9 @@ export function intentById(id: IntentId): IntentDefinition | undefined { } export const QUICK_START_REPLIES = [ - "Getting started", "Add a feed URL", "Upload a CSV", "Map fields", - "Connect Shopify", "API keys", "Attributes", "Start processing", diff --git a/apps/web/src/lib/assistant/state.svelte.ts b/apps/web/src/lib/assistant/state.svelte.ts index 2b5870d..1288907 100644 --- a/apps/web/src/lib/assistant/state.svelte.ts +++ b/apps/web/src/lib/assistant/state.svelte.ts @@ -57,7 +57,7 @@ function createAssistantController() { makeMessage({ role: "assistant", kind: "quick_replies", - text: "Hi — I am the System assistant. I help you navigate Descrybe and run supported setup actions. What do you want to do?", + text: "Hi! I can help you navigate Descrybe and set things up. What would you like to do?", quickReplies: [...QUICK_START_REPLIES] }) ]; @@ -261,7 +261,7 @@ function createAssistantController() { makeMessage({ role: "assistant", kind: "steps", - text: "Next — mapping:", + text: "Next: mapping", steps: intentById("map_fields")?.guideSteps }) ); @@ -491,7 +491,7 @@ function createAssistantController() { } flow = { ...flow, stepId: "ask_body", slots: { ...flow.slots, subject } }; const hint = flow.slots.body_prefill - ? "Describe the issue (a failure summary is already prepared — you can edit or replace it). No secrets." + ? "Describe the issue. A failure summary is already prepared, and you can edit or replace it. Do not include any secrets." : "Describe the issue. No passwords, API keys, or personal data."; push( makeMessage({ diff --git a/apps/web/src/lib/components/CommandPalette.svelte b/apps/web/src/lib/components/CommandPalette.svelte index f2e4519..40809c2 100644 --- a/apps/web/src/lib/components/CommandPalette.svelte +++ b/apps/web/src/lib/components/CommandPalette.svelte @@ -327,7 +327,7 @@ aria-modal="true" aria-label={i18n.t("commandPalette.ariaLabel")} tabindex="-1" - class="relative z-[61] flex w-full max-w-lg flex-col overflow-hidden rounded-lg border bg-background shadow-lg" + class="relative z-[61] flex w-full max-w-lg flex-col overflow-hidden rounded-lg border bg-background shadow-lg lg:fixed lg:left-[17.5rem] lg:top-[4.5rem] lg:w-80 lg:max-w-none" onkeydown={onPanelKeydown} onclick={(event) => event.stopPropagation()} > @@ -350,7 +350,7 @@ autocomplete="off" autocorrect="off" spellcheck="false" - class="h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0" + class="h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground focus-visible:!outline-none focus-visible:!outline-offset-0" />