Skip to content
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

feat: enable toggle workspace, invalidate on workspace update #130

Merged
merged 3 commits into from
Jan 20, 2025

Conversation

alex-mcgovern
Copy link
Collaborator

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

  • adds a "mutation" hook to the workspace selection component, which allows toggling workspaces
  • wraps the app a custom react-query QueryClientProvider, which subscribes to events in the query cache to enable the following
    • when the cached value for GET /api/v1/workspaces/active is updated, the provider will compare the active workspace ID — if it is new, it will invalidate the query cache and post a toast notification with the newly activated workspace name
  • a useActiveWorkspaces hook is implemented, which polls the server on an interval, as well as every time the window is focused, or it reconnects — this should ensure that it is always up to date
Screen.Recording.2025-01-20.at.1.14.09.PM.mov

Closes #126
Closes #124

@coveralls
Copy link
Collaborator

coveralls commented Jan 20, 2025

Pull Request Test Coverage Report for Build 12869250854

Details

  • 12 of 35 (34.29%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.2%) to 66.696%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/features/workspace/components/workspaces-selection.tsx 6 11 54.55%
src/components/react-query-provider.tsx 0 18 0.0%
Totals Coverage Status
Change from base Build 12868779870: -1.2%
Covered Lines: 507
Relevant Lines: 679

💛 - Coveralls

@alex-mcgovern alex-mcgovern merged commit 8904d8b into main Jan 20, 2025
9 of 10 checks passed
@alex-mcgovern alex-mcgovern deleted the feat/enable-toggling-workspaces branch January 20, 2025 13:39
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.

Tuen workspace dropdown dark mode on item hover Set workspace id globally available in the app
3 participants