Add extensible component inspectors to DevTools

Open
#4,174 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
dart, flutter
Domain
devtools, game-dev

Research direction

Start by reviewing the smaller inspector issues and the connector registered through DevToolsService.registerConnector in flame_behavior_tree. Read doc/flame/other/debug.md for the existing debugging context. Done means the inspector API and JSON format are documented, a custom inspector can add a section without changing flame_devtools, read-only properties remain uneditable, and a throwing inspector does not break the panel.

Written by the indexing model from the issue text.

Description

enhancement
Problem to solve

The fields in the DevTools extension are hardcoded for a few component types. Games and bridge packages can't show their own properties, so each new type needs changes to both flame and flame_devtools.

Proposal

Add a data-driven inspector API, where the game describes each component's properties and the extension renders them generically.

  • A game-side inspector takes a Component and returns a titled section, or nothing if it doesn't apply. Sections appear in order.
  • Each property has a label, type, current value, optional description, and whether it is editable. Types should cover at least double, int, bool, string, Vector2 and Anchor. Doubles can also have a step, min and max.
  • Getters and setters are closures, so they stay in the game. Only the description goes to the extension as JSON. Writes come back by section and property name.
  • Packages register inspectors through DevToolsService.registerConnector, like flame_behavior_tree does for its connector.
Acceptance criteria
  • The JSON format is documented.
  • A custom inspector can add a section without changing flame_devtools.
  • Read-only properties can't be edited.
  • An inspector that throws doesn't break the rest of the panel.
  • The built-in fields are moved to the new API, or a follow-up issue covers that.
  • The API is documented in doc/flame/other/debug.md.
More information

Part of the work to move the flame_studio debugging features to flame_devtools. This is best done after the smaller inspector issues, so the design covers the real cases.

Dominant language
Dart
Stars
10.8k
Forks
1.1k
Avg merge
2d 4h
Merged PRs (30d)
61

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flame-engine/flame

All issues in flame-engine/flame

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.