feat: implement task management store with IPC integration
- Added a new task store in `src-react/stores/task.ts` to manage tasks and their statuses. - Implemented functions for creating, executing, and retrying tasks, along with handling task progress and completion. - Introduced persistence for tasks using IPC. - Created utility functions for normalizing room types and building subtasks. - Added a new CSS file for global styles in `src-react/styles.css`. - Created runtime types in `src-react/types/runtime.ts` and exported them. - Updated the main entry points for Vue and React applications to support dynamic framework loading. - Refactored chat model interfaces and utility functions into `src/shared/chat-model.ts`. - Updated TypeScript configuration to include paths for React components and types. - Enhanced Vite configuration to support both Vue and React frameworks.
This commit is contained in:
71
src-react/components/layout/TitleBar.tsx
Normal file
71
src-react/components/layout/TitleBar.tsx
Normal file
@@ -0,0 +1,71 @@
|
||||
type TitleBarProps = {
|
||||
variant?: 'default' | 'light';
|
||||
};
|
||||
|
||||
export default function TitleBar({ variant = 'default' }: TitleBarProps) {
|
||||
const platform = (window as any).api?.platform ?? '';
|
||||
|
||||
if (platform === 'linux') return null;
|
||||
|
||||
const iconColorClass =
|
||||
variant === 'light' ? 'text-white' : 'text-[#525866] dark:text-gray-300';
|
||||
const borderColorClass =
|
||||
variant === 'light' ? 'border-b-white/30' : 'border-b-gray-300 dark:border-gray-700';
|
||||
|
||||
if (platform === 'darwin') {
|
||||
return (
|
||||
<div
|
||||
className={['drag-region h-10 shrink-0 border-b', borderColorClass].join(' ')}
|
||||
style={{ background: 'transparent' }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={['drag-region flex h-10 shrink-0 items-center justify-end border-b', borderColorClass].join(
|
||||
' ',
|
||||
)}
|
||||
style={{ background: 'transparent' }}
|
||||
>
|
||||
<div className="no-drag flex h-full">
|
||||
<button
|
||||
type="button"
|
||||
className={['flex h-full w-11 items-center justify-center hover:bg-[#999] hover:text-white transition-colors', iconColorClass].join(
|
||||
' ',
|
||||
)}
|
||||
title="Minimize"
|
||||
onClick={() => {
|
||||
(window as any).api?.windowMinimize?.();
|
||||
}}
|
||||
>
|
||||
<span className="text-base leading-none">−</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={['flex h-full w-11 items-center justify-center hover:bg-[#999] hover:text-white transition-colors', iconColorClass].join(
|
||||
' ',
|
||||
)}
|
||||
title="Maximize"
|
||||
onClick={() => {
|
||||
(window as any).api?.windowMaximize?.();
|
||||
}}
|
||||
>
|
||||
<span className="text-[14px] leading-none">▢</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className={['flex h-full w-11 items-center justify-center hover:bg-[#ff0000] hover:text-white transition-colors', iconColorClass].join(
|
||||
' ',
|
||||
)}
|
||||
title="Close"
|
||||
onClick={() => {
|
||||
(window as any).api?.windowClose?.();
|
||||
}}
|
||||
>
|
||||
<span className="text-base leading-none">×</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user