From 0639d0d9eaf7d953b0365b4795f2b4d2959edcb8 Mon Sep 17 00:00:00 2001
From: Yash094 <67926590+Yash094@users.noreply.github.com>
Date: Fri, 30 May 2025 07:58:58 +0000
Subject: [PATCH] siwa updates and new article (#7197)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
## PR-Codex overview
This PR focuses on enhancing the chat functionality within the application by adding a feedback system, updating icons, and improving the knowledge base content related to ERC20 token transfers.
### Detailed summary
- Added a new knowledge base entry for "Transfer Amount Exceeds Allowance".
- Updated `Header` and `Hero` components to replace `BotIcon` with `MessageCircleIcon`.
- Introduced `sendFeedback` function to handle user feedback on chat messages.
- Modified `Chat` component to include feedback buttons (thumbs up/down) for messages.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
## Summary by CodeRabbit
- **New Features**
- Introduced feedback buttons (thumbs up/down) for assistant messages in the AI chat, allowing users to rate responses.
- Added a new "Ask AI" button on the main page, providing quick access to the chat assistant.
- Added a new knowledge base article explaining the "ERC20: transfer amount exceeds allowance" error and its resolution.
- **Improvements**
- Enhanced chat message payloads with source identifiers for better context.
- Updated sidebar navigation with a new troubleshooting entry for ERC20 transfer allowance issues.
- Updated chat and header icons to use a consistent message circle icon for AI-related features.
---
.../CustomChat/CustomChatContent.tsx | 1 +
apps/portal/src/app/Header.tsx | 7 +--
.../portal/src/app/knowledge-base/sidebar.tsx | 4 ++
.../erc20-transfer-allowance/page.mdx | 15 +++++
apps/portal/src/app/page.tsx | 9 +++
apps/portal/src/components/AI/api.ts | 29 +++++++++
apps/portal/src/components/AI/chat.tsx | 59 +++++++++++++++---
apps/portal/src/icons/siwa-icon.png | Bin 0 -> 1326 bytes
8 files changed, 112 insertions(+), 12 deletions(-)
create mode 100644 apps/portal/src/app/knowledge-base/troubleshoot/contracts/erc20-transfer-allowance/page.mdx
create mode 100644 apps/portal/src/icons/siwa-icon.png
diff --git a/apps/dashboard/src/app/nebula-app/(app)/components/CustomChat/CustomChatContent.tsx b/apps/dashboard/src/app/nebula-app/(app)/components/CustomChat/CustomChatContent.tsx
index 2547afc0db0..8fab0e3fd72 100644
--- a/apps/dashboard/src/app/nebula-app/(app)/components/CustomChat/CustomChatContent.tsx
+++ b/apps/dashboard/src/app/nebula-app/(app)/components/CustomChat/CustomChatContent.tsx
@@ -102,6 +102,7 @@ function CustomChatContentLoggedIn(props: {
message:
messageToSend.content.find((x) => x.type === "text")?.text ?? "",
conversationId: sessionId,
+ source: "dashboard-support",
};
const apiUrl = process.env.NEXT_PUBLIC_SIWA_URL;
const response = await fetch(`${apiUrl}/v1/chat`, {
diff --git a/apps/portal/src/app/Header.tsx b/apps/portal/src/app/Header.tsx
index 35f4b5f11ac..f4a2b0bf5d3 100644
--- a/apps/portal/src/app/Header.tsx
+++ b/apps/portal/src/app/Header.tsx
@@ -10,9 +10,9 @@ import {
} from "@/components/ui/dropdown-menu";
import clsx from "clsx";
import {
- BotIcon,
ChevronDownIcon,
MenuIcon,
+ MessageCircleIcon,
TableOfContentsIcon,
} from "lucide-react";
import Link from "next/link";
@@ -222,12 +222,11 @@ export function Header() {