Skip to content
Merged
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
Binary file modified src/web-ui/public/panda_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/web-ui/public/panda_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/web-ui/public/panda_full_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/web-ui/public/panda_full_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
461 changes: 301 additions & 160 deletions src/web-ui/src/app/components/NavPanel/MainNav.tsx

Large diffs are not rendered by default.

384 changes: 353 additions & 31 deletions src/web-ui/src/app/components/NavPanel/NavPanel.scss

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,20 @@ const WorkspaceItem: React.FC<WorkspaceItemProps> = ({
const handleCreateSession = useCallback(async () => {
setMenuOpen(false);
try {
await handleActivate();
await flowChatManager.createChatSession(
{},
{
workspacePath: workspace.rootPath,
},
workspace.workspaceKind === WorkspaceKind.Assistant ? 'Claw' : undefined
);
await setActiveWorkspace(workspace.id);
} catch (error) {
notificationService.error(
error instanceof Error ? error.message : t('nav.workspaces.createSessionFailed'),
{ duration: 4000 }
);
}
}, [handleActivate, t, workspace.workspaceKind]);
}, [setActiveWorkspace, t, workspace.id, workspace.rootPath, workspace.workspaceKind]);

const handleCreateWorktree = useCallback(async (result: BranchSelectResult) => {
try {
Expand Down
45 changes: 23 additions & 22 deletions src/web-ui/src/flow_chat/components/ChatInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1631,28 +1631,6 @@ export const ChatInput: React.FC<ChatInputProps> = ({
</IconButton>
<div className="bitfun-chat-input__actions">
<div className="bitfun-chat-input__actions-left">
<ModelSelector
currentMode={modeState.current}
sessionId={effectiveTargetSessionId || undefined}
/>

{tokenUsage.current > 0 && (
<TokenUsageIndicator
currentTokens={tokenUsage.current}
maxTokens={tokenUsage.max}
/>
)}
</div>
<div className="bitfun-chat-input__actions-right">
{isCollapsedProcessing && (
<>
<span className="bitfun-chat-input__capsule-divider" />
<span className="bitfun-chat-input__cancel-shortcut">
<span className="bitfun-chat-input__space-key">Esc</span>
<span>{t('input.cancelShortcut')}</span>
</span>
</>
)}
{canSwitchModes && (
<div
className="bitfun-chat-input__mode-selector"
Expand Down Expand Up @@ -1706,6 +1684,29 @@ export const ChatInput: React.FC<ChatInputProps> = ({
})()}
</div>
)}

<ModelSelector
currentMode={modeState.current}
sessionId={effectiveTargetSessionId || undefined}
/>

{tokenUsage.current > 0 && (
<TokenUsageIndicator
currentTokens={tokenUsage.current}
maxTokens={tokenUsage.max}
/>
)}
</div>
<div className="bitfun-chat-input__actions-right">
{isCollapsedProcessing && (
<>
<span className="bitfun-chat-input__capsule-divider" />
<span className="bitfun-chat-input__cancel-shortcut">
<span className="bitfun-chat-input__space-key">Esc</span>
<span>{t('input.cancelShortcut')}</span>
</span>
</>
)}

<IconButton
className="bitfun-chat-input__action-button"
Expand Down
28 changes: 11 additions & 17 deletions src/web-ui/src/flow_chat/components/WelcomePanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,42 +52,36 @@
position: relative;
flex-shrink: 0;
width: 88px;
pointer-events: none;
user-select: none;
image-rendering: pixelated;
cursor: default;
}

.welcome-panel__panda-frame {
display: block;
width: 100%;
height: auto;
image-rendering: pixelated;
transition: opacity 0.12s steps(1, end);
}

.welcome-panel__panda-frame--1 {
opacity: 1;
}

.welcome-panel__panda-frame--2 {
position: absolute;
top: 0;
left: 0;
animation: wp-panda-blink 1.2s steps(1, end) infinite;
}

.welcome-panel__panda-frame--1 {
animation: wp-panda-blink-inv 1.2s steps(1, end) infinite;
opacity: 0;
}

@keyframes wp-panda-blink {
0%, 49% { opacity: 0; }
50%, 100% { opacity: 1; }
.welcome-panel__panda:hover .welcome-panel__panda-frame--1 {
opacity: 0;
}

@keyframes wp-panda-blink-inv {
0%, 49% { opacity: 1; }
50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
.welcome-panel__panda-frame--1 { animation: none; opacity: 1; }
.welcome-panel__panda-frame--2 { animation: none; opacity: 0; }
.welcome-panel__panda:hover .welcome-panel__panda-frame--2 {
opacity: 1;
}

.welcome-panel__heading {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,22 @@ const normalizeSessionDisplayMode = (
return 'code';
};

const resolveSessionWorkspacePath = (context: FlowChatContext): string | null => {
const resolveSessionWorkspacePath = (
context: FlowChatContext,
config?: SessionConfig
): string | null => {
const explicitWorkspacePath = config?.workspacePath?.trim();
if (explicitWorkspacePath) {
return explicitWorkspacePath;
}
return context.currentWorkspacePath || null;
};

const resolveSessionWorkspace = (context: FlowChatContext): WorkspaceInfo | null => {
const workspacePath = resolveSessionWorkspacePath(context);
const resolveSessionWorkspace = (
context: FlowChatContext,
config?: SessionConfig
): WorkspaceInfo | null => {
const workspacePath = resolveSessionWorkspacePath(context, config);
if (!workspacePath) return null;

const state = workspaceManager.getState();
Expand Down Expand Up @@ -110,8 +120,8 @@ export async function createChatSession(
mode?: string
): Promise<string> {
try {
const workspacePath = resolveSessionWorkspacePath(context);
const workspace = resolveSessionWorkspace(context);
const workspacePath = resolveSessionWorkspacePath(context, config);
const workspace = resolveSessionWorkspace(context, config);

if (!workspacePath) {
throw new Error('Workspace path is required to create a session');
Expand Down
1 change: 1 addition & 0 deletions src/web-ui/src/flow_chat/types/flow-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export interface SessionConfig {
modelName?: string;
agentType?: string;
context?: Record<string, string>;
workspacePath?: string;
}

export interface QueuedMessage {
Expand Down
11 changes: 11 additions & 0 deletions src/web-ui/src/locales/en-US/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@
"myAgent": "My Agent",
"shell": "Shell"
},
"displayModes": {
"pro": "Pro Mode",
"assistant": "Assistant Mode",
"switchToPro": "Click to switch to Pro mode",
"switchToAssistant": "Click to switch to Assistant mode",
"proDesc": "Best for focused, one-shot tasks with a clear goal.",
"assistantDesc": "Best for ongoing work with context and personal preferences."
},
"myAgent": {
"title": "My Agent",
"categories": {
Expand Down Expand Up @@ -214,6 +222,9 @@
"builtinTools": "Built-in Tools",
"mcpServices": "MCP Services"
},
"actions": {
"openMyAgent": "My Agent"
},
"moreOptions": "More options",
"notifications": "Notifications"
},
Expand Down
11 changes: 11 additions & 0 deletions src/web-ui/src/locales/zh-CN/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@
"myAgent": "我的智能体",
"shell": "Shell"
},
"displayModes": {
"pro": "专业模式",
"assistant": "助理模式",
"switchToPro": "点击切换到专业模式",
"switchToAssistant": "点击切换到助理模式",
"proDesc": "适合目标明确、一次完成的即时任务。",
"assistantDesc": "适合持续推进、需要延续上下文和个人偏好的任务。"
},
"myAgent": {
"title": "我的智能体",
"categories": {
Expand Down Expand Up @@ -214,6 +222,9 @@
"builtinTools": "内置工具",
"mcpServices": "MCP 服务"
},
"actions": {
"openMyAgent": "我的智能体"
},
"moreOptions": "更多选项",
"notifications": "通知"
},
Expand Down
Loading