mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-28 03:30:06 +00:00
fix: trigger induced UI issues (#1453)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (python) (push) Waiting to run
Pre-commit / pre-commit (push) Waiting to run
Test / Run Python Tests (push) Waiting to run
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (python) (push) Waiting to run
Pre-commit / pre-commit (push) Waiting to run
Test / Run Python Tests (push) Waiting to run
This commit is contained in:
parent
4371a71f59
commit
4574556e6a
4 changed files with 70 additions and 63 deletions
|
|
@ -703,7 +703,7 @@ export default function Folder({ data: _data }: { data?: Agent }) {
|
|||
className={`min-h-0 flex-1 ${selectedFile?.type === 'html' && !isShowSourceCode ? 'overflow-hidden' : 'scrollbar overflow-y-auto'}`}
|
||||
>
|
||||
<div
|
||||
className={`h-full ${selectedFile?.type === 'html' && !isShowSourceCode ? '' : 'p-6'} file-viewer-content`}
|
||||
className={`flex min-h-full flex-col ${selectedFile?.type === 'html' && !isShowSourceCode ? '' : 'p-6'} file-viewer-content`}
|
||||
>
|
||||
{selectedFile ? (
|
||||
!loading ? (
|
||||
|
|
@ -760,7 +760,7 @@ export default function Folder({ data: _data }: { data?: Agent }) {
|
|||
<ImageLoader selectedFile={selectedFile} />
|
||||
</div>
|
||||
) : (
|
||||
<pre className="overflow-x-auto whitespace-pre-wrap break-words font-mono text-sm text-text-primary">
|
||||
<pre className="overflow-auto whitespace-pre-wrap break-words font-mono text-sm text-text-primary">
|
||||
{selectedFile.content}
|
||||
</pre>
|
||||
)
|
||||
|
|
@ -775,7 +775,7 @@ export default function Folder({ data: _data }: { data?: Agent }) {
|
|||
</div>
|
||||
)
|
||||
) : (
|
||||
<div className="flex h-full items-center justify-center text-text-secondary">
|
||||
<div className="flex flex-1 items-center justify-center text-text-secondary">
|
||||
<div className="text-center">
|
||||
<FileText className="mx-auto mb-4 h-12 w-12 text-text-tertiary" />
|
||||
<p className="text-sm">
|
||||
|
|
|
|||
|
|
@ -201,24 +201,26 @@ function HeaderWin() {
|
|||
|
||||
return (
|
||||
<div
|
||||
className={`drag left-0 right-0 top-0 !h-9 py-1 absolute z-50 flex items-center justify-between ${
|
||||
className={`drag absolute left-0 right-0 top-0 z-50 flex !h-9 items-center justify-between py-1 ${
|
||||
platform === 'darwin' ? 'pl-16' : 'pl-2'
|
||||
}`}
|
||||
id="titlebar"
|
||||
ref={titlebarRef}
|
||||
>
|
||||
{/* left */}
|
||||
<div className="w-8 no-drag gap-1 ml-2 mt-[1.5px] flex items-center justify-center">
|
||||
<div
|
||||
className={`no-drag ml-2 mt-[1.5px] flex items-center justify-center gap-1 ${platform === 'darwin' ? 'w-8' : 'w-auto pr-4'}`}
|
||||
>
|
||||
<img src={defaultFolderIcon} alt="folder-icon" className="h-6 w-6" />
|
||||
{platform !== 'darwin' && (
|
||||
<span className="text-label-md font-bold text-text-heading">
|
||||
<span className="whitespace-nowrap text-label-md font-bold text-text-heading">
|
||||
Eigent
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* center */}
|
||||
<div className="drag pr-2 flex h-full flex-1 items-center justify-between">
|
||||
<div className="drag flex h-full flex-1 items-center justify-between pr-2">
|
||||
<div className="relative z-50 flex h-full items-center">
|
||||
{location.pathname === '/history' && (
|
||||
<div className="mr-1 flex items-center">
|
||||
|
|
@ -275,11 +277,11 @@ function HeaderWin() {
|
|||
<Button
|
||||
id="active-task-title-btn"
|
||||
variant="ghost"
|
||||
className="no-drag text-base font-bold rounded-full"
|
||||
className="no-drag rounded-full text-base font-bold"
|
||||
onClick={toggle}
|
||||
size="sm"
|
||||
>
|
||||
<span className="inline-block max-w-[300px] overflow-hidden align-middle text-ellipsis whitespace-nowrap">
|
||||
<span className="inline-block max-w-[300px] overflow-hidden text-ellipsis whitespace-nowrap align-middle">
|
||||
{t('layout.new-project')}
|
||||
</span>
|
||||
<ChevronDown />
|
||||
|
|
@ -298,7 +300,7 @@ function HeaderWin() {
|
|||
className="no-drag text-base font-bold"
|
||||
onClick={toggle}
|
||||
>
|
||||
<span className="inline-block max-w-[300px] overflow-hidden align-middle text-ellipsis whitespace-nowrap">
|
||||
<span className="inline-block max-w-[300px] overflow-hidden text-ellipsis whitespace-nowrap align-middle">
|
||||
{activeTaskTitle}
|
||||
</span>
|
||||
<ChevronDown />
|
||||
|
|
@ -314,7 +316,7 @@ function HeaderWin() {
|
|||
<div
|
||||
className={`${
|
||||
platform === 'darwin' && 'pr-2'
|
||||
} no-drag gap-1 relative z-50 flex h-full items-center`}
|
||||
} no-drag relative z-50 flex h-full items-center gap-1`}
|
||||
>
|
||||
{chatStore.activeTaskId &&
|
||||
chatStore.tasks[chatStore.activeTaskId as string] &&
|
||||
|
|
@ -333,7 +335,7 @@ function HeaderWin() {
|
|||
onClick={() => setEndDialogOpen(true)}
|
||||
variant="ghost"
|
||||
size="xs"
|
||||
className="no-drag bg-surface-cuation !text-text-cuation justify-center rounded-full"
|
||||
className="no-drag justify-center rounded-full bg-surface-cuation !text-text-cuation"
|
||||
>
|
||||
<Power />
|
||||
{t('layout.end-project')}
|
||||
|
|
@ -354,7 +356,7 @@ function HeaderWin() {
|
|||
}
|
||||
variant="ghost"
|
||||
size="xs"
|
||||
className="no-drag bg-surface-information !text-text-information rounded-full"
|
||||
className="no-drag rounded-full bg-surface-information !text-text-information"
|
||||
>
|
||||
{t('layout.share')}
|
||||
</Button>
|
||||
|
|
@ -415,7 +417,7 @@ function HeaderWin() {
|
|||
<div
|
||||
className={`${
|
||||
platform === 'darwin' && 'pr-2'
|
||||
} no-drag gap-1 relative z-50 flex h-full items-center`}
|
||||
} no-drag relative z-50 flex h-full items-center gap-1`}
|
||||
></div>
|
||||
)}
|
||||
</div>
|
||||
|
|
@ -427,19 +429,19 @@ function HeaderWin() {
|
|||
ref={controlsRef}
|
||||
>
|
||||
<div
|
||||
className="leading-5 hover:bg-surface-hover-subtle flex h-full w-[35px] flex-1 cursor-pointer items-center justify-center text-center"
|
||||
className="flex h-full w-[35px] flex-1 cursor-pointer items-center justify-center text-center leading-5 hover:bg-surface-hover-subtle"
|
||||
onClick={() => window.electronAPI.minimizeWindow()}
|
||||
>
|
||||
<Minus className="h-4 w-4" />
|
||||
</div>
|
||||
<div
|
||||
className="leading-5 hover:bg-surface-hover-subtle flex h-full w-[35px] flex-1 cursor-pointer items-center justify-center text-center"
|
||||
className="flex h-full w-[35px] flex-1 cursor-pointer items-center justify-center text-center leading-5 hover:bg-surface-hover-subtle"
|
||||
onClick={() => window.electronAPI.toggleMaximizeWindow()}
|
||||
>
|
||||
<Square className="h-4 w-4" />
|
||||
</div>
|
||||
<div
|
||||
className="leading-5 hover:bg-surface-hover-subtle flex h-full w-[35px] flex-1 cursor-pointer items-center justify-center text-center"
|
||||
className="flex h-full w-[35px] flex-1 cursor-pointer items-center justify-center text-center leading-5 hover:bg-surface-hover-subtle"
|
||||
onClick={() => window.electronAPI.closeWindow()}
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
|
|
|
|||
|
|
@ -711,53 +711,55 @@ export const TriggerDialog: React.FC<TriggerDialogProps> = ({
|
|||
</div>
|
||||
|
||||
{/* Execution Settings - Accordion */}
|
||||
<Accordion type="single" collapsible className="w-full">
|
||||
<AccordionItem value="execution-settings" className="border-none">
|
||||
<AccordionTrigger className="bg-transparent py-2 hover:no-underline">
|
||||
<span className="text-sm font-bold text-text-heading">
|
||||
{t('triggers.execution-settings')}
|
||||
</span>
|
||||
</AccordionTrigger>
|
||||
<AccordionContent>
|
||||
<div className="flex flex-col gap-4 rounded-lg bg-surface-disabled p-4 pt-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<Input
|
||||
id="max_per_hour"
|
||||
title={t('triggers.max-per-hour')}
|
||||
placeholder={t('triggers.max-per-hour-placeholder')}
|
||||
type="number"
|
||||
value={formData.max_executions_per_hour || ''}
|
||||
onChange={(e) =>
|
||||
setFormData({
|
||||
...formData,
|
||||
max_executions_per_hour: e.target.value
|
||||
? parseInt(e.target.value)
|
||||
: undefined,
|
||||
})
|
||||
}
|
||||
min={0}
|
||||
/>
|
||||
<Input
|
||||
id="max_per_day"
|
||||
title={t('triggers.max-per-day')}
|
||||
placeholder={t('triggers.max-per-day-placeholder')}
|
||||
type="number"
|
||||
value={formData.max_executions_per_day || ''}
|
||||
onChange={(e) =>
|
||||
setFormData({
|
||||
...formData,
|
||||
max_executions_per_day: e.target.value
|
||||
? parseInt(e.target.value)
|
||||
: undefined,
|
||||
})
|
||||
}
|
||||
min={0}
|
||||
/>
|
||||
{formData?.trigger_type !== TriggerType.Schedule && (
|
||||
<Accordion type="single" collapsible className="w-full">
|
||||
<AccordionItem value="execution-settings" className="border-none">
|
||||
<AccordionTrigger className="bg-transparent py-2 hover:no-underline">
|
||||
<span className="text-sm font-bold text-text-heading">
|
||||
{t('triggers.execution-settings')}
|
||||
</span>
|
||||
</AccordionTrigger>
|
||||
<AccordionContent>
|
||||
<div className="flex flex-col gap-4 rounded-lg bg-surface-disabled p-4 pt-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<Input
|
||||
id="max_per_hour"
|
||||
title={t('triggers.max-per-hour')}
|
||||
placeholder={t('triggers.max-per-hour-placeholder')}
|
||||
type="number"
|
||||
value={formData.max_executions_per_hour || ''}
|
||||
onChange={(e) =>
|
||||
setFormData({
|
||||
...formData,
|
||||
max_executions_per_hour: e.target.value
|
||||
? parseInt(e.target.value)
|
||||
: undefined,
|
||||
})
|
||||
}
|
||||
min={0}
|
||||
/>
|
||||
<Input
|
||||
id="max_per_day"
|
||||
title={t('triggers.max-per-day')}
|
||||
placeholder={t('triggers.max-per-day-placeholder')}
|
||||
type="number"
|
||||
value={formData.max_executions_per_day || ''}
|
||||
onChange={(e) =>
|
||||
setFormData({
|
||||
...formData,
|
||||
max_executions_per_day: e.target.value
|
||||
? parseInt(e.target.value)
|
||||
: undefined,
|
||||
})
|
||||
}
|
||||
min={0}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import { FileText } from 'lucide-react';
|
|||
import { toast } from 'sonner';
|
||||
import { createStore } from 'zustand';
|
||||
import { getAuthStore, getWorkerList } from './authStore';
|
||||
import { usePageTabStore } from './pageTabStore';
|
||||
import { useProjectStore } from './projectStore';
|
||||
|
||||
interface Task {
|
||||
|
|
@ -1976,6 +1977,8 @@ const chatStore = (initial?: Partial<ChatStore>) =>
|
|||
if (agentMessages.step === AgentStep.WRITE_FILE) {
|
||||
console.log('write_to_file', agentMessages.data);
|
||||
setNuwFileNum(currentTaskId, tasks[currentTaskId].nuwFileNum + 1);
|
||||
// Mark inbox tab as having unviewed content
|
||||
usePageTabStore.getState().markTabAsUnviewed('inbox');
|
||||
const { file_path } = agentMessages.data;
|
||||
const fileName =
|
||||
file_path?.replace(/\\/g, '/').split('/').pop() || '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue