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:
ropzislaw
2026-02-14 17:36:09 +08:00
parent a18f9ce79c
commit ccb50fccc1
6 changed files with 14 additions and 12 deletions

View File

@@ -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",

View File

@@ -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"

View File

@@ -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();
});
});

View File

@@ -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();

View File

@@ -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() === "") {

View File

@@ -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);
}
}