docs(smartui): document the app capture half of the Figma-App CLI workflow - #3270
docs(smartui): document the app capture half of the Figma-App CLI workflow#3270chaitanyas-maker wants to merge 3 commits into
Conversation
…kflow The Figma-App CLI page documented only the Figma upload side of the workflow. Following it end to end produced a build containing Figma frames with nothing to compare them against, because the steps that capture and upload the app screenshots were never described. Adds the missing half and fixes several blocking and structural issues. Blocking fix: - Add LT_USERNAME and LT_ACCESS_KEY to the environment variable step. upload-figma-app signs its request with these and exits with "Missing LT_USERNAME in Environment Variables" when they are unset. Both sibling Figma pages already document them, this page did not. New content: - Step 6, upload the app to the real device cloud - Step 7, Appium capabilities including visual: true and smartUI.project, with a note that the app side is keyed by project name and not by PROJECT_TOKEN - Step 8, the screenshot hook shown in context rather than only the .png naming rule in isolation - A "How the comparison is paired" section covering the three conditions that must line up: same project, Figma build marked as baseline, and exact screenshot name match Reference gaps: - Add a Configuration Options table for depth, screenshot_names length and uniqueness rules, orientation, smartIgnore, exact device name matching, and the schema's rejection of unknown keys - Document the --fetch-results flag - Add Windows CMD and PowerShell env var tabs to match sibling pages Structural fixes: - Replace the two duplicate "Device Names" tabs, which held identical screenshot naming content and said nothing about device names - Regroup Troubleshooting by symptom, removing the orphaned Symptoms and Solutions fragments and the duplicate Project Type tabs - Move the support links footer out of the last tab so it always renders - Add the breadcrumb JSON-LD used by sibling SmartUI pages - Update the Figma URL example to the current /design/ form - Add trailing slashes to internal links Removes the "ensure both Figma and SDK uploads use the same --buildName" guidance. The app side has no such flag, it uses the smartUI.build capability, and the figma-web page's working sample deliberately uses different build names on each half. Replaced with the pairing rules that are verifiable in the CLI source. Flagged for reviewer confirmation against the backend comparison logic. Verified with a production build: no broken links, and the page renders clean in local preview. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0183Ta7Aq3y1eqoxfi4mBBnC
Ran the full workflow live against a new Real Devices project, a new
Figma file, and a real Pixel 8 / Android 14 device. Four builds were
produced and compared. Several statements on the page, including some
this branch had introduced, did not survive the run.
Fixes a broken code sample:
- `driver.execute("smartui.takeScreenshot", {name: "..."})` throws
`Error response status: 1`. The config-object key is `screenshotName`,
not `name`. This snippet was wrong on the published page and this
branch had reproduced it unchanged. Documented both forms that were
proven to work on device: the `smartui.takeScreenshot=<name>.png`
string form and the `{screenshotName: "<name>.png"}` config form.
Corrects the credentials section:
- LT_USERNAME and LT_ACCESS_KEY are NOT required by upload-figma-app.
Running with only PROJECT_TOKEN and FIGMA_TOKEN set, in a clean
directory with no cached state, uploads successfully. PROJECT_TOKEN
authenticates that endpoint. The earlier "mandatory, exits with
Missing LT_USERNAME" warning on this branch was wrong.
- The two variables are still needed, but for the Appium grid URL on the
app side, so the table now says where each value is actually consumed.
- Replaced the warning with the real trap: an empty-string value fails
while an unset value passes, because the guard compares against "".
Corrects two long-standing errors in Step 1:
- Approver(s) is mandatory and pre-filled, not optional.
- The button is labelled Continue, not Submit.
Softens the unknown-key claim:
- An unrecognised property logs a warning and the upload continues. It
does not fail validation. Reworded in the options note and in the
troubleshooting tab.
Also notes that the app upload response returns `app_url` directly in
lt:// form rather than an app_id the reader has to assemble.
The pairing rules this branch introduced are now confirmed empirically.
The Figma build and the Appium build carried different build names and
still compared, Baseline being the Figma frame and Captured the device
screenshot, so removing the old same-buildName guidance was correct.
Verified with a production build: no broken links.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0183Ta7Aq3y1eqoxfi4mBBnC
Live verification run, and two corrections to this PRI ran the whole workflow end to end against real infrastructure rather than reasoning from source: a new Figma file, a new Real Devices project ( The important one: a broken code sampleThe published page's "Critical" snippet does not work, and this branch had reproduced it unchanged: await driver.execute("smartui.takeScreenshot", {name: "homepage.png"});On device this throws await driver.execute("smartui.takeScreenshot=homepage.png");
await driver.execute("smartui.takeScreenshot", {screenshotName: "homepage.png"});Anyone following the current published page gets a failing test. I was wrong about LT_USERNAME / LT_ACCESS_KEYMy original PR description called this a blocking bug. It is not, and I have corrected the page. Running
The pairing rule is confirmedThis PR removed the "ensure both Figma and SDK uploads use the same
Different names, and the comparison still ran: Baseline = the Figma frame, Captured = the device screenshot, 89.2039% mismatch, variant Two long-standing Step 1 errorsVerified against the live Create-a-New-Project form: Approver(s) is mandatory and pre-filled, not optional, and the button is labelled Continue, not Submit. Both were wrong on the published page and both are fixed. Also confirmed working, as documented
Product defects found, not doc issuesFiling separately, noting here for context:
|
…nverified claims Second verification pass. Every code sample on the page has now been executed, and any statement that could not be executed was removed or narrowed rather than left standing. Fixes a second broken code sample: - The Java tab published `((JavaScriptExecutor) driver)`. That type does not exist. Selenium's interface is `JavascriptExecutor`, with a lower case s in script. Compiling the published spelling against selenium-api fails with `cannot find symbol`; the corrected spelling compiles clean. The corrected snippet was then run against a real Pixel 8 and the resulting screenshot was confirmed in the build. Note the same wrong spelling appears on the Appium hooks page. Verified and kept: - Python tab run on a real Pixel 8, screenshot confirmed in the build. - Duplicate `figma_ids` rejected with `figma_ids must contain unique values`. - Several `figma_file_token` entries in one config pass validation. Adds a troubleshooting group for Figma API limits: - Uploads fail during Processing App Figma when the Figma token sits in the low rate-limit bucket, which is where Viewer and Collab seats on free Starter workspaces land. Records the symptom, that a direct REST call can still succeed while the upload fails, and the practical ways out. - Adds the `Invalid token` case and the `file_content:read` scope the upload needs. Removed or narrowed because they could not be verified: - Deleted the claim that Appium with SmartUI supports viewport based comparisons only. Inherited from another page, never exercised. - Narrowed the device mismatch guidance from a causal claim about every comparison failing to a plain instruction to use the same device. - Narrowed `figma.depth` to what the generated config shows. The documented traversal semantics were never exercised. - Narrowed `smartIgnore` to what is observable, that the schema accepts it and it is forwarded with the upload. - Narrowed `--fetch-results` to what `--help` states. The flag exists, but writing results to disk remains unproven because the Figma rate limit blocked every attempt. Verified with a production build: no broken links. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0183Ta7Aq3y1eqoxfi4mBBnC
Verification pass 2: every code sample now executedPushed as 1762e5f. Goal this round was a page that asserts nothing unproven. Two outcomes: one more broken snippet found and fixed, and five claims removed or narrowed because I could not execute them. A second broken code sampleThe Java tab published: ((JavaScriptExecutor) driver).executeScript("smartui.takeScreenshot=homepage.png");
The corrected snippet was then run against a real Pixel 8 and the screenshot confirmed in the build as The same wrong spelling appears on the Appium hooks page, so it is worth a sweep beyond this PR. Verified and kept
New troubleshooting section: Figma API rate limitsUploads fail during Processing App Figma when the token sits in Figma's low rate-limit bucket, which is where Viewer and Collab seats on free Starter workspaces land. Roughly five uploads exhausted it and it did not clear across ~40 minutes of retries. Worth noting for reviewers: a direct Figma REST call can return 200 while the upload still fails, because the upload makes several calls per run. That makes the failure look inconsistent unless you know to expect it. Also documents the Removed or narrowed, because I could not verify them
Still outstandingThe design-matches-app comparison has not run. Every comparison so far has been a deliberate mismatch, so the page is proven to run but not yet proven to agree when design and build match. Blocked on the same Figma rate limit. Production build passes, no broken links. |
Problem
The Figma-App CLI page is titled "compare mobile app screenshots against Figma design frames", but every step on it uploads only the Figma side. There is no step that captures the app screenshots, no step that runs them on the grid, and no explanation of how the two halves get paired.
A reader who follows all five steps ends up with a build containing Figma frames and nothing to compare them against. The app side appears only as scattered hints inside Best Practices and Troubleshooting tabs, which assume the reader already knows the Appium setup the page never gives them.
Blocking fix
The page tells you to export
PROJECT_TOKENandFIGMA_TOKEN. The CLI also hard-fails withoutLT_USERNAMEandLT_ACCESS_KEY:src/lib/config.tsthrowsMissing LT_USERNAME in Environment VariablesandMissing LT_ACCESS_KEY in Environment Variablessrc/lib/uploadAppFigma.tsbuilds the request auth header as Basic from those two valuesBoth sibling pages document them (
smartui-cli-figma.md,smartui-cli-figma-web.md). This page did not, so anyone following only this page could not get past the upload step.What changed
New content, the missing half of the workflow
visual: trueandsmartUI.project, with a warning that the app side is keyed by project name and not byPROJECT_TOKEN.pngrule in isolationReference gaps
depth,screenshot_nameslength and uniqueness rules,orientation,smartIgnore, exact device name matching, and the schema's rejection of unknown keys--fetch-results [filename], which was implemented but undocumentedStructural fixes
**Symptoms**:/**Solutions**:fragments that had no body text, and the duplicate Project Type tabs/design/formOne point for reviewer confirmation
I removed the "ensure both Figma and SDK uploads use the same
--buildName" guidance, which appeared twice. Two reasons:--buildNameflag, it has asmartUI.buildcapability, so the instruction was not actionable as written.FigmaBaseline2andweb-build), relying on the Figma build being the baseline instead. The two pages contradicted each other.I replaced it with the pairing rules verifiable in the CLI source: same project, Figma build marked as baseline, exact screenshot name match. The comparison logic itself is server side and not in the CLI repo, so please confirm this against the backend behavior before merging.
Verification
docusaurus buildpasses, no broken links. The 48 broken-anchor warnings are pre-existing on other pages, none on this one.docusaurus/routes.jsslug:frontmatterSingle file changed, no lockfile churn.
🤖 Generated with Claude Code
https://claude.ai/code/session_0183Ta7Aq3y1eqoxfi4mBBnC