Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: restore quick actions in CoS task composer

Adam Eivycabbc4bb8ac3
diff --git a/client/src/components/cos/TaskAddForm.jsx b/client/src/components/cos/TaskAddForm.jsx
index 0857a1cef6..7a0d54be12 100644
--- a/client/src/components/cos/TaskAddForm.jsx
+++ b/client/src/components/cos/TaskAddForm.jsx
@@ -1,6 +1,4 @@
import { useState, useEffect, useRef, useMemo, useCallback } from 'react';
-import Drawer from '../Drawer';
-import useDrawerTab from '../../hooks/useDrawerTab';
import ProviderModelSelector from '../ProviderModelSelector';
import { Plus, Image, X, ChevronDown, ChevronRight, Sparkles, Loader2, Paperclip, FileText, Zap, Bookmark, Ticket, GitBranch, GitPullRequest, Wand2 } from 'lucide-react';
import toast from '../ui/Toast';
@@ -134,7 +132,7 @@ export default function TaskAddForm({ providers, providersLoaded = true, apps, o
const [screenshots, setScreenshots] = useState([]);
const [attachments, setAttachments] = useState([]);
const [templates, setTemplates] = useState([]);
- const [showTemplates, setShowTemplates] = useState(false);
+ const [showTemplates, setShowTemplates] = useState(queueFirst);
// Compact-mode-only "More options" toggle. Callers that render in a
// tall container (the dashboard Quick Task widget) pass defaultExpanded
// so the card paints as a complete capture form on first render.
@@ -835,9 +833,12 @@ export default function TaskAddForm({ providers, providersLoaded = true, apps, o
{enhancePrompt && ' · Enhance prompt'}
{addToTop && ' · Queue at top'}
</p>
+ {renderTemplates()}
+ {renderUploadControls()}
{renderPreviews()}
<div className="flex flex-wrap items-center justify-between gap-2">
- <button type="button" onClick={() => setConfigurationOpen(true)}
+ <button type="button" onClick={() => setConfigurationOpen(open => !open)}
+ aria-expanded={configurationOpen} aria-controls="task-configuration"
className="min-h-[44px] px-3 py-2 text-sm text-port-accent border border-port-border rounded-lg">
Task configuration
</button>
@@ -847,8 +848,11 @@ export default function TaskAddForm({ providers, providersLoaded = true, apps, o
{isSubmitting ? 'Adding...' : planOnly ? 'Plan & File Issue' : enhancePrompt ? 'Enhance & Add task' : 'Add task'}
</button>
</div>
- <TaskConfigurationDrawer open={configurationOpen} onClose={() => setConfigurationOpen(false)}
- renderFields={renderFullFormFields} renderTemplates={renderTemplates} renderUploads={() => <>{renderUploadControls()}{renderPreviews()}</>} />
+ {configurationOpen && (
+ <div id="task-configuration" role="region" aria-label="Task configuration" className="space-y-3">
+ {renderFullFormFields()}
+ </div>
+ )}
</section>
);
}
@@ -1568,22 +1572,3 @@ export default function TaskAddForm({ providers, providersLoaded = true, apps, o
);
}
}
-
-
-// The form owns all drafts; changing a drawer tab only remounts its controls.
-function TaskConfigurationDrawer({ open, onClose, renderFields, renderTemplates, renderUploads }) {
- const [tab, setTab] = useDrawerTab('taskConfig', 'execution', ['execution', 'completion', 'templates']);
- return (
- <Drawer open={open} onClose={onClose} title="Task configuration" size="lg"
- closeLabel="Close task configuration"
- tabs={[
- { id: 'execution', label: 'Execution', icon: Zap },
- { id: 'completion', label: 'Completion & review', icon: GitPullRequest },
- { id: 'templates', label: 'Templates & attachments', icon: Paperclip },
- ]}
- activeTab={tab} onTabChange={setTab} bodyClassName="@container space-y-3">
- {tab === 'templates' && <>{renderTemplates()}{renderUploads()}</>}
- {renderFields(tab)}
- </Drawer>
- );
-}
diff --git a/client/src/components/cos/TaskAddForm.test.jsx b/client/src/components/cos/TaskAddForm.test.jsx
index 7a490c2e9a..1eea489587 100644
--- a/client/src/components/cos/TaskAddForm.test.jsx
+++ b/client/src/components/cos/TaskAddForm.test.jsx
@@ -76,10 +76,11 @@ describe('TaskAddForm responsive layout', () => {
// #7796: hiding configuration must not reset the draft or silently change
// app completion defaults, and a failed submission must remain retryable.
- it('retains configured queue drafts across drawer tabs, close, and a failed submit', async () => {
+ it('keeps queue settings inline and retains drafts across collapse and failed submission', async () => {
localStorage.clear();
const user = userEvent.setup();
const added = vi.fn();
+ api.getCosPopularTemplates.mockResolvedValue({ templates: [{ id: 'example-template', name: 'Inspect example', description: 'Inspect example', isBuiltin: true }] });
api.getCodeReviewDefaults.mockResolvedValue({ reviewers: ['codex'] });
api.addCosTask.mockRejectedValueOnce(new Error('Queue unavailable'))
.mockResolvedValueOnce({ id: 'example-task', status: 'pending' });
@@ -88,17 +89,17 @@ describe('TaskAddForm responsive layout', () => {
onTaskAdded={added} /></MemoryRouter>);
await waitFor(() => expect(screen.getByLabelText('Task execution summary')).toHaveTextContent('Review: codex'));
expect(screen.queryByLabelText('AI provider')).not.toBeInTheDocument();
+ expect(screen.getByLabelText('Attach screenshots')).toBeInTheDocument();
+ expect(screen.getByLabelText('Attach files')).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: /Inspect example/ })).toBeVisible();
await user.type(screen.getByRole('textbox', { name: /Task description/ }), 'Inspect synthetic queue');
await user.click(screen.getByRole('button', { name: 'Task configuration' }));
- await user.click(screen.getByRole('tab', { name: 'Completion & review' }));
expect(openPrToggle()).toBeChecked();
expect(worktreeToggle()).toBeChecked();
await user.click(worktreeToggle());
await user.selectOptions(screen.getByLabelText('When done'), 'commit-push');
- await user.click(screen.getByRole('tab', { name: 'Templates & attachments' }));
- await user.click(screen.getByRole('tab', { name: 'Completion & review' }));
expect(screen.getByLabelText('When done')).toHaveValue('commit-push');
- await user.click(screen.getByRole('button', { name: 'Close task configuration' }));
+ await user.click(screen.getByRole('button', { name: 'Task configuration' }));
expect(screen.getByLabelText('Task execution summary')).toHaveTextContent('Direct checkout · Commit and push to default branch');
await user.click(screen.getByRole('button', { name: 'Add task' }));
await waitFor(() => expect(toast.error).toHaveBeenCalledWith('Queue unavailable'));
@@ -106,7 +107,7 @@ describe('TaskAddForm responsive layout', () => {
expect(added).not.toHaveBeenCalled();
await user.click(screen.getByRole('button', { name: 'Task configuration' }));
expect(screen.getByLabelText('When done')).toHaveValue('commit-push');
- await user.click(screen.getByRole('button', { name: 'Close task configuration' }));
+ expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
await user.click(screen.getByRole('button', { name: 'Add task' }));
await waitFor(() => expect(added).toHaveBeenCalledWith({ id: 'example-task', status: 'pending' }, { position: 'bottom' }));
expect(api.addCosTask).toHaveBeenLastCalledWith(expect.objectContaining({