Skip to content

Commit 96c5aa4

Browse files
committed
feat: update product models and enhance welcome suggestions styling in Agentic UI
1 parent 96fa0fc commit 96c5aa4

4 files changed

Lines changed: 146 additions & 20 deletions

File tree

components/AgenticUI.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ const PRODUCT_CATEGORIES = [
4545
id: "mpos",
4646
label: "mPOS / Mobile Reader",
4747
icon: "📲",
48-
models: "QPOS mini, QPOS Cute, CR100, QPOS Plus",
48+
models: "QPOS mini, QPOS Cute, CR100, QPOS Plus(pinpad)",
4949
color: "#8b5cf6",
5050
description: "Bluetooth/USB readers paired with phone",
5151
},
5252
{
5353
id: "linux",
5454
label: "Linux Terminal",
5555
icon: "🐧",
56-
models: "D30-linux, QPOS-linux",
56+
models: "D30-linux, QPOS Plus-linux",
5757
color: "#10b981",
5858
description: "Linux-based POS with C/C++ SDK",
5959
},

components/CopilotKitWrapper.jsx

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const INSTRUCTIONS = `You are the Dspread Documentation Assistant.
5555
## CONVERSATION FLOW — follow this order every time.
5656
5757
### Step 1 — Identify the user's product
58-
Before giving integration advice, ALWAYS ask or confirm which product the user has.
58+
Before giving integration advice, ALWAYS identify the user's product type.
5959
Use this classification:
6060
6161
| Category | Terminal Models | Docs Section |
@@ -65,17 +65,15 @@ Use this classification:
6565
| **Linux Terminal** | D30-linux, QPOS-linux (Linux-based POS) | Linux Terminals |
6666
| **Cloud Speaker** | DS10, DS50, DS200 (audio payment notification) | Cloud Speaker |
6767
68-
If the user mentions a specific model (e.g. "D60", "QPOS mini", "CR100", "DS50"), map it
69-
to the right category and proceed.
68+
IMPORTANT: Users often start by clicking a product category from the suggestion buttons shown in the welcome screen. When the user's FIRST message matches a product category (e.g. "📱 Smart POS" or "I'm using a Smart POS terminal"), IMMEDIATELY:
69+
1. Acknowledge their product choice
70+
2. Call the **selectProductType** action to show the interactive product selector card for visual confirmation
71+
3. Then navigate to the relevant starting page and provide an overview
7072
71-
If the user's question is ambiguous or does not mention a model, ask:
72-
"Could you tell me which terminal model you are using? For example:
73-
- **Smart POS**: D20, D30, D50, D60, D70, D80, D80K
74-
- **Mobile Reader (mPOS)**: QPOS mini, QPOS Cute, CR100, QPOS Plus pinpad
75-
- **Linux Terminal**: D30-linux, QPOS-linux
76-
- **Cloud Speaker**: DS10, DS50, DS200
73+
If the user mentions a specific model (e.g. "D60", "QPOS mini", "CR100", "DS50"), map it
74+
to the right category and proceed directly — no need to call selectProductType.
7775
78-
This helps me give you the most relevant documentation."
76+
If the user's question is ambiguous or does not mention a model, call **selectProductType** to show the interactive product picker card.
7977
8078
### Step 2 — Give targeted advice
8179
Once the product type is known:
@@ -513,12 +511,40 @@ ${relatedSuggestions}
513511
Make sure each suggestion is a natural question a developer would ask while reading this specific page.`;
514512
}, [currentPage, currentPageHeadings]);
515513

516-
// ─ Contextual suggestions — dynamically generated per page ───────────
514+
// ─ Welcome suggestions — static product categories (before first message) ─
515+
useCopilotChatSuggestions({
516+
suggestions: [
517+
{
518+
title: "📱 Smart POS (Android)",
519+
message: "I'm using a Smart POS terminal (D20, D30, D50, D60, D70, D80, D80K). Help me get started with Android SDK integration.",
520+
className: "welcome-product-suggestion welcome-smartpos",
521+
},
522+
{
523+
title: "📲 mPOS / Mobile Reader",
524+
message: "I'm using an mPOS mobile reader (QPOS mini, QPOS Cute, CR100, QPOS Plus). Help me connect it to my app.",
525+
className: "welcome-product-suggestion welcome-mpos",
526+
},
527+
{
528+
title: "🐧 Linux Terminal",
529+
message: "I'm using a Linux terminal (D30-linux, QPOS-linux). Help me set up the Linux SDK.",
530+
className: "welcome-product-suggestion welcome-linux",
531+
},
532+
{
533+
title: "🔊 Cloud Speaker",
534+
message: "I'm using a Cloud Speaker (DS10, DS50, DS200). Help me set up audio payment notifications.",
535+
className: "welcome-product-suggestion welcome-cloudspeaker",
536+
},
537+
],
538+
available: "before-first-message",
539+
});
540+
541+
// ─ Contextual suggestions — dynamically generated per page (after 1st msg) ─
517542
useCopilotChatSuggestions(
518543
{
519544
instructions: suggestionInstructions,
520545
minSuggestions: 3,
521546
maxSuggestions: 5,
547+
available: "after-first-message",
522548
},
523549
[currentPath],
524550
);
@@ -531,12 +557,7 @@ Make sure each suggestion is a natural question a developer would ask while read
531557
title: "Dspread Assistant",
532558
initial:
533559
"Welcome! I'm your Dspread documentation assistant. 👋\n\n" +
534-
"To help you best, could you tell me which terminal you're working with?\n\n" +
535-
"• **Smart POS** — D20, D30, D50, D60, D70, D80, D80K\n" +
536-
"• **Mobile Reader (mPOS)** — QPOS mini, QPOS Cute, CR100, QPOS Plus\n" +
537-
"• **Linux Terminal** — D30-linux, QPOS-linux\n" +
538-
"• **Cloud Speaker** — DS10, DS50, DS200\n\n" +
539-
"Or just ask any question and I'll guide you!",
560+
"Choose your product type below to get started, or ask any question directly!",
540561
}}
541562
defaultOpen={true}
542563
clickOutsideToClose={false}

