Skip to content

Conversation

@takaokouji
Copy link

This PR implements several improvements for the Mesh V2 extension based on Issue scratchfoundation#469 in smalruby3-gui.

Key Changes

  1. Improved Connection UI

    • Added MESH_ID_LABEL_CHARACTERS and makeMeshIdLabel() to convert cryptic node/group IDs into user-friendly labels (e.g., "なにうとてに").
    • Used labels in the connection modal for both hosting and joining.
    • Set the initial group name for hosts to the full nodeId.
    • Updated the connection status message to show the group name label.
  2. Event Handler Implementation

    • Updated MeshV2Service to hold references to blocks and runtime.
    • Implemented handleEvent() to integrate received Mesh events with the Scratch broadcast system using event_broadcast.
    • Imported BlockUtility for proper execution context.
  3. Extension Renaming

    • Renamed the extension from "Mesh V2 (GraphQL)" to "Mesh V2".
  4. Production Configuration

    • Updated hardcoded defaults in mesh-client.js with production AppSync endpoint, region, and API key.
    • Updated CREATE_GROUP mutation to support the optional maxConnectionTimeSeconds parameter.

🤖 Generated with Gemini Code

Co-Authored-By: Gemini noreply@google.com

takaokouji and others added 6 commits December 28, 2025 11:51
- Add MESH_ID_LABEL_CHARACTERS and makeMeshIdLabel() for user-friendly labels
- Use labels in connection modal for both host and joining options
- Use nodeId as initial group name for hosts
- Update connectedMessage to show group name labels
- Rename EXTENSION_NAME to 'Mesh V2'

🤖 Generated with [Gemini Code](https://gemini.google.com/code)

Co-Authored-By: Gemini <noreply@google.com>
…shV2Service

- Import BlockUtility in mesh-service.js
- Update MeshV2Service constructor to accept blocks and hold runtime
- Implement handleEvent() to integrate with Scratch broadcast system
- Pass blocks reference when initializing MeshV2Service in index.js

🤖 Generated with [Gemini Code](https://gemini.google.com/code)

Co-Authored-By: Gemini <noreply@google.com>
- Set production values for GraphQL endpoint, region and API key
- Add optional maxConnectionTimeSeconds parameter to CREATE_GROUP mutation

🤖 Generated with [Gemini Code](https://gemini.google.com/code)

Co-Authored-By: Gemini <noreply@google.com>
- Update joinGroup() to accept and set groupName
- Pass group name from discoveredGroups when joining as peer
- Make makeMeshIdLabel() robust against null/undefined IDs

🤖 Generated with [Gemini Code](https://gemini.google.com/code)

Co-Authored-By: Gemini <noreply@google.com>
…gnature

- Updated 'connect as host' to expect nodeId as group name
- Updated 'connect as peer' to match new joinGroup signature including groupName
@takaokouji takaokouji merged commit acaea6c into develop Dec 28, 2025
1 check passed
@takaokouji takaokouji deleted the feature/issue-469-mesh-v2-improvements branch December 28, 2025 05:46
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