Skip to content

feat: implement use toast mutation for workspaces #184

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 23, 2025

Conversation

alex-mcgovern
Copy link
Collaborator

@alex-mcgovern alex-mcgovern commented Jan 23, 2025

This PR does a few things

  • implements the useToastMutation hook throughout the workspaces feature (with the exception of updating system prompt, to come later).
  • updates any tests that covered these paths to assert on the notification. (We should add more tests).
  • abstracts invalidating the workspace queries so they can be chained to onSuccess for all workspace mutations
  • renames the workspace mutations so they self sort (quality-of-life)

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 12933310020

Details

  • 27 of 37 (72.97%) changed or added relevant lines in 12 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 68.799%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/features/workspace/hooks/use-restore-workspace-button.tsx 1 2 50.0%
src/hooks/use-toast-mutation.ts 0 1 0.0%
src/features/workspace/hooks/use-mutation-activate-workspace.ts 2 4 50.0%
src/features/workspace/hooks/use-mutation-restore-workspace.ts 2 4 50.0%
src/features/workspace/hooks/use-mutation-hard-delete-workspace.ts 0 4 0.0%
Files with Coverage Reduction New Missed Lines %
src/features/workspace-system-prompt/hooks/use-archive-workspace.ts 3 0.0%
Totals Coverage Status
Change from base Build 12932599357: 0.2%
Covered Lines: 653
Relevant Lines: 851

💛 - Coveralls

Comment on lines -19 to -29
vi.mock("@stacklok/ui-kit", async () => {
const original =
await vi.importActual<typeof import("@stacklok/ui-kit")>(
"@stacklok/ui-kit",
);
return {
...original,
toast: { error: () => mockToast },
};
});

Copy link
Collaborator

Choose a reason for hiding this comment

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

❤️

Copy link
Collaborator

@peppescg peppescg left a comment

Choose a reason for hiding this comment

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

✈️

@alex-mcgovern alex-mcgovern merged commit a67b265 into main Jan 23, 2025
8 checks passed
@alex-mcgovern alex-mcgovern deleted the feat/implement-use-toast-mutation branch January 23, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants