Skip to content

Write the screenshot samples with the sampledoc package - #231

Merged
andiwand merged 1 commit into
mainfrom
use-sampledoc-package
Nov 14, 2026
Merged

andiwand merged 1 commit into
mainfrom
use-sampledoc-package

Conversation

@andiwand

@andiwand andiwand commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

The samples the store screenshots open were written by scripts/make-screenshot-documents.py. That was 1,500 lines of generator and translations, and OpenDocument.droid carried a newer copy of it. The generator now lives in its own repo, opendocument-app/sampledoc, and is published on PyPI as sampledoc. This PR switches the app to it.

  • scripts/requirements.txt pins sampledoc==0.1.0 next to storeframe (from Frame store screenshots with storeframe #232). The release workflow's screenshot job installs from it, and the file is part of that job's build cache key.
  • scripts/make-screenshot-documents.py is now a short wrapper with the same name, --language option and output folder (OpenDocumentReader/Samples), so the Fastfile is unchanged. It writes the 9 languages store_screenshots.LOCALES photographs, the same set as before, and exits if the installed sampledoc isn't the pinned version.
  • The format of screenshot-names.json changes. The languages are now nested under "languages", and the file also carries the locale table, as on Android. ScreenshotMode.swift decodes the new format; it's a 5-line change.
  • The screenshots README shows the install step.

The samples are unchanged. I ran the old script and the new wrapper: all 81 files are byte-for-byte identical, and each language's names and search word match.

Tested locally:

  • the full run, plus the error when sampledoc isn't installed
  • decoding the generated JSON with the new Swift structs
  • xcodebuild of the ODR Screenshots scheme for the iOS Simulator: BUILD SUCCEEDED

I haven't run a screenshot capture; the release workflow's screenshot job is the first real run.

The Android change is opendocument-app/OpenDocument.droid#759.

The samples the store screenshots open were generated by a 1,500 line
script that the Android app carried a newer copy of. Both now take them
from sampledoc (https://pypi.org/project/sampledoc/), pinned at 0.1.0 in
scripts/requirements.txt next to storeframe.

make-screenshot-documents.py stays as the entry point and writes the
languages store_screenshots.LOCALES photographs. It refuses to run
against a different sampledoc version than the pinned one. The samples
are the same, byte for byte, as the old script wrote.

screenshot-names.json now nests the languages under "languages" and
carries the locale table, as on Android; ScreenshotMode reads the new
layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FW6WZb2gUX4HQfKXWeZ3UQ
@andiwand
andiwand force-pushed the use-sampledoc-package branch from d7d1446 to 1a048c6 Compare November 14, 2026 14:24
@andiwand
andiwand merged commit c597b23 into main Nov 14, 2026
4 checks passed
@andiwand
andiwand deleted the use-sampledoc-package branch November 14, 2026 14:26
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