Skip to content

docs: fix the chart iframe examples in SKILL.md - #138

Merged
cryptotavares merged 1 commit into
mainfrom
cryptotavares/chart-iframe-examples
Dec 2, 2026
Merged

cryptotavares merged 1 commit into
mainfrom
cryptotavares/chart-iframe-examples

Conversation

@cryptotavares

Copy link
Copy Markdown
Collaborator

Summary: Fix the iframe examples in SKILL.md so they match how the Extension's advanced-chart-iframe is built: the chart canvas sits in a nested iframe that --frame cannot enter.

Part of the mm CLI v2 effort.

Problem

SKILL.md showed commands against the Extension advanced chart that cannot work as written. --frame enters one iframe level. The advanced-chart-iframe wrapper resolves to the chart page iframe, and the TradingView canvas is in a further, nested iframe. So hover --frame … --selector canvas matches nothing.

Live check on core 0.16.0 with the Extension test build:

$ mm hover --frame testid:advanced-chart-iframe --selector canvas
exit 4, MM_TARGET_NOT_FOUND: Selector [data-testid="advanced-chart-iframe"] >> xpath=descendant-or-self::iframe >> internal:control=enter-frame >> canvas matched 0 elements after 15000ms

Also, "No chart data" is the Extension's own empty state. It renders instead of the iframe, so a --frame wait for it cannot work.

What changes

Line Before After
describe-screen --frame comment "only the chart's nodes" "only that iframe's nodes … none here, the chart is nested"
hover --selector canvas iframe (the nested iframe that holds the canvas)
get-text --selector '<css in the chart>' '#tv_chart_container'
wait-for --selector 'text=No chart data' '#tv_chart_container'
After the block — One clause: --frame enters one iframe level, so target the nested iframe element
Intro paragraph The candlestick chart as an example of listed iframe content Removed; the chart's content is nested and is not listed

Docs only. yarn lint passes.

Review: read the "Inside iframes (browser)" section in SKILL.md.

Testing

Live check on the Extension test build (MM_HEADLESS=true, context e2e) with core 0.16.0+204f4091 via yalc:

Command Result
mm hover --frame testid:advanced-chart-iframe --selector iframe exit 0, hovered: true
mm get-text --frame testid:advanced-chart-iframe --selector '#tv_chart_container' exit 0, text: "\n\t"
mm wait-for --frame testid:advanced-chart-iframe --selector '#tv_chart_container' exit 0, found: true
mm screenshot --frame testid:advanced-chart-iframe exit 0, 798×321
mm describe-screen --frame testid:advanced-chart-iframe exit 0, 0 a11y nodes

With an empty OHLCV mock, chart-error-state shows "No chart data" and advanced-chart-iframe is absent.

@cryptotavares
cryptotavares marked this pull request as ready for review December 2, 2026 13:03
@cryptotavares
cryptotavares requested a review from a team as a code owner December 2, 2026 13:03
@cryptotavares
cryptotavares merged commit 3b206a5 into main Dec 2, 2026
27 checks passed
@cryptotavares
cryptotavares deleted the cryptotavares/chart-iframe-examples branch December 2, 2026 19:23
cryptotavares added a commit to MetaMask/skills that referenced this pull request Dec 4, 2026
## Description

Part of the mm CLI v2 effort.

