Skip to content

docs(studio): write down what Studio does not tell you about itself - #3165

Merged
miguel-heygen merged 1 commit into
mainfrom
docs/studio-agent-guide
Aug 10, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
docs/studio-agent-guide

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

packages/studio/AGENTS.md — a short guide for an agent or a person making their first change in Studio. Pointed at from the project-structure list in the root CLAUDE.md and AGENTS.md.

Why

Everything in it cost real time to rediscover, and none of it is visible from the source:

  • The chrome is drawn in Studio's document over an iframe, so it is a measurement of an element, not the element. When chrome disagrees with the pixels, the bug is in the measurement.
  • Some gestures cannot be synthesised. The canvas takes pointer capture and recognises a double press itself, so page.mouse click pairs never open a text edit. window.__studioTest.selectByDomId(id) exists for exactly this and is easy to miss.
  • The diagnostic channels are off by default and there is no hint they exist.
  • Bare bun test in this package reports failures that are not real.
  • happy-dom does not reflect the individual transform properties into computed style and has no DOMMatrix, which turns a correct fix into a failing test.
  • The gates that reject a PR: the 600-line cap, fallow complexity, oxlint and oxfmt.

How

Scoped to the package, following the existing docs/AGENTS.md precedent rather than growing the root files.

Every claim was verified against the source on main: the channel names against makeStudioDebugLogger call sites, the test-hook gate against STUDIO_TEST_HOOKS_ENABLED, and the file-size rule against the CI workflow. Nothing about the in-flight rich-text editor is described here, since it is not on main yet.

Test plan

  • Documentation only, no source change
  • __studioTest.selectByDomId was used to drive a real verification this week, which is what prompted writing it down

Working in packages/studio for the first time costs a day rediscovering things
the source does not show: that the chrome is a measurement drawn in Studio's
document over an iframe, that some gestures cannot be synthesised at all so a
driver needs window.__studioTest, that the diagnostic channels exist and are
off by default, that bare `bun test` reports failures that are not real, and
which gates reject a PR.

Scoped to the package, following docs/AGENTS.md, and pointed at from the
project-structure list in both root files so it is found before the first edit
rather than after.
@miguel-heygen
miguel-heygen merged commit 604f02b into main Aug 10, 2026
37 of 40 checks passed
@miguel-heygen
miguel-heygen deleted the docs/studio-agent-guide branch August 10, 2026 19:11
miguel-heygen added a commit that referenced this pull request Aug 10, 2026
oxfmt formats markdown, and the file added in #3165 was not run through it.
main's Format check has been failing since that merge, which also fails every
open PR, since CI checks the merge with main.
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.

1 participant