mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-06 16:31:12 +08:00
Refactor and optimize various components and files
- Removed deprecated `ccw-contentPattern-optimization-summary.md` and related files. - Updated `A2UIPopupCard.tsx` to clarify comments on interaction handling. - Enhanced `QueueListColumn.tsx` and `QueuePanel.tsx` to handle potential undefined values for `config`. - Added `useEffect` in `QueuePanel.tsx` to load scheduler state on mount. - Improved `SchedulerPanel.tsx` to handle potential undefined values for `sessionPool`. - Introduced auto-initialization logic in `queueSchedulerStore.ts` to prevent multiple initialization calls. - Updated `A2UIWebSocketHandler.ts` to refine selection handling logic. - Enhanced `hooks-routes.ts` to support multi-question surfaces. - Added submit and cancel buttons in `ask-question.ts` for better user interaction. - Deleted `codex_prompt.md` and `contentPattern-library-options.md` as part of cleanup. - Removed `status-reference.md` to streamline documentation.
This commit is contained in:
@@ -329,11 +329,11 @@ function SinglePagePopup({ surface, onClose }: A2UIPopupCardProps) {
|
||||
'data-[state=open]:duration-300 data-[state=closed]:duration-200'
|
||||
)}
|
||||
onInteractOutside={(e) => {
|
||||
// Prevent closing when clicking outside
|
||||
// Prevent closing when clicking outside - only cancel button can close
|
||||
e.preventDefault();
|
||||
}}
|
||||
onEscapeKeyDown={(e) => {
|
||||
// Prevent closing with ESC key
|
||||
// Prevent closing with ESC key - only cancel button can close
|
||||
e.preventDefault();
|
||||
}}
|
||||
>
|
||||
@@ -574,8 +574,14 @@ function MultiPagePopup({ surface, onClose }: A2UIPopupCardProps) {
|
||||
'data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95',
|
||||
'data-[state=open]:duration-300 data-[state=closed]:duration-200'
|
||||
)}
|
||||
onInteractOutside={(e) => e.preventDefault()}
|
||||
onEscapeKeyDown={(e) => e.preventDefault()}
|
||||
onInteractOutside={(e) => {
|
||||
// Prevent closing when clicking outside - only cancel button can close
|
||||
e.preventDefault();
|
||||
}}
|
||||
onEscapeKeyDown={(e) => {
|
||||
// Prevent closing with ESC key - only cancel button can close
|
||||
e.preventDefault();
|
||||
}}
|
||||
>
|
||||
{/* Header with current page title */}
|
||||
<DialogHeader className="space-y-2 pb-4">
|
||||
|
||||
@@ -199,7 +199,7 @@ function SchedulerBar() {
|
||||
{/* Progress + Concurrency */}
|
||||
{isActive && (
|
||||
<span className="text-[10px] text-muted-foreground">
|
||||
{progress}% | {concurrency}/{config.maxConcurrentSessions}
|
||||
{progress}% | {concurrency}/{config?.maxConcurrentSessions ?? 2}
|
||||
</span>
|
||||
)}
|
||||
|
||||
@@ -285,6 +285,9 @@ export function QueueListColumn() {
|
||||
const associationChain = useIssueQueueIntegrationStore(selectAssociationChain);
|
||||
const buildAssociationChain = useIssueQueueIntegrationStore((s) => s.buildAssociationChain);
|
||||
|
||||
// NOTE: loadInitialState is called from a parent component or app initialization
|
||||
// to avoid infinite loop issues with Zustand selectors
|
||||
|
||||
const sortedItems = useMemo(
|
||||
() => [...items].sort((a, b) => a.execution_order - b.execution_order),
|
||||
[items]
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// Integrates with issueQueueIntegrationStore for association chain.
|
||||
// Note: Scheduler controls are in the standalone SchedulerPanel.
|
||||
|
||||
import { useState, useMemo, useCallback, memo } from 'react';
|
||||
import { useState, useMemo, useCallback, memo, useEffect } from 'react';
|
||||
import { useIntl } from 'react-intl';
|
||||
import {
|
||||
ListChecks,
|
||||
@@ -193,6 +193,12 @@ function QueueTabContent(_props: { embedded?: boolean }) {
|
||||
// Scheduler store data
|
||||
const schedulerItems = useQueueSchedulerStore(selectQueueItems);
|
||||
const schedulerStatus = useQueueSchedulerStore(selectQueueSchedulerStatus);
|
||||
const loadInitialState = useQueueSchedulerStore((s) => s.loadInitialState);
|
||||
|
||||
// Load scheduler state on mount
|
||||
useEffect(() => {
|
||||
loadInitialState();
|
||||
}, [loadInitialState]);
|
||||
|
||||
// Legacy API data (fallback)
|
||||
const queueQuery = useIssueQueue();
|
||||
|
||||
@@ -82,7 +82,7 @@ export function SchedulerPanel() {
|
||||
[updateConfig]
|
||||
);
|
||||
|
||||
const sessionEntries = Object.entries(sessionPool);
|
||||
const sessionEntries = Object.entries(sessionPool ?? {});
|
||||
|
||||
return (
|
||||
<div className="flex flex-col h-full">
|
||||
@@ -102,7 +102,7 @@ export function SchedulerPanel() {
|
||||
})}
|
||||
</span>
|
||||
<span className="text-xs text-muted-foreground ml-auto tabular-nums">
|
||||
{concurrency}/{config.maxConcurrentSessions}
|
||||
{concurrency}/{config?.maxConcurrentSessions ?? 2}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -188,7 +188,7 @@ export function SchedulerPanel() {
|
||||
type="number"
|
||||
min={1}
|
||||
max={10}
|
||||
value={config.maxConcurrentSessions}
|
||||
value={config?.maxConcurrentSessions ?? 2}
|
||||
onChange={handleConcurrencyChange}
|
||||
className="w-14 h-6 text-xs text-center rounded border border-border bg-background px-1"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user