ui_commenter 0.1.1
ui_commenter: ^0.1.1 copied to clipboard
Debug-only Flutter tool: tap any widget in the running app, comment on it, and copy a ready-to-paste prompt (source location, type, key, ancestry) for a coding agent.
0.1.1 #
- Overlay layout — the edit button now sits below the pick-widget button on the draggable FAB stack.
- macOS & Windows support — desktop is now a supported target. The capture
pipeline was already platform-agnostic; this hardens path handling so
SelectedWidget.relativeLocation(and theFile:prompt line) normalizes Windows backslash creation paths to forward slashes, matching the existing local-file heuristic. The example app gainsmacos/andwindows/runners (verified building and running on macOS), and new tests cover Windows paths. - Widget inspector — a read-only, debug-only detail view for the selected
widget, opened from a new inspect button on the comment sheet's identity frame:
- a
CustomPainterbox diagram showing the widget nested in its parent with per-side padding and the widget's ownw/h; - a geometry block (size, global offset, incoming constraints, parent offset, flex, render-object type);
- a default-aware diagnostic-property table (
debugFillPropertiesoutput with adefaultbadge), plus copy-location / copy-properties shortcuts. - Reads fresh data lazily from the live
Elementon tap (threaded per-WidgetComment), degrading to identity-only for defunct/zero-size widgets; no public API change and no impact on the capture/copy pipeline.
- a
0.1.0 #
- Initial release.
- Public API:
UiCommenter,UiCommenterConfig,WidgetComment,SelectedWidget. - Debug-only gate (
enabled && kDebugMode) that returns the child untouched and is tree-shaken out of release/profile builds. - Capture pipeline:
- geometric hit test that selects the deepest project-local widget — including
Text/Iconleaves whosehitTestSelfisfalse; - creation-location resolution via
WidgetInspectorServicewith a tolerant JSON parser and a package-aware local-file heuristic (config.localPathPredicateoverride for monorepos/melos); - default prompt formatter (single + multi-widget forms) replaceable via
config.promptBuilder.
- geometric hit test that selects the deepest project-local widget — including
- Overlay UI: draggable toggle FAB with comment-count badge and re-open mini-FAB, selection highlight, and a controlled comment sheet with prev/next navigation, per-comment trash, Clear All, and Copy Prompt.
- Theming: the tool UI follows the host app's light/dark theme by default;
config.brightnessforces the tool's brightness independently of the app (the host subtree keeps its own theme). - Example app and unit/widget test coverage for formatting, path classification, hit testing, and overlay list/navigation behavior.