Phonebook: a Storybook-style preview gallery for SwiftUI and Compose
Описание и применение
Phonebook автоматически собирает существующие @Preview и #Preview из кода мобильных приложений и публикует статический HTML‑каталог, позволяя дизайнерам, PM и QA просматривать все состояния UI без IDE.
Задача
Designers, PMs, and QA often need to view all UI states (enabled/disabled, dark mode, empty, loading) but native preview tools are confined to the developer IDE and cannot be easily shared.
Результат
Phonebook turns existing mobile UI previews into a shareable, static gallery, eliminating the need for separate Storybook setups or external screenshot services.
Рабочий процесс
- 1. Add phonebook.config.json to the project root specifying appName, platform, and Android modules/variant or iOS settings.
- 2. Run
phonebook generate phonebook buildon CI or locally;generaterenders previews using Robolectric/Roborazzi and outputs a bundle (manifest.json, images). - 3.
buildconsumes the bundle and writes a plain static site (index.html, assets). - 4. Deploy the generated folder to GitHub Pages, S3, Netlify, or any static host, or open it locally.
- 5. Stakeholders view the gallery to inspect all UI states without needing IDEs or debug builds.
Доказательства
Phonebook has two main commands: phonebook generate phonebook build
Phonebook does not care. You can open it from file://. You can upload it to GitHub Pages.
- Дата записи: 2026-09-09T08:31:21.320Z