Repository navigation
Fix root yarn clean recursion and desktop-driver element screenshots - #4394
Merged
Merged
Conversation
Contributor
Bundle size reportTree-shaken, minified production esbuild bundles with React and React Native runtimes externalized.
The job is advisory: size changes are reported but do not fail the pull request. Bundle or analysis errors still fail. |
Jason Morse (JasonVMo)
enabled auto-merge (squash)
October 26, 2026 19:22
Ruriko Araki (rurikoaraki)
approved these changes
Oct 26, 2026
Vladimir Morozov (vmoroz)
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Platforms Impacted
Repository tooling only: the root clean script and the platform-neutral Desktop Driver WebdriverIO commands used by macOS, Windows, and Win32 desktop tests. No component or native source changes.
Description of changes
Root
yarn cleanno longer recurses. The rootcleanscript runstsc -b --clean && lage clean, and Lage'scleanpipeline included the root workspace, so it re-ran that script indefinitely.lage.config.mjs: adds a@fluentui-react-native/root#cleanno-op target so Lage skips the root script while still cleaning every package.scripts/src/tasks/clean.test.mjs(wired intoscripts/package.json): regression test for the root script, the no-op root target, and the unchanged genericcleantarget.references/agents/repository/development.md: documents the behavior.Desktop Driver
element.takeScreenshot()now captures the element. WebdriverIO elements inherit the session-widetakeScreenshotprotocol command, soelement.takeScreenshot()calledGET /session/:id/screenshotand returned the whole window. The server's element screenshot route and the native crop were already correct.packages/agentic/desktop-driver/src/wdio/DesktopWebdriver.ts:installDesktopWebdriverCommandsregisters an element-scopedtakeScreenshot(addCommand(..., { attachToElement: true })) that delegates totakeElementScreenshot(this.elementId). This applies toconnectDesktopWebdriver,attachDesktopWebdriver, and WDIO-managed browsers.browser.takeScreenshot()still captures the window. When the target does not support element capture, the call fails instead of falling back to a window image.src/wdio/screenshots.contract.cjsandDesktopWebdriver.test.ts: fake-host regression covering connected, attached, and raw-WDIO-attach browsers, with distinct window and element payloads. It also checkssaveScreenshotand that unsupported element capture fails.references/test-integration.md: documents the behavior..changeset/desktop-element-screenshots.md: patch for@fluentui-react-native/desktop-driver.Related: #4345 (not closed by this PR).
Verification
Automated (run on macOS):
yarn cleanat the root: passed; it completes and exits instead of recursing.yarn format && yarn lint && yarn build && yarn testinscripts: passed (53 tests).yarn format && yarn lint && yarn build && yarn testinpackages/agentic/desktop-driver: passed (69 passed; 3 opt-in native helper contract tests skipped, as they are by default). The new regression failed before the fix: the supported path returned window data, and the unsupported path succeeded instead of throwing.yarn change:check: passed.yarn clean-lage-cache && yarn lage buildci: passed (175/175 tasks).Manual native check, macOS Fabric,
apps/storybook:yarn storybook bundle --macos,yarn storybook prep --macos,yarn storybook build --macos: passed.yarn storybook driver --macos+yarn storybook run --macos, thenyarn storybook test --macos --test "supports native pointer activation": passed (1/1).components-button--defaultthrough bothconnectDesktopWebdriver({ launchMode: 'attach' })andattachDesktopWebdriver(...): passed. For the button (64.5 × 34pt at 2× scale),element.takeScreenshot(),browser.takeElementScreenshot(id), andelement.saveScreenshot(path)all returned the same129 × 68PNG showing only the button.browser.takeScreenshot()returned the2720 × 1988window.Not run: Windows and Win32 native lanes. The change is in the platform-neutral WDIO layer and uses the existing element screenshot route.
yarn cleanat the root re-invoked itself indefinitely.yarn cleancleans every workspace once and exits.element.takeScreenshot()returned the full window (2720 × 1988on macOS).element.takeScreenshot()returns the element crop (129 × 68for the Storybook button), matchingbrowser.takeElementScreenshot().Pull request checklist
This PR has considered (when applicable):