mirror of
https://github.com/AIPexStudio/AIPex.git
synced 2026-05-13 18:51:35 +00:00
chore: update schema version and improve component accessibility
- Updated the Biome schema version from 2.3.13 to 2.3.14 for compatibility. - Enhanced the PromptInput component by changing the skill label from a span to a button for better accessibility and user interaction. - Corrected spelling of "AIPex" to "AIpex" in multiple test cases for consistency. - Added a comment in the SettingsPage component to clarify the purpose of the initialSkill prop for future use. - Improved type checking in the app-root component to ensure timestamp is a number before comparison.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"root": true,
|
||||
"$schema": "https://biomejs.dev/schemas/2.3.13/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.3.14/schema.json",
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "space",
|
||||
|
||||
@@ -490,13 +490,14 @@ export function PromptInputSkillTag({
|
||||
<span className="text-primary">
|
||||
<PuzzleIcon className="size-4" />
|
||||
</span>
|
||||
<span
|
||||
className="max-w-[200px] truncate cursor-pointer hover:underline text-primary"
|
||||
<button
|
||||
type="button"
|
||||
className="max-w-[200px] truncate cursor-pointer hover:underline text-primary bg-transparent border-none p-0 font-inherit text-left"
|
||||
onClick={handleLabelClick}
|
||||
title="Click to open skill settings"
|
||||
>
|
||||
{data.name}
|
||||
</span>
|
||||
</button>
|
||||
<Button
|
||||
aria-label="Remove skill"
|
||||
className="h-4 w-4 p-0 opacity-0 group-hover:opacity-100 transition-opacity"
|
||||
|
||||
@@ -104,7 +104,7 @@ describe("Chatbot Component", () => {
|
||||
it("should render welcome screen when no messages", async () => {
|
||||
await renderWithAct(<Chatbot agent={mockAgent} />);
|
||||
|
||||
expect(screen.getByText("Welcome to AIPex")).toBeInTheDocument();
|
||||
expect(screen.getByText("Welcome to AIpex")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -233,14 +233,14 @@ describe("Chatbot Component", () => {
|
||||
fireEvent.click(newChatButton);
|
||||
|
||||
// Verify the chat was reset (no messages)
|
||||
expect(screen.getByText("Welcome to AIPex")).toBeInTheDocument();
|
||||
expect(screen.getByText("Welcome to AIpex")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("should send suggestion text when welcome suggestion is clicked", async () => {
|
||||
await renderWithAct(<Chatbot agent={mockAgent} />);
|
||||
|
||||
const suggestion = screen.getByText(
|
||||
"Help me organize my browser tabs by topic",
|
||||
"Please organize my open tabs by topic and purpose",
|
||||
);
|
||||
fireEvent.click(suggestion);
|
||||
|
||||
@@ -408,7 +408,7 @@ describe("Chatbot State Management", () => {
|
||||
await renderWithAct(<Chatbot agent={mockAgent} />);
|
||||
|
||||
// Initially should show welcome screen
|
||||
expect(screen.getByText("Welcome to AIPex")).toBeInTheDocument();
|
||||
expect(screen.getByText("Welcome to AIpex")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("should preserve state across re-renders", async () => {
|
||||
@@ -429,7 +429,7 @@ describe("Chatbot State Management", () => {
|
||||
});
|
||||
|
||||
// Should still show the same content
|
||||
expect(screen.getByText("Welcome to AIPex")).toBeInTheDocument();
|
||||
expect(screen.getByText("Welcome to AIpex")).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -223,8 +223,10 @@ export function SettingsPage({
|
||||
skillsContent,
|
||||
sttConfig,
|
||||
initialTab,
|
||||
initialSkill,
|
||||
initialSkill: _initialSkill,
|
||||
}: SettingsPageProps) {
|
||||
// initialSkill is reserved for future use (pre-select a skill when initialTab="skills")
|
||||
void _initialSkill;
|
||||
const { t, language, changeLanguage } = useTranslation();
|
||||
const { theme, changeTheme, effectiveTheme } = useTheme();
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ const DEFAULT_WEBSITE_URL = "https://www.claudechrome.com";
|
||||
*/
|
||||
function resolveWebsiteUrl(): string {
|
||||
// Try to read from import.meta.env (Vite) if available
|
||||
// biome-ignore lint/suspicious/noExplicitAny: import.meta.env may not exist in all environments
|
||||
const envUrl = (import.meta as any)?.env?.VITE_WEBSITE_URL;
|
||||
|
||||
if (!envUrl || typeof envUrl !== "string" || envUrl.trim() === "") {
|
||||
|
||||
@@ -59,7 +59,7 @@ function usePendingPrompt() {
|
||||
if (prompt && typeof prompt === "string") {
|
||||
const now = Date.now();
|
||||
// Only use prompts that are less than 5 seconds old
|
||||
if (timestamp && now - timestamp < 5000) {
|
||||
if (typeof timestamp === "number" && now - timestamp < 5000) {
|
||||
setPendingInput(prompt);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user