Skip to content

Commit a63d04f

Browse files
committed
Misc fixes
1 parent 2f97e97 commit a63d04f

File tree

5 files changed

+20
-29
lines changed

5 files changed

+20
-29
lines changed

apps/docs/components/navbar/client-navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const LogoGithub = () => (
4949
);
5050

5151
export const ClientNavbar = ({ pages }: { pages: NavPageItem[] }) => (
52-
<div className="fixed top-0 right-0 left-0 z-40 flex items-center justify-between bg-background/80 backdrop-blur-sm py-2.5">
52+
<div className="fixed top-0 right-0 left-0 z-40 flex items-center justify-between bg-background/80 py-2.5 backdrop-blur-sm">
5353
<div className="flex select-none flex-row items-center">
5454
<div className="flex shrink-0 flex-row items-center gap-2">
5555
<HomeLinks />

packages/elements/__tests__/connection.test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { Connection } from "../src/connection";
55
describe("Connection", () => {
66
it("renders with basic props", () => {
77
// Mock console.error to suppress React SVG warnings from @xyflow/react
8-
const consoleError = vi.spyOn(console, "error").mockImplementation(() => {});
8+
const consoleError = vi
9+
.spyOn(console, "error")
10+
.mockImplementation(() => {});
911

1012
const props = {
1113
fromX: 0,

packages/elements/__tests__/prompt-input.test.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { render, screen, act } from "@testing-library/react";
1+
import { act, render, screen } from "@testing-library/react";
22
import userEvent from "@testing-library/user-event";
33
import { beforeEach, describe, expect, it, vi } from "vitest";
44
import {
@@ -1069,9 +1069,7 @@ describe("PromptInputSpeechButton", () => {
10691069
};
10701070

10711071
// @ts-expect-error - Mocking browser API
1072-
window.SpeechRecognition = function () {
1073-
return mockRecognition;
1074-
};
1072+
window.SpeechRecognition = () => mockRecognition;
10751073
});
10761074

10771075
afterEach(() => {
@@ -1187,7 +1185,7 @@ describe("PromptInputSpeechButton", () => {
11871185
// @ts-expect-error - Removing mock
11881186
delete window.SpeechRecognition;
11891187

1190-
const { container} = render(<PromptInputSpeechButton />);
1188+
const { container } = render(<PromptInputSpeechButton />);
11911189
const button = container.querySelector("button");
11921190

11931191
expect(button).toBeDisabled();

packages/elements/src/confirmation.tsx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ const ConfirmationContext = createContext<ConfirmationContextValue | null>(
2222

2323
const useConfirmation = () => {
2424
const context = useContext(ConfirmationContext);
25-
25+
2626
if (!context) {
2727
throw new Error("Confirmation components must be used within Confirmation");
2828
}
29-
29+
3030
return context;
3131
};
3232

@@ -41,11 +41,7 @@ export const Confirmation = ({
4141
state,
4242
...props
4343
}: ConfirmationProps) => {
44-
if (
45-
!approval ||
46-
state === "input-streaming" ||
47-
state === "input-available"
48-
) {
44+
if (!approval || state === "input-streaming" || state === "input-available") {
4945
return null;
5046
}
5147

@@ -62,16 +58,14 @@ export const ConfirmationTitle = ({
6258
className,
6359
...props
6460
}: ConfirmationTitleProps) => (
65-
<AlertDescription className={className} {...props} />
61+
<AlertDescription className={cn("inline", className)} {...props} />
6662
);
6763

6864
export type ConfirmationRequestProps = {
6965
children?: ReactNode;
7066
};
7167

72-
export const ConfirmationRequest = ({
73-
children,
74-
}: ConfirmationRequestProps) => {
68+
export const ConfirmationRequest = ({ children }: ConfirmationRequestProps) => {
7569
const { state } = useConfirmation();
7670

7771
// Only show when approval is requested
@@ -141,10 +135,7 @@ export const ConfirmationActions = ({
141135

142136
return (
143137
<div
144-
className={cn(
145-
"flex items-center justify-end gap-2 self-end",
146-
className
147-
)}
138+
className={cn("flex items-center justify-end gap-2 self-end", className)}
148139
{...props}
149140
/>
150141
);

packages/examples/src/tool.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
"use client";
22

3-
import {
4-
Tool,
5-
ToolContent,
6-
ToolHeader,
7-
ToolInput,
8-
ToolOutput,
9-
} from "@repo/elements/tool";
103
import {
114
Confirmation,
125
ConfirmationAccepted,
@@ -16,6 +9,13 @@ import {
169
ConfirmationRequest,
1710
ConfirmationTitle,
1811
} from "@repo/elements/confirmation";
12+
import {
13+
Tool,
14+
ToolContent,
15+
ToolHeader,
16+
ToolInput,
17+
ToolOutput,
18+
} from "@repo/elements/tool";
1919
import type { ToolUIPart } from "ai";
2020
import { CheckIcon, XIcon } from "lucide-react";
2121
import { nanoid } from "nanoid";

0 commit comments

Comments
 (0)