stacklok / stacklok/toolhive-studio
[Task] refactor multi-server creation group logic
Open
Nobody has claimed this yet.
Task
- Dominant language
- TypeScript
- Stars
- 167
- Forks
- 24
- Avg merge
- 11h 32m
- Merged PRs (30d)
- 91
Description
Description
We can get rid of useEffect replacing it with react-query
// Create group when dialog opens and group hasn't been created yet
useEffect(() => {
if (
isOpen &&
!wizardState.isGroupCreated &&
!createGroupMutation.isPending &&
group?.name
) {
createGroupMutation
.mutateAsync({
body: {
name: group.name,
},
})
.then(() => {
setWizardState((prev) => ({ ...prev, isGroupCreated: true }))
})
.catch(() => {
handleClose()
})
}
}, [
isOpen,
wizardState.isGroupCreated,
group?.name,
createGroupMutation,
handleClose,
])
Acceptance Criteria
No response
Priority
Medium
Task Type
Feature
Additional Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the multi-server creation dialog and the shown useEffect, then inspect the existing react-query group-creation mutation. Verify how opening the dialog, tracking group creation, and handling mutation errors currently work. Done means the effect is replaced while group creation still occurs once when appropriate and errors still close the dialog.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100