Skip to content

Ship question-type screenshots as a release asset (and regenerate them) #171

Description

@jstet

screenshots/<slug>/{limesurvey,xlsform}.png render each registry type as a respondent sees it. Nothing consumes them yet, but the survey site wants exactly these: its fragetypen page has LimeSurvey and KoboToolbox tabs per example that currently say "Screenshot folgt" (CorrelAid/cdl-wp-eins, QuestionTypeBlock.astro). qwacback's examples are the registry fixtures (e.g. qwacback single_choice = registry/entities/select_one/fixtures/xlsform.json, pinned at v0.7.1), so the screenshots match them one to one.

Site-side proposal: CorrelAid/cdl-wp-eins#33.

State today

  • Last generated in the initial commit (2026-08-05). The registry has changed a lot since, up to v0.7.1.
  • range has no screenshots.
  • Not in the npm package or the release assets. The only way to get them is the repo tree on main, which isn't versioned.

Proposal

  1. Regenerate all screenshots against the current registry (uv run codegen --screenshots).
  2. Release asset formtransform-screenshots-<version>.tar.gz, next to cdl-survey-types-* and formtransform-fixtures-*, with a manifest.json:
    {
      "version": "0.7.1",
      "types": {
        "select_one": {
          "limesurvey": { "file": "select_one/limesurvey.png", "width": 1930, "height": 758, "engine": "LimeSurvey", "theme": "fruity_twentythree" },
          "xlsform":    { "file": "select_one/xlsform.png",    "width": 1296, "height": 450, "engine": "Enketo" }
        }
      }
    }
    Width/height let consumers reserve layout space. engine makes clear the XLSForm shot is Enketo (the engine behind KoboToolbox web forms), not the Kobo UI itself.
  3. Completeness check (in codegen or CI, cheap, no Docker): every registry entity (types, variants, composites) has both PNGs, and no PNG exists for a slug that isn't registered. That keeps them from going stale silently, the way range did.
  4. Optional: note the registry version a screenshot was rendered from in the manifest, so a consumer can warn when it's older than the entity.

Consumers (planned)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions