Skip to content

Commit 1b12108

Browse files
MuriloFPdaniel-lxs
andauthored
fix: enable export, share, and copy buttons during API operations (RooCodeInc#5324) (RooCodeInc#5849)
* feat: add Issue Fixer Orchestrator mode * fix: allow export task history while API is active (RooCodeInc#5324) - Add exportAlwaysEnabled prop to TaskActions component - Export button remains enabled when exportAlwaysEnabled is true - Other action buttons still respect buttonsDisabled state - Add tests to verify the new behavior This fixes the regression where users couldn't export task history during API operations, which is a common debugging workflow. * fix: simplify export button to always be enabled The export functionality is not impacted by the model streaming state, so the button should always be enabled. Removed the unnecessary exportAlwaysEnabled prop and simplified the implementation. - Remove exportAlwaysEnabled prop from TaskActions - Remove disabled attribute from export button entirely - Update TaskHeader to remove exportAlwaysEnabled prop usage - Update tests to reflect that export is always enabled * fix: enable export, share, and copy buttons during API operations - Export, share, and copy buttons now remain enabled when API is active - Delete button still respects buttonsDisabled state for safety - Removed unnecessary exportAlwaysEnabled prop - Updated tests to reflect new behavior --------- Co-authored-by: Daniel Riccio <[email protected]>
1 parent 37300ef commit 1b12108

File tree

2 files changed

+43
-7
lines changed

2 files changed

+43
-7
lines changed

webview-ui/src/components/chat/TaskActions.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,16 @@ export const TaskActions = ({ item, buttonsDisabled }: TaskActionsProps) => {
2323

2424
return (
2525
<div className="flex flex-row gap-1">
26-
<ShareButton item={item} disabled={buttonsDisabled} />
26+
<ShareButton item={item} disabled={false} />
2727
<IconButton
2828
iconClass="codicon-desktop-download"
2929
title={t("chat:task.export")}
30-
disabled={buttonsDisabled}
3130
onClick={() => vscode.postMessage({ type: "exportCurrentTask" })}
3231
/>
3332
{item?.task && (
3433
<IconButton
3534
iconClass={showCopyFeedback ? "codicon-check" : "codicon-copy"}
3635
title={t("history:copyPrompt")}
37-
disabled={buttonsDisabled}
3836
onClick={(e) => copyWithFeedback(item.task, e)}
3937
/>
4038
)}

webview-ui/src/components/chat/__tests__/TaskActions.spec.tsx

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,16 +371,54 @@ describe("TaskActions", () => {
371371
})
372372

373373
describe("Button States", () => {
374-
it("disables buttons when buttonsDisabled is true", () => {
374+
it("keeps share, export, and copy buttons enabled but disables delete button when buttonsDisabled is true", () => {
375375
render(<TaskActions item={mockItem} buttonsDisabled={true} />)
376376

377-
// Find button by its icon class
377+
// Find buttons by their labels/icons
378378
const buttons = screen.getAllByRole("button")
379379
const shareButton = buttons.find((btn) => btn.querySelector(".codicon-link"))
380380
const exportButton = screen.getByLabelText("Export task history")
381+
const copyButton = buttons.find((btn) => btn.querySelector(".codicon-copy"))
382+
const deleteButton = screen.getByLabelText("Delete Task (Shift + Click to skip confirmation)")
381383

382-
expect(shareButton).toBeDisabled()
383-
expect(exportButton).toBeDisabled()
384+
// Share, export, and copy buttons should be enabled regardless of buttonsDisabled
385+
expect(shareButton).not.toBeDisabled()
386+
expect(exportButton).not.toBeDisabled()
387+
expect(copyButton).not.toBeDisabled()
388+
// Delete button should respect buttonsDisabled
389+
expect(deleteButton).toBeDisabled()
390+
})
391+
392+
it("share, export, and copy buttons are always enabled while delete button respects buttonsDisabled state", () => {
393+
// Test with buttonsDisabled = false
394+
const { rerender } = render(<TaskActions item={mockItem} buttonsDisabled={false} />)
395+
396+
let buttons = screen.getAllByRole("button")
397+
let shareButton = buttons.find((btn) => btn.querySelector(".codicon-link"))
398+
let exportButton = screen.getByLabelText("Export task history")
399+
let copyButton = buttons.find((btn) => btn.querySelector(".codicon-copy"))
400+
let deleteButton = screen.getByLabelText("Delete Task (Shift + Click to skip confirmation)")
401+
402+
expect(shareButton).not.toBeDisabled()
403+
expect(exportButton).not.toBeDisabled()
404+
expect(copyButton).not.toBeDisabled()
405+
expect(deleteButton).not.toBeDisabled()
406+
407+
// Test with buttonsDisabled = true
408+
rerender(<TaskActions item={mockItem} buttonsDisabled={true} />)
409+
410+
buttons = screen.getAllByRole("button")
411+
shareButton = buttons.find((btn) => btn.querySelector(".codicon-link"))
412+
exportButton = screen.getByLabelText("Export task history")
413+
copyButton = buttons.find((btn) => btn.querySelector(".codicon-copy"))
414+
deleteButton = screen.getByLabelText("Delete Task (Shift + Click to skip confirmation)")
415+
416+
// Share, export, and copy remain enabled
417+
expect(shareButton).not.toBeDisabled()
418+
expect(exportButton).not.toBeDisabled()
419+
expect(copyButton).not.toBeDisabled()
420+
// Delete button is disabled
421+
expect(deleteButton).toBeDisabled()
384422
})
385423
})
386424
})

0 commit comments

Comments
 (0)