Skip to content

Conversation

nikgraf
Copy link
Collaborator

@nikgraf nikgraf commented Sep 13, 2025

No description provided.

@nikgraf nikgraf requested a review from Copilot September 14, 2025 04:46
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the hypergraph-react package to improve code organization by extracting hook functionality into separate files and consolidating shared utilities. The refactoring moves hooks from a central context file into individual hook files and extracts common functionality into utility modules.

  • Extracted individual hooks from HypergraphSpaceContext.tsx into separate files in a new hooks/ directory
  • Moved internal utility functions into separate modules for better reusability
  • Updated import statements throughout the codebase to reflect the new structure

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/hypergraph-react/test/internal/translate-filter-to-graphql.test.ts Updated import path for test module
packages/hypergraph-react/test/HypergraphSpaceContext.test.tsx Replaced centralized imports with individual hook imports and renamed internal hook
packages/hypergraph-react/src/internal/use-subscribe-to-space.tsx New utility for managing space subscriptions
packages/hypergraph-react/src/internal/use-query-public.tsx Removed duplicate utility functions, added imports for extracted modules
packages/hypergraph-react/src/internal/use-query-private.tsx New module for private query functionality
packages/hypergraph-react/src/internal/use-hypergraph-space-internal.tsx Extracted context access utility
packages/hypergraph-react/src/internal/use-entity-public.tsx Removed duplicate utility functions, added imports for extracted modules
packages/hypergraph-react/src/internal/use-entity-private.tsx New module for private entity functionality
packages/hypergraph-react/src/internal/convert-relations.ts Extracted relation conversion utility
packages/hypergraph-react/src/internal/convert-property-value.ts Extracted property value conversion utility
packages/hypergraph-react/src/index.ts Updated exports to use individual hook modules
packages/hypergraph-react/src/hooks/ New directory containing extracted hook implementations
packages/hypergraph-react/src/HypergraphSpaceContext.tsx Simplified to only contain context provider
apps/events/vitest.config.ts Added vitest configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

});

if (rawEntity[key]) {
rawEntity[key] = [...(rawEntity[key] as unknown[]), ...newRelationEntities];
Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

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

The type assertion as unknown[] suggests uncertain typing. Consider defining a more specific type or restructuring to avoid the need for type assertion.

Copilot uses AI. Check for mistakes.

@nikgraf nikgraf merged commit c0ef899 into main Sep 14, 2025
6 checks passed
@nikgraf nikgraf deleted the ng/refactoring branch September 14, 2025 04:54
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.

1 participant