-
Notifications
You must be signed in to change notification settings - Fork 22
Split projects into it's own context with tests #600
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We should not use props to pass context. It's very complex for testing and inefficient long-term. In a future PR I will split out workspaces.
5027658 to
edf2305
Compare
kylecarbs
added a commit
that referenced
this pull request
Nov 14, 2025
Following the pattern from PR #600 (projects split), this moves workspace state management from useWorkspaceManagement hook into a dedicated WorkspaceContext. - Created WorkspaceContext with workspace metadata, operations (create/remove/rename), and selection state - Comprehensive test coverage (14 tests) matching ProjectContext test patterns - Updated AppLoader to use WorkspaceProvider wrapper - Maintains same API surface for existing components via AppContext pass-through - Tests verify metadata loading, CRUD operations, event subscriptions, and error handling This eliminates prop drilling and centralizes workspace state management, making it easier to test and maintain workspace operations independently.
kylecarbs
added a commit
that referenced
this pull request
Nov 14, 2025
- Add eslint disable comments for test file mocks (consistent with PR #600 pattern) - Fix react-hooks/exhaustive-deps warnings by destructuring props in effects - Change empty arrow function to use comment (no-op setWorkspaceMetadata) - Remove await from non-promise expect call in tests
kylecarbs
added a commit
that referenced
this pull request
Nov 15, 2025
Following the pattern from PR #600 (projects split), this moves workspace state management from useWorkspaceManagement hook into a dedicated WorkspaceContext. - Created WorkspaceContext with workspace metadata, operations (create/remove/rename), and selection state - Comprehensive test coverage (14 tests) matching ProjectContext test patterns - Updated AppLoader to use WorkspaceProvider wrapper - Maintains same API surface for existing components via AppContext pass-through - Tests verify metadata loading, CRUD operations, event subscriptions, and error handling This eliminates prop drilling and centralizes workspace state management, making it easier to test and maintain workspace operations independently.
kylecarbs
added a commit
that referenced
this pull request
Nov 15, 2025
- Add eslint disable comments for test file mocks (consistent with PR #600 pattern) - Fix react-hooks/exhaustive-deps warnings by destructuring props in effects - Change empty arrow function to use comment (no-op setWorkspaceMetadata) - Remove await from non-promise expect call in tests
kylecarbs
added a commit
that referenced
this pull request
Nov 15, 2025
Following the pattern from PR #600 (projects split), this moves workspace state management from useWorkspaceManagement hook into a dedicated WorkspaceContext. - Created WorkspaceContext with workspace metadata, operations (create/remove/rename), and selection state - Comprehensive test coverage (14 tests) matching ProjectContext test patterns - Updated AppLoader to use WorkspaceProvider wrapper - Maintains same API surface for existing components via AppContext pass-through - Tests verify metadata loading, CRUD operations, event subscriptions, and error handling This eliminates prop drilling and centralizes workspace state management, making it easier to test and maintain workspace operations independently.
kylecarbs
added a commit
that referenced
this pull request
Nov 15, 2025
- Add eslint disable comments for test file mocks (consistent with PR #600 pattern) - Fix react-hooks/exhaustive-deps warnings by destructuring props in effects - Change empty arrow function to use comment (no-op setWorkspaceMetadata) - Remove await from non-promise expect call in tests
kylecarbs
added a commit
that referenced
this pull request
Nov 15, 2025
Following the pattern from PR #600 (projects split), this moves workspace state management from useWorkspaceManagement hook into a dedicated WorkspaceContext. - Created WorkspaceContext with workspace metadata, operations (create/remove/rename), and selection state - Comprehensive test coverage (14 tests) matching ProjectContext test patterns - Updated AppLoader to use WorkspaceProvider wrapper - Maintains same API surface for existing components via AppContext pass-through - Tests verify metadata loading, CRUD operations, event subscriptions, and error handling This eliminates prop drilling and centralizes workspace state management, making it easier to test and maintain workspace operations independently.
kylecarbs
added a commit
that referenced
this pull request
Nov 15, 2025
- Add eslint disable comments for test file mocks (consistent with PR #600 pattern) - Fix react-hooks/exhaustive-deps warnings by destructuring props in effects - Change empty arrow function to use comment (no-op setWorkspaceMetadata) - Remove await from non-promise expect call in tests
kylecarbs
added a commit
that referenced
this pull request
Nov 15, 2025
Following the pattern from PR #600, this moves workspace state management from `useWorkspaceManagement` hook into a dedicated `WorkspaceContext`. ## Changes **Created WorkspaceContext:** - Manages workspace metadata, CRUD operations (create/remove/rename) - Handles selection state and workspace creation flow - Subscribes to metadata update events - Provides workspace info retrieval **Comprehensive test coverage:** - 14 tests covering all context operations - Tests metadata loading, CRUD operations, event subscriptions, error handling - Matches ProjectContext test patterns from PR #600 **Updated AppLoader:** - Uses WorkspaceProvider to wrap app initialization - Maintains same API surface for existing components via AppContext pass-through - No changes required to App.tsx or other components ## Testing ```bash bun test src/contexts/WorkspaceContext.test.tsx make typecheck ``` All tests pass, typechecks clean. --- _Generated with `mux`_
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We should not use props to pass context. It's very complex for testing and inefficient long-term.
In a future PR I will split out workspaces.