Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

feat: rename workspace - #163

Merged
peppescg merged 2 commits into
mainfrom
issues/155
Jan 22, 2025
Merged

peppescg merged 2 commits into
mainfrom
issues/155

Conversation

@peppescg

Copy link
Copy Markdown
Collaborator
Kapture.2025-01-22.at.10.27.10.mp4
Screenshot 2025-01-22 at 10 27 37

@peppescg peppescg self-assigned this Jan 22, 2025
@peppescg peppescg linked an issue Jan 22, 2025 that may be closed by this pull request

@kantord kantord left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

The only thing I'm slightly missing is a test that actually tests the process of renaming using an MSW handler for the relevant endpoint as well.

But there is no reason to block a release because of that at all

Comment on lines +26 to +30
const handleSubmit = (e: FormEvent<HTMLFormElement>) => {
e.preventDefault();
mutate({ body: { name: workspaceName, rename_to: name } });
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a hook in the system prompt editor useSavedStatus

function useSavedStatus() {
const [saved, setSaved] = useState<boolean>(false);
useEffect(() => {
const id = setTimeout(() => setSaved(false), 2000);
return () => clearTimeout(id);
}, [saved]);
return { saved, setSaved };
}

We could re-use it here to show a pending+confirmation state

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mm I saw it, honestly I don't see the value 🤔
I mean we have isPending and the onSuccess callback for notification, why we need this hook?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to provide visual feedback that it has been saved — also for consistency.
Feel free to merge without this — I would like to go back and standardise it - but it's deffo not a blocker.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, I would prefer to show a notification after a mutation, I would standardise the notification approach after a mutation...wdyt?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a valid option too

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge as is and standardise on something in next iteration?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense 👍

@peppescg

Copy link
Copy Markdown
Collaborator Author

Great job!

The only thing I'm slightly missing is a test that actually tests the process of renaming using an MSW handler for the relevant endpoint as well.

But there is no reason to block a release because of that at all

yep, let me add it in a next PR, avoid block the release if it makes sense to you

@kantord

kantord commented Jan 22, 2025

Copy link
Copy Markdown
Member

Great job!
The only thing I'm slightly missing is a test that actually tests the process of renaming using an MSW handler for the relevant endpoint as well.
But there is no reason to block a release because of that at all

yep, let me add it in a next PR, avoid block the release if it makes sense to you

exactly, that is what I'm thinking

@coveralls

coveralls commented Jan 22, 2025 •

Copy link
Copy Markdown
Collaborator

Pull Request Test Coverage Report for Build 12905363452

Details

  • 7 of 9 (77.78%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 69.048%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/features/workspace/components/workspace-name.tsx 4 6 66.67%
Totals Coverage Status
Change from base Build 12905054401: -0.02%
Covered Lines: 604
Relevant Lines: 783

💛 - Coveralls

@peppescg
peppescg merged commit 3b68754 into main Jan 22, 2025
@peppescg
peppescg deleted the issues/155 branch January 22, 2025 09:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add rename workspace

4 participants