feat: update A2UIButton and translations for navigation; enhance session detail fetching and task handling

This commit is contained in:
catlog22
2026-02-17 10:39:13 +08:00
parent b23e822a35
commit 8665ea73a4
7 changed files with 21 additions and 10 deletions

View File

@@ -38,12 +38,12 @@ export function A2UIButton({ className, compact = false }: A2UIButtonProps) {
'gap-2 bg-primary text-primary-foreground hover:bg-primary/90',
className
)}
title={formatMessage({ id: 'toolbar.a2ui.quickAction', defaultMessage: 'A2UI Quick Action' })}
title={formatMessage({ id: 'navigation.toolbar.a2ui.quickAction', defaultMessage: 'A2UI Quick Action' })}
>
<MessageSquare className="h-4 w-4" />
{!compact && (
<span className="hidden sm:inline">
{formatMessage({ id: 'toolbar.a2ui.button', defaultMessage: 'A2UI' })}
{formatMessage({ id: 'navigation.toolbar.a2ui.button', defaultMessage: 'A2UI' })}
</span>
)}
</Button>

View File

@@ -1759,8 +1759,15 @@ export async function fetchSessionDetail(sessionId: string, projectPath?: string
// Backend returns raw context-package.json content, frontend expects it nested under 'context' field
const transformedContext = detailData.context ? { context: detailData.context } : undefined;
// Step 5: Merge tasks from detailData into session object
// Backend returns tasks at root level, frontend expects them on session object
const sessionWithTasks = {
...session,
tasks: detailData.tasks || session.tasks || [],
};
return {
session,
session: sessionWithTasks,
context: transformedContext,
summary: finalSummary,
summaries: detailData.summaries,

View File

@@ -182,6 +182,8 @@
"labels": {
"progress": "Progress"
},
"fullscreen": "Fullscreen",
"exitFullscreen": "Exit Fullscreen",
"dialog": {
"createSession": "Create New Session",
"createSessionDesc": "Create a new workflow session to track your development tasks.",

View File

@@ -182,6 +182,8 @@
"labels": {
"progress": "进度"
},
"fullscreen": "全屏",
"exitFullscreen": "退出全屏",
"dialog": {
"createSession": "创建新会话",
"createSessionDesc": "创建新的工作流会话以跟踪您的开发任务。",

View File

@@ -221,7 +221,7 @@ export function TaskListTab({ session, onTaskClick }: TaskListTabProps) {
return (
<Card
key={task.task_id || index}
key={`${task.task_id}-${index}`}
className={`hover:shadow-sm transition-shadow ${onTaskClick ? 'cursor-pointer hover:shadow-md' : ''}`}
onClick={() => onTaskClick?.(task as TaskData)}
>

View File

@@ -113,7 +113,7 @@ export function hasEnabledPlatform(config: RemoteNotificationConfig): boolean {
const { discord, telegram, webhook } = config.platforms;
return (
return Boolean(
(discord?.enabled && !!discord.webhookUrl) ||
(telegram?.enabled && !!telegram.botToken && !!telegram.chatId) ||
(webhook?.enabled && !!webhook.url)

View File

@@ -40,7 +40,7 @@ export type ReturnType<T> = T extends (...args: unknown[]) => infer R ? R : neve
* Deep merge utility for configuration updates
* Recursively merges source into target, preserving nested objects
*/
export function deepMerge<T extends Record<string, unknown>>(
export function deepMerge<T extends object>(
target: T,
source: DeepPartial<T>
): T {
@@ -48,8 +48,8 @@ export function deepMerge<T extends Record<string, unknown>>(
for (const key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
const sourceValue = source[key];
const targetValue = target[key];
const sourceValue = source[key as keyof typeof source];
const targetValue = target[key as unknown as keyof T];
if (
sourceValue !== undefined &&
@@ -62,8 +62,8 @@ export function deepMerge<T extends Record<string, unknown>>(
!Array.isArray(targetValue)
) {
(result as Record<string, unknown>)[key] = deepMerge(
targetValue as Record<string, unknown>,
sourceValue as DeepPartial<Record<string, unknown>>
targetValue as object,
sourceValue as DeepPartial<object>
);
} else if (sourceValue !== undefined) {
(result as Record<string, unknown>)[key] = sourceValue;