Skip to content

Provide a single instance location so that views don't need to share handles anymore.#131

Open
pragmatrix wants to merge 6 commits into
masterfrom
instance-location
Open

Provide a single instance location so that views don't need to share handles anymore.#131
pragmatrix wants to merge 6 commits into
masterfrom
instance-location

Conversation

@pragmatrix
Copy link
Copy Markdown
Owner

Close #127

Copy link
Copy Markdown
Contributor

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 addresses issue #127 by removing cross-subsystem sharing of mutable scene handles and instead introducing a single, stable instance root location that views can parent to, so the desktop can present instances without referencing view-local handle definitions that may not yet be ingested by the renderer.

Changes:

  • Introduces Ref<T> as a read-only handle type and updates scene objects/ergonomics to use Ref for location/transform references.
  • Adds InstanceRoot (transform + location) to provide a shared instance node for presenters and views, and updates desktop presentation flow to use it.
  • Simplifies ViewCreationInfo and view creation so the desktop no longer receives/uses a view-provided Location handle.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scene/src/transform_resolver.rs Switches resolver caching/lookup to use Ref<Location> keys.
scene/src/objects.rs Migrates Visual/Location to store Ref references instead of mutable Handles.
scene/src/handle.rs Adds Ref<T> and HandleValue, and tightens update/change collection ordering in InnerHandle.
scene/src/ergonomics.rs Updates positioning helpers (At, VisualWithoutLocation::at) to accept Ref<Location>.
desktop/src/instance_presenter.rs Uses InstanceRoot and a shared instance location/transform node for background + view alpha.
desktop/src/instance_manager.rs Introduces and stores InstanceRoot, and passes a Ref<Location> parent into InstanceContext.
desktop/src/desktop.rs Updates command handling for the new DestroyView signature (no collector payload).
desktop/src/desktop_system/presentation.rs Threads InstanceRoot through instance presentation.
desktop/src/desktop_system/command_dispatch.rs Creates/passes InstanceRoot during instance spawn and presentation.
applications/src/view.rs Parents view-local location under a provided parent Ref<Location>; removes sending desktop-owned location in CreateView.
applications/src/view_builder.rs Carries parent: Ref<Location> through the builder into View::new.
applications/src/instance_context.rs Stores a view_parent: Ref<Location> and changes DestroyView command payload.
.github/copilot-instructions.md Adds repo orientation, boundaries, and validation guidance for future edits.

Comment thread applications/src/view.rs
Comment thread desktop/src/desktop.rs
Comment thread applications/src/instance_context.rs
@pragmatrix pragmatrix force-pushed the instance-location branch from 21532a5 to 2b10eb0 Compare June 2, 2026 07:05
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.

Architecture: Renderer might miss handles others refer to.

2 participants