Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- **The landing page no longer claims an "Official Docker image".** No workflow builds or pushes one, Docker Hub has no repository for the organization, and the repository only holds `docker/Dockerfile`; the page now says "A Dockerfile for self-hosted CI is in the repository." `scripts/site_docker_claim_test.go` fails if a page says "Docker image" while no workflow publishes one. Website text only.
- **`probe lint` prints `line N:` before a program-level warning, and the docs tests cover what review found missing.** A change to the lint output format for a script that parses it: the warnings of the program checks (a test with no steps, a recipe name a call cannot reach, the dart share) were printed as the message alone and now start with `line N:`, like the reference findings; a message that already names its line (the count and zero-state warnings, `test "x", line 4: ...`) is printed as it was, so the line is not said twice (`programFindingText`, with a case table and the real findings). Test-only: `scripts/docs_go_install_test.go` (whose walk now also has a test that plants a bad target in one file of each kind: documents, workflows, scripts, `Makefile`, `GNUmakefile`, `*.mk`, `Dockerfile*`, `Containerfile`, and checks that the skipped places stay skipped) now splits a `go install` command as a shell would (flags and their values such as `-tags netgo` and `-C dir`, `$(...)` groups that nest, line continuations, `go install`, several targets on one line) and also reads Makefiles, `*.mk`, `Dockerfile*` and scripts; `scripts/site_internal_links_test.go` checks that every internal link in the website's sources (`](/path/)` and `href="/path/"`) and every `slug` and `link` of the sidebar in `astro.config.mjs` has a page (a docs page, a `src/pages` page or a `public/` file; anchors and sidebar labels are not checked), and ten links that had none are fixed (`/advanced/hooks/` and `/advanced/recipes/` are `/probescript/hooks/` and `/probescript/recipes/`, `/tools/ai-generation/` is `/tools/ai/#test-generation`, `/tools/recorder/` is `/tools/recording/`); `scripts/docs_device_ids_test.go` fails when a Markdown document under `docs/`, the website's documentation pages or the README carries a simulator UDID (the placeholder UDIDs of the examples are allowed) or an emulator serial other than the default `emulator-5554` and `emulator-5556`, or a link to a private page of an AI assistant (`claude.ai` artifacts, chats, shares); the identifiers that were there (an emulator serial in `MATRIX.md`, `RELEASES.md` and the crash-capture spike, a simulator UDID, an agent port) are replaced by the device's name, and a link to a private artifact in the 2026-08 gap analysis is removed; the Gestures scroll cell of the matrix says "not assessed" like the Layout row, and the fixture README's family list has its commas and mentions the widgets below the fold. `tools/vscode.md` now says that the VSIX build keeps the device-view placeholder unless the Studio device-view bundle was built, that `vsce` warns about the missing LICENSE, and, with the tool versions, that `npx vsce package --no-dependencies` wrote the package where `npm run package` failed on a clean install (`Extension entrypoint(s) missing`; the cause was not found). `scripts/docs_install_snippets_test.go` has cases that go through the snippet splitter (a blank line inside a snippet; the steps `- name:`, `- uses:`, `- id:` and `- run:` are separate snippets), understands `install -m 755`, `install -t`, a move to a full file path, several `curl -O` URLs and `chmod a+rx`, `+rx` and `u=rwx`. The Studio Go tests (`go test ./...` in `studio/`) pass with a stub `frontend/dist`; a fresh checkout has no `dist` (it is gitignored and embedded by `main.go`), which stops the package before any test.
- **`docker/README.md` and the header of `docker/Dockerfile` no longer tell people to run an image that does not exist, and the guard against such claims is wider.** Both said `docker run ... ghcr.io/flutterprobe/ci:latest`; no workflow builds or pushes an image, and nothing built from the Dockerfile is published. They now say to build it yourself from the repository root (`docker build -f docker/Dockerfile -t probe-ci .`, because the Dockerfile copies the source), and that it is not verified: it has not been built by whoever last edited it, it installs Go 1.23.0 while `go.mod` requires a newer Go, and it declares a `PROBE_VERSION` argument that nothing uses. `scripts/site_docker_claim_test.go` now reads `README.md`, `docker/README.md`, `docker/Dockerfile`, `docs/` (except research, PRD and evidence), and `website/src` (pages and documentation pages), matches "Docker image(s)", "container image(s)" and `ghcr.io/`, and counts a workflow as publishing only when its YAML has a `docker/build-push-action` step with `push` not false or a `docker push` / `docker buildx build --push` line that is not a comment, in `*.yml` and `*.yaml` files. Documentation and a test only.
- **On Flutter 3.50 the agent saw the children of an `IndexedStack` that are not shown, and the items of a closed `DropdownButton` (issue #900).** `see "<text>"` passed and `don't see "<text>"` failed for them, and the visible summary and the Studio device view listed them. Flutter 3.44 wrapped each hidden child in a `Visibility(visible: false)`, which the agent recognised; 3.50 does not, and the child stays mounted, laid out and attached, hidden only by the stack's render object. A widget under a child that is not at the stack's `index` is now not visible, in either version (a `null` index shows none; nested stacks count each level; a child shown again is found again with its state). An ordinary `Stack` is unchanged. Needs the agent from this release (`probe_agent`): an app with an older agent on Flutter 3.50 keeps the old answer. Measured in agent widget tests on Flutter 3.44.8 and 3.50.0, not on a device or in an app with tab pages.

### Security
- **The Studio automation discovery file is checked like the MCP token file, by the same code.** The file holds the automation token. Studio created its folder 0700 and wrote the file 0600, but did not re-check an existing folder or file, did not refuse a link at either name, and fell back to the system temp folder when the user had no config folder. It now goes through one writer for every secret file (the new `internal/secretfile`, which `probe-mcp --http` uses for its token file as well): a folder or file that is a link, a file that is not a regular file, one that belongs to another user or that others can reach is refused and not repaired; the file is written to a new 0600 file and renamed into place, so it is never written through a link; with a file named by `PROBE_STUDIO_AUTOMATION_FILE` the folder is the person's own, so it only has to be a real folder of theirs that others cannot write to; and with no user config folder and no named file the endpoint does not start (the shared temp folder is not a fallback). On exit a server removes the file only while it holds its own document, and never waits on what is at the name (a pipe planted there made removing it wait for a writer, and with it Studio's start-up). A write that fails removes its temporary file, and the next write removes the ones an earlier crash left: only a file named exactly like the ones this code makes (the file's name, a dot and a decimal number of at most ten digits), a regular 0600 file of this user, older than ten seconds. A file such as `automation.json.bak` next to it is never touched, whatever the folder. A file of the person's own that is named exactly like a temporary file (`automation.json.` and one to ten digits), is a regular 0600 file and is older than ten seconds is taken for a stale one and removed. Two limits, on purpose: only the last component of the path is checked, so a link in a folder above (such as `~/.config` pointing elsewhere) is followed, as the person set it up; and on Windows the mode and owner checks are skipped, because file modes there do not say who can read a file.
Expand Down
1 change: 1 addition & 0 deletions docs/compat/MATRIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ the radio's own group value when it has one and otherwise the nearest `RadioGrou
- **Tooltips are selectors**: an icon button or a floating action button, which show no text, are found by their tooltip text, the same way they are by `#id`.
- **`is enabled` / `is disabled` on a wrapper read the control it holds** (issue #860, agent change): with the id on a keyed `SizedBox`, a `KeyedSubtree` or a `Semantics(identifier:)` around a disabled button, `is enabled` used to pass. The agent now reads the target, then the controls it holds (the first on each branch), then its ancestors; held controls that agree give the answer, controls that disagree refuse ("holds 2 controls that disagree"). Measured in agent widget tests (the fixture puts its ids on the controls themselves, so its suites did not hit this). Only the controls the agent reads count: a disabled `Radio`, `CupertinoButton`, `Slider` or `DropdownButton` still passes `is enabled` (issue #864).
- **A button inside an `IgnorePointer` gets no tap, and the step says so** (issue #842, agent change): before, `tap` passed with no warning while nothing happened, so even `--fail-on-warning` passed. Now the step prints `tap target ... is inside an IgnorePointer, so it receives no taps` when the `IgnorePointer` cuts off a handler of the target's own (a button's own `InkWell`), and `--fail-on-warning` fails it. A passive label inside an `IgnorePointer` under a parent that takes the tap (a `ListTile` whose title is wrapped) gets the tap and no such message. Measured in agent widget tests and with the `layout` screen of the Layout family on both named devices. Not handled: a `GestureDetector` around an `IgnorePointer` around a passive text gets no tap and nothing warns (noted in issue #842).
- **A child of an `IndexedStack` that is not shown, and the items of a closed `DropdownButton`, are not on screen** (issue #900, agent change): `see` passed and `don't see` failed on them on Flutter 3.50.0, because only Flutter 3.44.8 wraps each hidden child in a `Visibility(visible: false)`, which was the one thing the agent recognised; in both versions `RenderIndexedStack` paints and hit-tests only the child at its `index`, and the hidden child stays mounted, laid out at its size and attached. The agent now reads the stack's index (a `null` index shows nothing; nested stacks count each level). Measured in agent widget tests (`probe_agent/test/indexed_stack_hidden_test.dart`) on Flutter 3.44.8 and 3.50.0, no device: before the change 9 of its 10 tests failed on 3.50.0 (the tenth is the ordinary-`Stack` control) and all passed on 3.44.8; after it all pass on both. The `Pickers and menus` row stays "not assessed": no fixture screen or device test covers `DropdownButton`, so no cell changed (the count in `NEXT.md` stays 10). Not measured: an app with tab pages in an `IndexedStack`, `tap` on a device, other widgets that hide children without an `Offstage` or `Visibility` widget.

Not covered by the screen: `ButtonBar` (deprecated in the catalog), `ToggleButtons` and `SegmentedButton` (selection), `PopupMenuButton` and `DropdownButton` (pickers and menus), a button inside a dialog or a list, a double tap, a button that scrolls into view, and a button under an overlay. The 8 variants of the suite that must fail
(`probe-tests/negative/buttons.probe.expect-fail`) were run: all 8 fail with the message that says why (a count one too many, `is disabled` on an enabled button and `is enabled` on a disabled one, the disabled button's counter expected above 0, a held press taken for no tap, a label that is not on the screen, a tap taken for a long press, one button's tooltip finding another).
Expand Down
1 change: 1 addition & 0 deletions probe_agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

- Added: `probe.ping` also reports, when the app's build knows them, `flutter_version`, `flutter_channel`, `framework_revision` and `dart_version`: the Flutter and Dart that BUILT THE APP (the Flutter tool puts them into every app build as compile-time defines, which the agent reads directly), not the Flutter that published this package. Each is left out when unknown, empty or not plain version text (letters, digits, dots, dashes and plus signs, at most 64 characters); the Dart version falls back to the running VM's. An older CLI ignores the fields and an older agent sends none. A fork or a custom embedder can report values that are not the real ones.
- Added: `see #field is filled` and `see #field is empty` (and their `don't see` forms): whether a text field holds at least one character. The check asks only whether the length is above zero, so the value is in no answer, error or hint, and an obscured (password) field is answered like any other. It looks at the matched widget and below it, never at an ancestor or a sibling, so a label next to a field cannot be mistaken for it; a widget that is not exactly one text field (a label, a button, a container with none or several fields) is refused (`is not a text field`, `holds N text fields`), also by a negated check, instead of passing. A pattern sent with it is refused (`invalid params`). The agent reports the new capability `see_filled`; an agent without it passes any state word it does not know, so the CLI refuses the step before sending it to one.
- Fixed: on Flutter 3.50 the children of an `IndexedStack` that are not shown, and the items of a closed `DropdownButton` (which keeps them in an `IndexedStack`), were seen: `see` passed and `don't see` failed (issue #900). Flutter 3.44 wrapped each hidden child in a `Visibility(visible: false)`, which the agent recognised; 3.50 does not, and the hidden child stays mounted at its size. A widget under a child that is not at the stack's `index` is now not visible (a `null` index shows none, nested stacks count each level), in `see`, `tap`, the selectors, `probe.visible_summary` and the device view. An ordinary `Stack` is unchanged.

## 0.27.0 - 2026-11-11

Expand Down
10 changes: 8 additions & 2 deletions probe_agent/lib/src/device_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:flutter/material.dart'
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';

import 'finder.dart' show ProbeFinder, probeRouteOf;
import 'finder.dart' show ProbeFinder, probeIndexedStackShown, probeRouteOf;
import 'protocol.dart';

// Support for the interactive device view (probe.tap_at, probe.long_press_at,
Expand Down Expand Up @@ -193,7 +193,13 @@ List<ProbeNode> collectProbeNodes() {
} catch (_) {
// Element may be disposed or mid-build during the walk: skip it.
}
e.visitChildren((c) => visit(c, childParent));
// An IndexedStack lists only the child it shows.
final shown = probeIndexedStackShown(e);
var position = 0;
e.visitChildren((c) {
if (shown == null || position == shown) visit(c, childParent);
position++;
});
}

root.visitChildren((c) => visit(c, -1));
Expand Down
47 changes: 45 additions & 2 deletions probe_agent/lib/src/finder.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/cupertino.dart' show CupertinoTextField;
import 'package:flutter/material.dart' show TextField, Tooltip;
import 'package:flutter/rendering.dart' show RenderIndexedStack;
import 'package:flutter/widgets.dart';

import 'textfold.dart';
Expand Down Expand Up @@ -39,6 +40,39 @@ ModalRoute<dynamic>? probeRouteOf(Element element) {
return found;
}

/// The position of the child an [IndexedStack] shows, when [element] is the stack's own element; null for any other element.
/// -1 means it shows nothing (an index of null, or out of range of the children).
///
/// What hides the other children is the render object: `RenderIndexedStack` paints, hit-tests and reports semantics for the
/// child at its `index` only, and that is the same in every Flutter version. Some versions (3.44) also wrap each child in a
/// `Visibility(visible: false)`, which the rules below recognise; others (3.50) do not, and the child stays mounted, laid out
/// at its size and attached, so no other check sees it as hidden. The `DropdownButton` keeps its items in an `IndexedStack`, so
/// a closed one hides them the same way. An ordinary `Stack` shows all its children and is not touched.
int? probeIndexedStackShown(Element element) {
if (element is! MultiChildRenderObjectElement) return null;
final RenderObject ro;
try {
ro = element.renderObject;
} catch (_) {
return null;
}
if (ro is! RenderIndexedStack) return null;
return ro.index ?? -1;
}

/// Whether [child] (a child element of [stack]) is under the child [stack] shows. True when [stack] is no IndexedStack.
bool probeIsShownChild(Element stack, Element child) {
final shown = probeIndexedStackShown(stack);
if (shown == null) return true;
var i = 0;
var position = -1;
stack.visitChildren((c) {
if (identical(c, child)) position = i;
i++;
});
return position == shown;
}

/// ProbeFinder translates ProbeLink SelectorParam JSON into Flutter elements
/// by walking the live widget tree. Does NOT use flutter_test finders since
/// those require TestWidgetsFlutterBinding.
Expand Down Expand Up @@ -385,11 +419,15 @@ class ProbeFinder {
final route = probeRouteOf(element);
if (route != null && !route.isCurrent && !_routeOnScreen(route)) return false;
// Walk up the tree to check for Offstage / Visibility ancestors
// An IndexedStack shows one child: a widget under any other child is hidden (its render object paints nothing for it).
Element? current = element;
Element? below;
while (current != null) {
final widget = current.widget;
if (widget is Offstage && widget.offstage) return false;
if (widget is Visibility && !widget.visible) return false;
if (below != null && !probeIsShownChild(current, below)) return false;
below = current;
current = _parentElement(current);
}
return true;
Expand Down Expand Up @@ -493,8 +531,13 @@ class ProbeFinder {
if (widget is Visibility && !widget.visible) return;
visitor(element);
if (skipChildrenOf != null && skipChildrenOf(element)) return;
element.visitChildren(
(child) => _visitElement(child, visitor, skipChildrenOf));
// An IndexedStack walks only the child it shows.
final shown = probeIndexedStackShown(element);
var position = 0;
element.visitChildren((child) {
if (shown == null || position == shown) _visitElement(child, visitor, skipChildrenOf);
position++;
});
}

/// FP-13: a short snapshot of what a user could currently see — visible
Expand Down
Loading
Loading