Skip to content

Commit 61341be

Browse files
committed
refactor(frontend): unify workspace UI with shared component kit
1 parent 5ddb678 commit 61341be

56 files changed

Lines changed: 6322 additions & 1664 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

frontend/AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ Tool-calling AI messages can contain user-visible text as well as `tool_calls`.
115115
- **Imports**: Enforced ordering (builtin → external → internal → parent → sibling), alphabetized, newlines between groups. Use inline type imports: `import { type Foo }`.
116116
- **Unused variables**: Prefix with `_`.
117117
- **Class names**: Use `cn()` from `@/lib/utils` for conditional Tailwind classes.
118+
- **Workspace kit** (`src/components/component/`): full map in the barrel comment at top of `index.ts`. Pages compose kit pieces; extend via `className`, `DialogSlotField`, or domain wrappers under `workspace/<feature>/` — do not copy layout/markup per page.
118119
- **Path alias**: `@/*` maps to `src/*`.
119120
- **Components**: `ui/` and `ai-elements/` are generated from registries (Shadcn, MagicUI, React Bits, Vercel AI SDK) — don't manually edit these.
120121

frontend/src/app/layout.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { type Metadata } from "next";
77
import { ThemeProvider } from "@/components/theme-provider";
88
import { I18nProvider } from "@/core/i18n/context";
99
import { detectLocaleServer } from "@/core/i18n/server";
10+
import { detectAppearanceAccentServer } from "@/core/settings/accent-server";
11+
import { DEFAULT_APPEARANCE_ACCENT } from "@/core/settings/local";
1012

1113
export const metadata: Metadata = {
1214
title: "DeerFlow",
@@ -17,8 +19,16 @@ export default async function RootLayout({
1719
children,
1820
}: Readonly<{ children: React.ReactNode }>) {
1921
const locale = await detectLocaleServer();
22+
const accent = await detectAppearanceAccentServer();
2023
return (
21-
<html lang={locale} suppressContentEditableWarning suppressHydrationWarning>
24+
<html
25+
lang={locale}
26+
{...(accent !== DEFAULT_APPEARANCE_ACCENT
27+
? { "data-accent": accent }
28+
: {})}
29+
suppressContentEditableWarning
30+
suppressHydrationWarning
31+
>
2232
<body>
2333
<ThemeProvider attribute="class" enableSystem disableTransitionOnChange>
2434
<I18nProvider initialLocale={locale}>{children}</I18nProvider>

frontend/src/app/workspace/agents/[agent_name]/chats/[thread_id]/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useParams, useRouter } from "next/navigation";
55
import { useCallback, useEffect, useMemo, useState } from "react";
66

77
import type { PromptInputMessage } from "@/components/ai-elements/prompt-input";
8+
import { Tooltip } from "@/components/component/tooltip";
89
import { Button } from "@/components/ui/button";
910
import { SidebarTrigger } from "@/components/ui/sidebar";
1011
import { AgentWelcome } from "@/components/workspace/agent-welcome";
@@ -28,7 +29,6 @@ import {
2829
import { ThreadTitle } from "@/components/workspace/thread-title";
2930
import { TodoList } from "@/components/workspace/todo-list";
3031
import { TokenUsageIndicator } from "@/components/workspace/token-usage-indicator";
31-
import { Tooltip } from "@/components/workspace/tooltip";
3232
import { useActiveGoal } from "@/components/workspace/use-active-goal";
3333
import { useAgent } from "@/core/agents";
3434
import { useI18n } from "@/core/i18n/hooks";
@@ -365,7 +365,6 @@ export default function AgentChatPage() {
365365
threadId={threadId}
366366
draftThreadId={isNewThread ? "new" : threadId}
367367
draftAgentName={agent_name}
368-
defaultModelName={agent?.model}
369368
autoFocus={isWelcomeMode}
370369
status={
371370
thread.error

frontend/src/app/workspace/agents/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import type { ReactNode } from "react";
44

5-
import { AgentsFeatureDisabled } from "@/components/workspace/agents/agents-feature-disabled";
5+
import { AgentsFeatureDisabled } from "@/components/workspace/agents";
66
import { useAgentsApiEnabled } from "@/core/agents";
77
import { useI18n } from "@/core/i18n/hooks";
88

0 commit comments

Comments
 (0)