public/docs-context.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"generatedAt": "2026-02-09T05:49:26.614Z",
2+
"generatedAt": "2026-02-09T08:49:18.927Z",
33
"baseUrl": "https://dspreadorg.github.io/docs",
44
"pageCount": 19,
55
"pages": [

styles/custom.css

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,3 +684,108 @@
684684
.agentic-card-executing .agentic-card-badge {
685685
animation: agenticPulse 1.5s ease-in-out infinite;
686686
}
687+
688+
/* ═══════════════════════════════════════════════════════════════════════ */
689+
/* Welcome Product Category Suggestions — Agentic UI style */
690+
/* ═══════════════════════════════════════════════════════════════════════ */
691+
692+
/* Make the suggestion container grid-based for welcome cards */
693+
.copilotKitMessages footer .suggestions:has(.welcome-product-suggestion) {
694+
display: grid;
695+
grid-template-columns: 1fr 1fr;
696+
gap: 8px;
697+
padding: 4px 0;
698+
}
699+
700+
/* Product category suggestion card styling */
701+
.copilotKitMessages footer .suggestions .welcome-product-suggestion {
702+
display: flex;
703+
align-items: center;
704+
padding: 12px 14px !important;
705+
border-radius: 12px !important;
706+
font-size: 0.8rem !important;
707+
font-weight: 600 !important;
708+
border: 1.5px solid transparent !important;
709+
background: linear-gradient(135deg, var(--product-bg-from), var(--product-bg-to)) !important;
710+
color: var(--product-text) !important;
711+
box-shadow: 0 2px 8px var(--product-shadow) !important;
712+
transition: all 0.25s ease !important;
713+
cursor: pointer;
714+
text-align: left;
715+
line-height: 1.3;
716+
min-height: 44px;
717+
}
718+
719+
.copilotKitMessages footer .suggestions .welcome-product-suggestion:hover {
720+
transform: translateY(-2px) scale(1.02) !important;
721+
box-shadow: 0 4px 16px var(--product-shadow-hover) !important;
722+
border-color: var(--product-border) !important;
723+
}
724+
725+
/* Smart POS — blue */
726+
.welcome-smartpos {
727+
--product-bg-from: #eff6ff;
728+
--product-bg-to: #dbeafe;
729+
--product-text: #1e40af;
730+
--product-border: #3b82f6;
731+
--product-shadow: rgba(59, 130, 246, 0.1);
732+
--product-shadow-hover: rgba(59, 130, 246, 0.25);
733+
}
734+
.dark .welcome-smartpos {
735+
--product-bg-from: #1e293b;
736+
--product-bg-to: #1e3a5f;
737+
--product-text: #93c5fd;
738+
--product-shadow: rgba(59, 130, 246, 0.15);
739+
--product-shadow-hover: rgba(59, 130, 246, 0.35);
740+
}
741+
742+
/* mPOS — purple */
743+
.welcome-mpos {
744+
--product-bg-from: #f5f3ff;
745+
--product-bg-to: #ede9fe;
746+
--product-text: #5b21b6;
747+
--product-border: #8b5cf6;
748+
--product-shadow: rgba(139, 92, 246, 0.1);
749+
--product-shadow-hover: rgba(139, 92, 246, 0.25);
750+
}
751+
.dark .welcome-mpos {
752+
--product-bg-from: #1e1b2e;
753+
--product-bg-to: #2e1f5e;
754+
--product-text: #c4b5fd;
755+
--product-shadow: rgba(139, 92, 246, 0.15);
756+
--product-shadow-hover: rgba(139, 92, 246, 0.35);
757+
}
758+
759+
/* Linux — green */
760+
.welcome-linux {
761+
--product-bg-from: #ecfdf5;
762+
--product-bg-to: #d1fae5;
763+
--product-text: #065f46;
764+
--product-border: #10b981;
765+
--product-shadow: rgba(16, 185, 129, 0.1);
766+
--product-shadow-hover: rgba(16, 185, 129, 0.25);
767+
}
768+
.dark .welcome-linux {
769+
--product-bg-from: #1a2e25;
770+
--product-bg-to: #1a3a2d;
771+
--product-text: #6ee7b7;
772+
--product-shadow: rgba(16, 185, 129, 0.15);
773+
--product-shadow-hover: rgba(16, 185, 129, 0.35);
774+
}
775+
776+
/* Cloud Speaker — amber */
777+
.welcome-cloudspeaker {
778+
--product-bg-from: #fffbeb;
779+
--product-bg-to: #fef3c7;
780+
--product-text: #92400e;
781+
--product-border: #f59e0b;
782+
--product-shadow: rgba(245, 158, 11, 0.1);
783+
--product-shadow-hover: rgba(245, 158, 11, 0.25);
784+
}
785+
.dark .welcome-cloudspeaker {
786+
--product-bg-from: #2e2810;
787+
--product-bg-to: #3a3010;
788+
--product-text: #fcd34d;
789+
--product-shadow: rgba(245, 158, 11, 0.15);
790+
--product-shadow-hover: rgba(245, 158, 11, 0.35);
791+
}

0 commit comments

Comments
 (0)