Skip to content

Commit 8665ea7

Browse files
author
catlog22
committed
feat: update A2UIButton and translations for navigation; enhance session detail fetching and task handling
1 parent b23e822 commit 8665ea7

7 files changed

Lines changed: 21 additions & 10 deletions

File tree

ccw/frontend/src/components/layout/A2UIButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ export function A2UIButton({ className, compact = false }: A2UIButtonProps) {
3838
'gap-2 bg-primary text-primary-foreground hover:bg-primary/90',
3939
className
4040
)}
41-
title={formatMessage({ id: 'toolbar.a2ui.quickAction', defaultMessage: 'A2UI Quick Action' })}
41+
title={formatMessage({ id: 'navigation.toolbar.a2ui.quickAction', defaultMessage: 'A2UI Quick Action' })}
4242
>
4343
<MessageSquare className="h-4 w-4" />
4444
{!compact && (
4545
<span className="hidden sm:inline">
46-
{formatMessage({ id: 'toolbar.a2ui.button', defaultMessage: 'A2UI' })}
46+
{formatMessage({ id: 'navigation.toolbar.a2ui.button', defaultMessage: 'A2UI' })}
4747
</span>
4848
)}
4949
</Button>

ccw/frontend/src/lib/api.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,8 +1759,15 @@ export async function fetchSessionDetail(sessionId: string, projectPath?: string
17591759
// Backend returns raw context-package.json content, frontend expects it nested under 'context' field
17601760
const transformedContext = detailData.context ? { context: detailData.context } : undefined;
17611761

1762+
// Step 5: Merge tasks from detailData into session object
1763+
// Backend returns tasks at root level, frontend expects them on session object
1764+
const sessionWithTasks = {
1765+
...session,
1766+
tasks: detailData.tasks || session.tasks || [],
1767+
};
1768+
17621769
return {
1763-
session,
1770+
session: sessionWithTasks,
17641771
context: transformedContext,
17651772
summary: finalSummary,
17661773
summaries: detailData.summaries,

ccw/frontend/src/locales/en/common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@
182182
"labels": {
183183
"progress": "Progress"
184184
},
185+
"fullscreen": "Fullscreen",
186+
"exitFullscreen": "Exit Fullscreen",
185187
"dialog": {
186188
"createSession": "Create New Session",
187189
"createSessionDesc": "Create a new workflow session to track your development tasks.",

ccw/frontend/src/locales/zh/common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@
182182
"labels": {
183183
"progress": "进度"
184184
},
185+
"fullscreen": "全屏",
186+
"exitFullscreen": "退出全屏",
185187
"dialog": {
186188
"createSession": "创建新会话",
187189
"createSessionDesc": "创建新的工作流会话以跟踪您的开发任务。",

ccw/frontend/src/pages/session-detail/TaskListTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export function TaskListTab({ session, onTaskClick }: TaskListTabProps) {
221221

222222
return (
223223
<Card
224-
key={task.task_id || index}
224+
key={`${task.task_id}-${index}`}
225225
className={`hover:shadow-sm transition-shadow ${onTaskClick ? 'cursor-pointer hover:shadow-md' : ''}`}
226226
onClick={() => onTaskClick?.(task as TaskData)}
227227
>

ccw/src/config/remote-notification-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function hasEnabledPlatform(config: RemoteNotificationConfig): boolean {
113113

114114
const { discord, telegram, webhook } = config.platforms;
115115

116-
return (
116+
return Boolean(
117117
(discord?.enabled && !!discord.webhookUrl) ||
118118
(telegram?.enabled && !!telegram.botToken && !!telegram.chatId) ||
119119
(webhook?.enabled && !!webhook.url)

ccw/src/types/util.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ export type ReturnType<T> = T extends (...args: unknown[]) => infer R ? R : neve
4040
* Deep merge utility for configuration updates
4141
* Recursively merges source into target, preserving nested objects
4242
*/
43-
export function deepMerge<T extends Record<string, unknown>>(
43+
export function deepMerge<T extends object>(
4444
target: T,
4545
source: DeepPartial<T>
4646
): T {
4747
const result = { ...target } as T;
4848

4949
for (const key in source) {
5050
if (Object.prototype.hasOwnProperty.call(source, key)) {
51-
const sourceValue = source[key];
52-
const targetValue = target[key];
51+
const sourceValue = source[key as keyof typeof source];
52+
const targetValue = target[key as unknown as keyof T];
5353

5454
if (
5555
sourceValue !== undefined &&
@@ -62,8 +62,8 @@ export function deepMerge<T extends Record<string, unknown>>(
6262
!Array.isArray(targetValue)
6363
) {
6464
(result as Record<string, unknown>)[key] = deepMerge(
65-
targetValue as Record<string, unknown>,
66-
sourceValue as DeepPartial<Record<string, unknown>>
65+
targetValue as object,
66+
sourceValue as DeepPartial<object>
6767
);
6868
} else if (sourceValue !== undefined) {
6969
(result as Record<string, unknown>)[key] = sourceValue;

0 commit comments

Comments
 (0)