stacklok / stacklok/toolhive-studio

[Task] refactor multi-server creation group logic

Open
#1,294 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.