Skip to content

feat(devtools-core): Visualize TreeDataObject in Devtools #24885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 60 commits into
base: main
Choose a base branch
from

Conversation

jikim-msft
Copy link
Contributor

@jikim-msft jikim-msft commented Jun 20, 2025

NOTE

This PR prototypes a devtools-core API integration and explores its potential use cases.

Background

This work originates from ADO 36175, which proposed creating an adapter in the office-bohemia repo to support per-Loop-Component (DataObject) visualization. However, implementing a full IContainer adapter was not feasible, as the required properties for the devtools-core visualizer couldn't be fulfilled.

Description

Rather than wrapping everything into an adapter, this PR takes the inverse approach. It introduces a new DecomposedIContainer interface and a DecomposedContainer class that implements it. This class is a lightweight, strict subset of the IContainer interface, exposing only the properties necessary for visualization.

Thanks to the property and event overlap (clientId, audience, connected, attached, etc.) with PureDataObject.runtime, we can effectively translate a PureDataObject into a decomposed IContainer type, enabling visualizer compatibility.

Change in the devtools-view package

Screenshot 2025-07-07 at 17 00 27

@github-actions github-actions bot added base: main PRs targeted against main branch area: dds Issues related to distributed data structures area: dds: tree area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct public api change Changes to a public API labels Jun 20, 2025
@github-actions github-actions bot removed area: dds Issues related to distributed data structures area: dds: tree labels Jun 23, 2025
@github-actions github-actions bot removed the area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct label Jun 23, 2025
@jikim-msft jikim-msft marked this pull request as ready for review June 23, 2025 23:38
@jikim-msft jikim-msft requested a review from a team as a code owner June 23, 2025 23:38
Copy link
Contributor

@Josmithr Josmithr left a comment

Choose a reason for hiding this comment

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

I would recommend making this PR a draft. There is still a fair amount of work that needs to be done to this package and devtools-view to make this new infrastructure robust. I've left a handful of comments to this effect. Great proof of concept, but there is still a fair amount of work to be done to productionize it.

@jikim-msft jikim-msft requested a review from Josmithr July 16, 2025 19:28
@Copilot Copilot AI review requested due to automatic review settings July 28, 2025 18:40
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 introduces support for visualizing TreeDataObject in the Fluid Devtools by extending the devtools architecture to handle Data Objects alongside Containers. The implementation creates a lightweight abstraction of containers to enable Data Object visualization without requiring full container adapter implementation.

  • Introduces a DecomposedContainer interface and implementation to abstract common container properties for devtools use
  • Adds DataObjectDevtools and BaseDevtools classes to share functionality between container and data object devtools
  • Updates the UI to display both Containers and Data Objects sections with appropriate visual distinctions

Reviewed Changes

Copilot reviewed 28 out of 29 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/tools/devtools/devtools-core/src/IFluidDevtools.ts Adds registerDataObject method to support data object registration
packages/tools/devtools/devtools-core/src/FluidDevtools.ts Implements data object registration and management alongside containers
packages/tools/devtools/devtools-core/src/DecomposedContainer.ts Creates abstraction layer for containers to support both real containers and data objects
packages/tools/devtools/devtools-core/src/BaseDevtools.ts Extracts shared devtools functionality into base class
packages/tools/devtools/devtools-core/src/DataObjectDevtools.ts Provides devtools implementation specifically for data objects
packages/tools/devtools/devtools-view/src/components/Menu.tsx Updates UI to display both container and data object sections with state management
packages/tools/devtools/devtools-view/src/components/ContainerSummaryView.tsx Conditionally displays action controls based on devtools type
packages/tools/devtools/devtools-test-app/src/App.tsx Demonstrates data object registration in test application
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (3)

packages/tools/devtools/devtools-core/src/FluidDevtools.ts:32

  • The error message 'TODO' is not helpful. Replace with a descriptive error message that explains what went wrong.
import { pkgVersion as devtoolsVersion } from "./packageVersion.js";

packages/tools/devtools/devtools-core/src/BaseDevtools.ts:76

  • [nitpick] The underscore prefix in '_audienceChangeLog' is inconsistent with the naming convention used for '_connectionStateLog' in the same context. Consider using consistent naming patterns.
	protected readonly _audienceChangeLog: AudienceChangeLogEntry[];

packages/tools/devtools/devtools-view/src/components/Menu.tsx:160

  • The telemetry event name 'RefreshContainerListButtonClicked' should be updated to be more generic since this button now refreshes both containers and data objects. Consider 'RefreshListButtonClicked' or include the label parameter.
		usageLogger?.sendTelemetryEvent({ eventName: "RefreshContainerListButtonClicked" });

Copy link
Contributor

github-actions bot commented Aug 4, 2025

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  232061 links
    1712 destination URLs
    1942 URLs ignored
       0 warnings
       0 errors


jikim-msft added a commit that referenced this pull request Aug 8, 2025
#### Description

Part 1 of
[24885](#24885)

Adds`canModifyConnectionState` feature flag:
- `true`: Supports modifying the container's connection and lifecycle
state (supported for `IContainer`)
- `false`: Disable modifying the container's connection and lifecycle
state (for `IContainerRuntime` as it does not have the `closed` event,
and `DataObject` in the future).

Part 2: [25137](#25137)

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
jikim-msft added a commit that referenced this pull request Aug 12, 2025
#### Description

Part 2 of
[24885](#24885)

This PR primarily adds `ContainerRuntimeDevtools`,
`DecomposedContainer`& `registerContainerRuntime()` to enable
registeration and visualization of `DataObject` in `devtools-core`.

**TODO: Discuss about one unifying API for registering either
`IContainer` or `IContainerRuntime`.

#### Follow-Up
- Add UI-support for `IContainerRuntime` in `devtools-view` (e.g.,
separately render `Containers` & `ContainerRuntime` in the devtools
pane): #25112
- Add interactive UI-support (e.g., dispose icon if disposed,
notification icon for the last-written devtools instance).

---------

Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base: main PRs targeted against main branch dependencies Pull requests that update a dependency file public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants