mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-28 09:23:08 +08:00
feat: update A2UIButton and translations for navigation; enhance session detail fetching and task handling
This commit is contained in:
@@ -38,12 +38,12 @@ export function A2UIButton({ className, compact = false }: A2UIButtonProps) {
|
|||||||
'gap-2 bg-primary text-primary-foreground hover:bg-primary/90',
|
'gap-2 bg-primary text-primary-foreground hover:bg-primary/90',
|
||||||
className
|
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" />
|
<MessageSquare className="h-4 w-4" />
|
||||||
{!compact && (
|
{!compact && (
|
||||||
<span className="hidden sm:inline">
|
<span className="hidden sm:inline">
|
||||||
{formatMessage({ id: 'toolbar.a2ui.button', defaultMessage: 'A2UI' })}
|
{formatMessage({ id: 'navigation.toolbar.a2ui.button', defaultMessage: 'A2UI' })}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -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
|
// Backend returns raw context-package.json content, frontend expects it nested under 'context' field
|
||||||
const transformedContext = detailData.context ? { context: detailData.context } : undefined;
|
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 {
|
return {
|
||||||
session,
|
session: sessionWithTasks,
|
||||||
context: transformedContext,
|
context: transformedContext,
|
||||||
summary: finalSummary,
|
summary: finalSummary,
|
||||||
summaries: detailData.summaries,
|
summaries: detailData.summaries,
|
||||||
|
|||||||
@@ -182,6 +182,8 @@
|
|||||||
"labels": {
|
"labels": {
|
||||||
"progress": "Progress"
|
"progress": "Progress"
|
||||||
},
|
},
|
||||||
|
"fullscreen": "Fullscreen",
|
||||||
|
"exitFullscreen": "Exit Fullscreen",
|
||||||
"dialog": {
|
"dialog": {
|
||||||
"createSession": "Create New Session",
|
"createSession": "Create New Session",
|
||||||
"createSessionDesc": "Create a new workflow session to track your development tasks.",
|
"createSessionDesc": "Create a new workflow session to track your development tasks.",
|
||||||
|
|||||||
@@ -182,6 +182,8 @@
|
|||||||
"labels": {
|
"labels": {
|
||||||
"progress": "进度"
|
"progress": "进度"
|
||||||
},
|
},
|
||||||
|
"fullscreen": "全屏",
|
||||||
|
"exitFullscreen": "退出全屏",
|
||||||
"dialog": {
|
"dialog": {
|
||||||
"createSession": "创建新会话",
|
"createSession": "创建新会话",
|
||||||
"createSessionDesc": "创建新的工作流会话以跟踪您的开发任务。",
|
"createSessionDesc": "创建新的工作流会话以跟踪您的开发任务。",
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ export function TaskListTab({ session, onTaskClick }: TaskListTabProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
key={task.task_id || index}
|
key={`${task.task_id}-${index}`}
|
||||||
className={`hover:shadow-sm transition-shadow ${onTaskClick ? 'cursor-pointer hover:shadow-md' : ''}`}
|
className={`hover:shadow-sm transition-shadow ${onTaskClick ? 'cursor-pointer hover:shadow-md' : ''}`}
|
||||||
onClick={() => onTaskClick?.(task as TaskData)}
|
onClick={() => onTaskClick?.(task as TaskData)}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ export function hasEnabledPlatform(config: RemoteNotificationConfig): boolean {
|
|||||||
|
|
||||||
const { discord, telegram, webhook } = config.platforms;
|
const { discord, telegram, webhook } = config.platforms;
|
||||||
|
|
||||||
return (
|
return Boolean(
|
||||||
(discord?.enabled && !!discord.webhookUrl) ||
|
(discord?.enabled && !!discord.webhookUrl) ||
|
||||||
(telegram?.enabled && !!telegram.botToken && !!telegram.chatId) ||
|
(telegram?.enabled && !!telegram.botToken && !!telegram.chatId) ||
|
||||||
(webhook?.enabled && !!webhook.url)
|
(webhook?.enabled && !!webhook.url)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export type ReturnType<T> = T extends (...args: unknown[]) => infer R ? R : neve
|
|||||||
* Deep merge utility for configuration updates
|
* Deep merge utility for configuration updates
|
||||||
* Recursively merges source into target, preserving nested objects
|
* Recursively merges source into target, preserving nested objects
|
||||||
*/
|
*/
|
||||||
export function deepMerge<T extends Record<string, unknown>>(
|
export function deepMerge<T extends object>(
|
||||||
target: T,
|
target: T,
|
||||||
source: DeepPartial<T>
|
source: DeepPartial<T>
|
||||||
): T {
|
): T {
|
||||||
@@ -48,8 +48,8 @@ export function deepMerge<T extends Record<string, unknown>>(
|
|||||||
|
|
||||||
for (const key in source) {
|
for (const key in source) {
|
||||||
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||||||
const sourceValue = source[key];
|
const sourceValue = source[key as keyof typeof source];
|
||||||
const targetValue = target[key];
|
const targetValue = target[key as unknown as keyof T];
|
||||||
|
|
||||||
if (
|
if (
|
||||||
sourceValue !== undefined &&
|
sourceValue !== undefined &&
|
||||||
@@ -62,8 +62,8 @@ export function deepMerge<T extends Record<string, unknown>>(
|
|||||||
!Array.isArray(targetValue)
|
!Array.isArray(targetValue)
|
||||||
) {
|
) {
|
||||||
(result as Record<string, unknown>)[key] = deepMerge(
|
(result as Record<string, unknown>)[key] = deepMerge(
|
||||||
targetValue as Record<string, unknown>,
|
targetValue as object,
|
||||||
sourceValue as DeepPartial<Record<string, unknown>>
|
sourceValue as DeepPartial<object>
|
||||||
);
|
);
|
||||||
} else if (sourceValue !== undefined) {
|
} else if (sourceValue !== undefined) {
|
||||||
(result as Record<string, unknown>)[key] = sourceValue;
|
(result as Record<string, unknown>)[key] = sourceValue;
|
||||||
|
|||||||
Reference in New Issue
Block a user