Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions frontend/src/components/workspace/copy-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ export function CopyButton({
}) {
const { t } = useI18n();
const [copied, setCopied] = useState(false);
const handleCopy = useCallback(() => {
void navigator.clipboard.writeText(clipboardData);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
const handleCopy = useCallback(async () => {
try {
await navigator.clipboard.writeText(clipboardData);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
} catch {
// Clipboard write failed (e.g. permissions denied), do not show copied state
}
}, [clipboardData]);
return (
<Tooltip content={t.clipboard.copyToClipboard}>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/workspace/messages/skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function MessageListSkeleton() {
return (
<div className="flex w-full max-w-(--container-width-md) flex-col gap-12 p-8 pt-16">
<div
role="human-message"
data-role="human-message"
className="flex w-[50%] flex-col items-end gap-2 self-end"
>
<SkeletonBar
Expand All @@ -40,7 +40,7 @@ export function MessageListSkeleton() {
style={{ animationDelay: `${index++ * STAGGER_MS}ms` }}
/>
</div>
<div role="assistant-message" className="flex flex-col gap-2">
<div data-role="assistant-message" className="flex flex-col gap-2">
<SkeletonBar
className="h-6 w-full"
style={{ animationDelay: `${index++ * STAGGER_MS}ms` }}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/workspace/todo-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function TodoList({
return (
<div
className={cn(
"flex h-fit w-full origin-bottom translate-y-4 flex-col overflow-hidden rounded-t-xl border border-b-0 bg-white backdrop-blur-sm transition-all duration-200 ease-out",
"flex h-fit w-full origin-bottom translate-y-4 flex-col overflow-hidden rounded-t-xl border border-b-0 bg-background backdrop-blur-sm transition-all duration-200 ease-out",
hidden ? "pointer-events-none translate-y-8 opacity-0" : "",
className,
)}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/core/api/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function injectCsrfHeader(_url: URL, init: RequestInit): RequestInit {

function createCompatibleClient(isMock?: boolean): LangGraphClient {
const apiUrl = getLangGraphBaseURL(isMock);
console.log(`Creating API client with base URL: ${apiUrl}`);
const client = new LangGraphClient({
apiUrl,
onRequest: injectCsrfHeader,
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/core/artifacts/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export async function loadArtifactContent({
}
const url = urlOfArtifact({ filepath: enhancedFilepath, threadId, isMock });
const response = await fetch(url);
if (!response.ok) {
throw new Error(`Failed to load artifact: ${response.status} ${response.statusText}`);
}
const text = await response.text();
return { content: text, url };
}
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/core/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ export function getBackendBaseURL() {
}

export function getLangGraphBaseURL(isMock?: boolean) {
console.log(
"env.NEXT_PUBLIC_LANGGRAPH_BASE_URL",
env.NEXT_PUBLIC_LANGGRAPH_BASE_URL,
);
if (env.NEXT_PUBLIC_LANGGRAPH_BASE_URL) {
return new URL(
env.NEXT_PUBLIC_LANGGRAPH_BASE_URL,
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/core/threads/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,10 @@ export function useRenameThread() {
queryKey: ["threads", "search"],
exact: false,
},
(oldData: Array<AgentThread>) => {
(oldData: Array<AgentThread> | undefined) => {
if (oldData == null) {
return oldData;
}
return oldData.map((t) => {
if (t.thread_id === threadId) {
return {
Expand Down
Loading