Repository navigation
Add an HTML design system gallery with native component captures - #1121
Open
ivanfenenko wants to merge 4 commits into
Open
ivanfenenko wants to merge 4 commits into
ivanfenenko wants to merge 4 commits into
Conversation
scripts/component-gallery replicates every design-system component in HTML with iOS and Android phone frames, themes, states, specs, and a Native tab that shows simulator and emulator captures of each state. npm run gallery serves it, gallery:check checks coverage, and gallery:html-captures renders the HTML side for the swipe comparison. Adds the component-captures skill.
…llery Adds a debug-only capture registry and host next to the Component Gallery, a UI test that saves one PNG per component state in light and dark, and scripts/component-gallery/capture-ios.sh. Gallery sample data moves into shared fixtures so the captures reuse it.
… gallery Adds a debug-only capture registry, an instrumented test that saves one PNG per component state in light and dark, and scripts/component-gallery/capture-android.sh. Gallery sample builders become internal so the captures reuse them.
There was a problem hiding this comment.
Automated review: no finding that 2+ of 3 passes agreed on.
8 finding(s) from a single pass, not posted
scripts/component-gallery/capture-android.sh:210high: Android capture never fails on missing tiles (muse-spark-1.3-contributor)scripts/component-gallery/check.mjs:18high: Gallery check ignores per-state coverage (muse-spark-1.3-contributor)ios/OpenCode Mobile/OpenCode Mobile/Components/Input/OpenCodeKeyboardFocusable.swift:277medium: Delayed capture focus not cancelled on disappear (muse-spark-1.3-contributor)android/app/src/androidTest/java/dev/opencode/mobile/ui/componentgallery/capture/ComponentCaptureTest.kt:259medium: Overlay crop can go out of screenshot bounds (muse-spark-1.3-contributor)ios/OpenCode Mobile/OpenCode Mobile/ComponentGallery/Capture/ComponentCaptureHost.swift:143medium: Stale tile frame reported for next step (muse-spark-1.3-contributor)scripts/component-gallery/render-html.html:14medium: Center-aligned components render left-aligned in HTML captures (deepseek-v4.1-flash)scripts/component-gallery/shell.js:108low: Unvalidated theme id from the URL hash crashes the gallery (deepseek-v4.1-flash)scripts/component-gallery/native-tab.js:14low: Skipped captures recorded with state "*" are shown as merely missing (deepseek-v4.1-flash)
opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.136
…evices Divergence notes now load at build time from the git-ignored divergences/ folder instead of living in the component files. The capture scripts refuse simulators and AVDs that are not dedicated capture devices, clean up their staging folder, write one log per run, and pick a phone system image for the host CPU. The gallery server returns 400 for malformed URLs. iOS capture focus hooks compile only in Debug and the pressed preview never matches in Release. Gallery sample paths use /Users/example.
This branch has not been deployed
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.
Summary
Adds an internal design system tool: an HTML replica of every Component Gallery entry on both platforms, with real simulator and emulator captures of each state next to it.
HTML gallery (
scripts/component-gallery/)docs/devices/iphone-duo/geometry.json.ThemeResolver, plus text size.build.mjs.npm run gallerybuilds and serves it with live reload.npm run gallery:checkfails when a native gallery entry has no HTML component.Native captures
scripts/component-gallery/capture-ios.sh. A full run takes about 5 minutes.scripts/component-gallery/capture-android.sh. A full run takes about 3 minutes.Component Capture…/component_capture…), so a personal device is never erased or reconfigured.captures/contract.json, exported from the HTML gallery so state ids match across HTML, iOS, and Android. States a platform cannot draw are recorded as skipped with a reason; approximations carry a note.npm run gallery:html-capturesrenders the HTML side at the native width and scale, for a swipe comparison in the Native tab.App code touched outside the gallery
internal, so captures reuse it.OpenCodePressedPreview.swift): an environment value the press styles of Button, Floating Chrome, Floating Pill Chrome, Action Tile, List Item, and Hunk Navigation Pill read next toisPressed. It compiles into Release but never matches there, so it cannot change the app.OpenCode_MobileApp.swift. Dialog and Modal cards areinternal.AppearanceSettingsView.swiftandAppearanceSettingsScreen.kt: the syntax sample isinternal.Skill
.agents/skills/component-captures/explains how to recapture after changing a component, and how to add captures for a new component or state.Checks
npm run gallery.:app:compileDebugKotlin,:app:compileReleaseKotlin,:app:compileDebugAndroidTestKotlin, andcomponentgalleryunit tests pass after rebasing onmain.build-for-testingsucceed after rebasing onmain. Unit tests for touched components passed before the rebase.npm run gallery:checkpasses (82 of 82).Risks / Follow-ups
scripts/component-gallery/divergences/folder when present. None are committed, since they are unverified.