Implement SetObjectPosition and sequence requests and Fix some handling processes#4
Merged
anosatsuk124 merged 7 commits intodevelopmentfrom May 22, 2025
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements the SetObjectPosition functionality and introduces support for handling sequence requests, while refactoring the object spawn process. Key changes include:
- Renaming protocol fields (e.g., "type" to "shape" in ObjectProperties and "uuid" to "bytes" in Uuid messages).
- Updating the RPC service to handle object position requests (including sequences), mapping errors, and queuing internal requests via a unified REQUEST_LIST.
- Removing the obsolete spawn module and introducing new request plugins for object-related events.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| proto/viewer/v1/object.proto | Renamed field "type" to "shape" for clarity. |
| proto/viewer/v1/math.proto | Renamed field "uuid" to "bytes" in the Uuid message. |
| components/viewer/src/rpc/service.rs | Added implementation for SetObjectPosition and sequence request handling. |
| components/viewer/src/manage_objects/spawn.rs | Removed the outdated spawn module. |
| components/viewer/src/manage_objects/request/object.rs | Introduced new request types and event handlers for object requests. |
| components/viewer/src/manage_objects/request.rs | Added an internal request plugin and processing system. |
| components/viewer/src/manage_objects/mod.rs | Removed spawn module usage and updated plugin configuration. |
| components/viewer/src/manage_objects/global.rs | Updated to use a unified REQUEST_LIST for managing internal requests. |
Comments suppressed due to low confidence (1)
components/viewer/src/manage_objects/mod.rs:6
- The struct name 'ManageObejctsPlugin' appears to contain a typographical error; consider renaming it to 'ManageObjectsPlugin' for improved clarity and consistency.
pub struct ManageObejctsPlugin;
Contributor
There was a problem hiding this comment.
Pull Request Overview
Implements object positioning APIs, unifies the request queue, and updates field names for consistency.
- Adds
SetObjectPositionandSetObjectPositionSequenceRPC handlers with internal mapping and queueing - Replaces
SPAWN_OBJECT_REQUEST_LISTwith a genericREQUEST_LISTand centralizes request processing - Renames
type→shapeinobject.protoanduuid→bytesinmath.proto
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| proto/viewer/v1/object.proto | Renamed field type to shape |
| proto/viewer/v1/math.proto | Renamed field uuid to bytes |
| components/viewer/src/rpc/service.rs | Implemented gRPC methods, error mapping, and queue pushes |
| components/viewer/src/manage_objects/* | Moved spawn and set-position logic into event-based modules |
| components/viewer/src/manage_objects/mod.rs | Cleaned up plugin naming and module structure |
| components/viewer/src/manage_objects/global.rs | Unified global request queue |
Comments suppressed due to low confidence (4)
proto/viewer/v1/math.proto:33
- [nitpick] Field name
bytesis ambiguous; consider using a more descriptive name likevalueordata.
bytes bytes = 1;
components/viewer/src/rpc/service.rs:117
- [nitpick] The error message format
Index {index}; {}may be unclear to clients; consider using a clearer pattern likeAt sequence index {index}: {error_message}.
tonic::Status::new(e.code(), format!("Index {index}; {}", e.message()))
components/viewer/src/rpc/service.rs:163
- Consider adding unit tests for
set_position_request_to_internal_requestto verify both successful mappings and error conditions.
pub fn set_position_request_to_internal_request(
components/viewer/src/rpc/service.rs:207
- Consider adding unit tests for
spawn_object_request_to_internal_requestto cover shape conversion, default size handling, and error cases.
pub fn spawn_object_request_to_internal_request(
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 task
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
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.
Close #3