Skip to content

Conversation

nikgraf
Copy link
Collaborator

@nikgraf nikgraf commented Mar 18, 2025

No description provided.

@nikgraf nikgraf force-pushed the ng/public-graph-integration branch from 6a07e3f to 9034a6d Compare April 24, 2025 08:00
@nikgraf nikgraf force-pushed the ng/public-graph-integration branch from 9034a6d to 60fe33e Compare April 24, 2025 08:05
@nikgraf nikgraf force-pushed the ng/public-graph-integration branch 2 times, most recently from 28afc98 to d36ef93 Compare April 28, 2025 15:50
@nikgraf nikgraf force-pushed the ng/public-graph-integration branch from d36ef93 to 0ded21d Compare April 29, 2025 06:41
@nikgraf nikgraf force-pushed the ng/public-graph-integration branch 2 times, most recently from 1c4b753 to e5f6b80 Compare April 29, 2025 14:48
@nikgraf nikgraf force-pushed the ng/public-graph-integration branch from e5f6b80 to 5283c61 Compare April 29, 2025 14:55
@nikgraf nikgraf requested review from cmwhited, Copilot and pcarranzav May 2, 2025 12:58
@nikgraf nikgraf self-assigned this May 2, 2025
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 integrates public graph functionality by introducing smart account wallet client support and updating various entity query and mutation components for public, local, and merged operations. In addition, filter types for entity fields and a new properties/types creation component have been added.

  • Added support for smart account wallet client integration in public graph operations.
  • Updated and added new components for user and todo management across different modes (public, local, merged, read-only, filter).
  • Introduced new type definitions for filters and a component to create properties and types.

Reviewed Changes

Copilot reviewed 82 out of 83 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/events/src/lib/smart-account.ts Added smart account wallet client integration.
apps/events/src/filter-types.ts Introduced type definitions for various filter options.
apps/events/src/components/users/*.tsx Updated user management components across different modes.
apps/events/src/components/todos*.tsx Integrated public/local todo operations and added new creation/publishing logic.
apps/events/src/components/ui/modal.ts Added modal component with keyboard support.
apps/events/src/components/create-properties-and-types.tsx Added a component to create graph properties and types.
Files not reviewed (1)
  • apps/events/package.json: Language not supported

@nikgraf nikgraf marked this pull request as ready for review May 2, 2025 13:01
Copy link
Member

@pcarranzav pcarranzav left a comment

Choose a reason for hiding this comment

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

LGTM!
A few comments but nothing that can't be addressed in separate issues/PRs imo.

I did a very quick pass, so take the review with a grain of salt... a lot of the schema things would take me a lot longer to understand (for instance, no idea what the VariantSchema is).

@@ -0,0 +1,14 @@
import { getSmartAccountWalletClient as grc20getSmartAccountWalletClient } from '@graphprotocol/grc-20';
Copy link
Member

Choose a reason for hiding this comment

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

it would be good to expose this and the other pieces from grc-20 from hypergraph so that users don't need to have grc-20 in their apps... but I guess we can solve this together with the new auth flow

preparePublish: preparePublishUsers,
} = useQuery(User);
const space = useHypergraphSpace();
const createTodo = useCreateEntity(Todo2);
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it might be nicer to have all these entity actions in a single hook, e.g. const { createEntity: createTodo, updateEntity: updateTodo, deleteEntity: deleteTodo } = useEntityActions(Todo2)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

interesting suggestion, I have no strong opinion here. I'd say let's bring it up in the sync call :)

let spaceId = Utils.generateId();

try {
if (smartAccountWalletClient?.account) {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't public space creation be optional, or are we expecting that private spaces will always have a matching public space? Maybe createSpace could take an options object where we can specify whether it's a public, private or mixed space?
(I imagine there will be a lot of cases where a space is only used for private data sync, and creating a space in the KG would be a waste of resources)

Copy link
Member

Choose a reason for hiding this comment

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

Also, if we're creating private/public spaces with the same ids, I suppose we should also make invitations work for both the public and private space?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, I thinks so that it should be possible to create a private space without a public one. And possible create it later. I like the idea of an option. Created an issue here: #170

Yes! invitations should work as well for public spaces #171


const DEFAULT_RPC_URL = 'https://rpc-geo-genesis-h0q2s21xx8.t.conduit.xyz';

const GEOGENESIS: Chain = {
Copy link
Member

Choose a reason for hiding this comment

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

Let's have the option, when creating the wallet client, to choose Geo testnet instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, if we keep testnet around then it makes sense. Byron mentioned he was about to completely shut it down

import { md5 } from '@noble/hashes/legacy';
import { v4 } from 'uuid';

function createIdFromUniqueString(text: string) {
Copy link
Member

Choose a reason for hiding this comment

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

Seems like this file, and a lot of the things in this src/internal folder, could eventually move to the core hypergraph package, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

spot on, will do this!

}

const cid = await Ipfs.publishEdit({
name: 'Update todos',
Copy link
Member

Choose a reason for hiding this comment

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

I imagine this can be a parameter of the function call, or we could use a more generic string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch, added an issue #172

@nikgraf nikgraf removed the request for review from cmwhited May 4, 2025 04:35
@nikgraf nikgraf force-pushed the ng/public-graph-integration branch from 7b2d9b1 to 5910d3b Compare May 4, 2025 10:33
@nikgraf nikgraf merged commit d90f819 into main May 4, 2025
4 checks passed
@nikgraf nikgraf deleted the ng/public-graph-integration branch May 4, 2025 10:37
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.

2 participants