- Notifications
You must be signed in to change notification settings - Fork1k
feat: add remove task button into the tasks list#20036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think this is in a solid spot. My main concern is having a dialog component associated with each individual task, but I'm willing to punt that work until we know that it's causing performance problems
<TaskDeleteDialog | ||
task={task} | ||
open={isDeleteDialogOpen} | ||
onClose={()=>{ | ||
setIsDeleteDialogOpen(false); | ||
}} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do we necessarily want to mount a deletion dialog for each individual task? We would only ever have one open at a time, and while theConfirmDialog
shouldn't load any DOM nodes while closed, we're still making JSX for each one
Wondering if we could have something like a piece ofactiveTaskId
state, and then that affects the content and logic that gets fed into the main dialog. Then, if it starts off asnull
, thenull
case would be treated as closed, and all other values would be treated as open
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Rendering the delete dialog within the row follows the same philosophy as dropdowns: only one is open at a time, but we handle it per row. I know placement matters, but performance-wise I’d expect it to be similar.
Another point: keeping state in the list would re-render the entire list, whereas putting it inside the row means only that row re-renders, which should be more performant. Also, controlling state from the parent adds indirection; following the principle of colocation, keeping state close to where it’s used tends to make the code easier to reason about.
Does that make sense?
code-asher left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good! Should we show "deleting" in the status column (and possibly disable the delete button)? Right now it looks like nothing happens when deleting a task, until it finally disappears (actually I wonder if we should show the task state only if the workspace is running, otherwise we should show the workspace state, or show both at least).
It also gets a bit wonky if you try to delete a task while the workspace is in a transition state like stopping or starting (it says "resource not found").
But possibly this will be resolved later, I recall you mentioned there was some work to be done for how this data is fetched to be displayed on the page.
exportconstDeleteTaskSuccess:Story={ | ||
decorators:[withGlobalSnackbar], | ||
args:{ | ||
open:true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do we also need to pass intask
andonClose
since those are non-optional args?
BrunoQuaresmaOct 1, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It’s not necessary, and Storybook won’t complain about it, or it is what I would expect but I see some storybook errors related toonClose
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Ah yeah I noticed there is no actual enforcement of the types in Storybook tests, but really seems like there should be. 🤔 Seems weird to discard type safety for tests.
getErrorDetail(error), | ||
); | ||
}finally{ | ||
props.onClose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Just curious if there is a reasononSuccess
is being destructured above but notonClose
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
onSuccess
isn’t part of theConfirmDialog
props—that’s the only reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I might be misunderstanding, butonClose
is not a part ofConfirmDialog
props either? BothonClose
andonSuccess
are called in thisonConfirm
callback, so it looks inconsistent.
No big deal though, just wondered if there was a reason for it or was just random.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You're right, my bad.
Bulk actions next? 👀 |
For later discussions, I think it's cool how codex supports archiving Screen.Recording.2025-09-30.at.5.51.05.PM.mov |
That could definitely be a good next step.
Agreed—that would be a nice feature. We’d need to define what “archiving” means in terms of resource usage and data retention. |
f23a6a1
intomainUh oh!
There was an error while loading.Please reload this page.
Demo:
Screen.Recording.2025-09-30.at.10.43.32.mov
Closes#19525