> **Summary:** Updates the Extension `testing/visual-testing` skill for
`@metamask/client-mcp-core`
[0.16.1](https://github.com/MetaMask/client-mcp-core/releases/tag/v0.16.1).
`mm screenshot --selector` with `--timeout` now waits for a late
element, so the skill stops telling agents to `mm wait-for` first. The
chart notes now say that the canvas is in a nested iframe.

Pairs with the Extension bump
[metamask-extension#48494](MetaMask/metamask-extension#48494).
Follows [#316](#316) (0.16.0).

### Problem

| Skill text (0.16.0) | 0.16.1 behaviour (live) |
|---|---|
| "A selector that matches no element within 2 s fails with
`MM_TARGET_NOT_FOUND`, also with a longer `--timeout`; … `mm wait-for`
it first" | `screenshot --selector '#late' --timeout 10000`, element
added after 4 s: captured, exit 0, 4.1 s
([#139](MetaMask/client-mcp-core#139)) |
| A canvas-only chart iframe: use `get-text --frame … --selector body` |
The canvas is in a nested iframe. `--frame testid:advanced-chart-iframe
--selector canvas` matches 0 elements; `--selector iframe` and
`#tv_chart_container` work
([#138](MetaMask/client-mcp-core#138)) |

### What changes

All files are under `domains/testing/skills/visual-testing/`.

| File | Change | Core PR |
|---|---|---|
| `references/cli-reference.md` › Why a click failed, screenshots |
Without `--timeout`: 2 s `MM_TARGET_NOT_FOUND`. With it: waits that long
| #139 |
| `references/cli-reference.md` › Iframes | `--frame` enters one level;
target the nested iframe or `#tv_chart_container` | #138 |
| `references/error-recovery.md` | `MM_TARGET_NOT_FOUND` row; screenshot
row: retry with `--timeout` | #139 |
| `repos/metamask-extension.md` | `MM_SCREENSHOT_FAILED` bullet; chart
paragraph | #139, #138 |
| `CHANGELOG.md` | `[Unreleased]` entry | |

### Decisions

| Decision | Why |
|---|---|
| No change for **#131** (refs after a navigation) | The skill names
`role=`/`text=` refs only for elements that cannot be stamped, which is
still true. It never says refs fall back after a page load, or that the
observation shows the old screen. |
| No change for **#137** (`mm <command> --help`) | The skill does not
mention `<command> --help`. |
| No change for **#134** (device-mcp `^0.10.0`) | Mobile only. |

Review: read `references/cli-reference.md` › Element, iframe and
viewport screenshots first.

## Type of Change

- [ ] New skill
- [x] Skill improvement/update
- [ ] Bug fix
- [ ] Documentation update
- [ ] Other (please describe):

## Skill Details (if adding a new skill)

N/A

## Checklist

- [x] I have read the
[CONTRIBUTING.md](https://github.com/MetaMask/skills/blob/main/CONTRIBUTING.md)
guidelines
- [x] My skill follows the
[SKILL_TEMPLATE.md](https://github.com/MetaMask/skills/blob/main/.github/SKILL_TEMPLATE.md)
format
- [x] I have tested this skill with an AI agent
- [x] My skill does not contain any secrets, private keys, or sensitive
data
- [x] I have added appropriate documentation
- [x] My changes don't break existing skills

## Testing

| Check | Result |
|---|---|
| `yarn lint` | exit 0 |
| `yarn test` | 106 tests pass, 0 fail |
| `yarn audit:skills` | 100 skills, 0 errors, 134 warnings (same count
as `main`) |
| `git diff --check` | clean |

<details>
<summary>Live check</summary>

Extension worktree of metamask-extension#48494 (npm
`@metamask/client-mcp-core` 0.16.1; `.mm-server` `"version":"0.16.1"`),
test build 13.60.0.0, headless, `--context e2e --state default`,
unlocked. Nothing was confirmed or signed. The agent followed only this
skill.

| Command | Result |
|---|---|
| `screenshot --selector '#late' --timeout 10000`, element added after 4
s | exit 0, 200×40, 4.26 s |
| `screenshot --selector '#late'`, same injection | exit 4, `Selector
#late matched 0 elements after 2000ms`, 2.18 s |
| `screenshot --selector '#never' --timeout 3000` | exit 4, `matched 0
elements after 3000ms` |
| `screenshot --selector head --timeout 3000` | exit 1,
`MM_SCREENSHOT_FAILED` |
| `screenshot --frame testid:late-frame --selector '#inner' --timeout
10000`, iframe added after 3.5 s | exit 0, 3.52 s |
| `screenshot --frame testid:does-not-exist` | exit 4 after 2 s |
| Chart (overlay recipe): `hover --frame testid:advanced-chart-iframe
--selector iframe` | `hovered: true` |
| `get-text` / `wait-for --frame testid:advanced-chart-iframe --selector
'#tv_chart_container'` | exit 0 |
| `hover … --selector canvas --timeout 3000` | exit 4, `… >> canvas
matched 0 elements after 3000ms` |
| `describe-screen --frame testid:advanced-chart-iframe` | `nodes: []` |
| `screenshot --frame testid:advanced-chart-iframe` | 798×321, candles
drawn |
| `navigate-home` → `navigate-settings --observe full` (×5) | settings
test IDs, 24 nodes, no home test IDs |
| `navigate-home --observe none`, then `describe-screen` (×5) | 16
nodes, 16 `[data-mm-ref]` elements |
| `mm launch --help`, `mm stop --help`, `mm click --help` | exit 0,
usage, no daemon started or stopped |
| `mm frobnicate` | exit 2, `MM_INVALID_INPUT`, no `.mm-server` |
| `mock-network requests --url esplora` |
`…/v3/[REDACTED]/esplora/blocks?apiKey=[REDACTED]` |
| `.mm-daemon.log` | `POST /tool/screenshot 200 ok=true selector=#late
file=late-timeout-….png 4117ms` |

</details>

## Additional Context

- Core release:
https://github.com/MetaMask/client-mcp-core/releases/tag/v0.16.1
- Extension bump:
MetaMask/metamask-extension#48494
- Previous update (0.16.0): #316
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.

2 participants