Skip to content

Let a split hero also draw a text-free image - #3

Merged
RyanEwen merged 1 commit into
mainfrom
store-hero-plain-output
Nov 24, 2026
Merged

RyanEwen merged 1 commit into
mainfrom
store-hero-plain-output

Conversation

@RyanEwen

Copy link
Copy Markdown
Collaborator

What

hero.textFreeFile (split layout only) makes devkit-store-hero draw one more image beside the localized heroes: the hero panel's brand gradient across the whole canvas, with the same window, whole and enlarged, centred on it, and no icon, name, headline or subline.

It is for a page that sets the app's name and headline in its own text and wants the hero's look under it, such as a product page on a website. Without the panel the window has the whole canvas, so a wide window (a full app window rather than a flyout) is drawn noticeably larger than in the hero, which keeps it legible when the image is shown at phone width.

"hero": {
  "layout": "split",
  "icon": "assets/generated/icon-256.png",
  "primary": "#2563EB",
  "accent": "#10B981",
  "textFreeFile": "text-free/00-hero-dark.png"
}
  • The path is under store-assets/<store>/ like file and has no {locale}: the image has no text, so one serves every locale. The README suggests keeping it out of screenshots/ so it is never uploaded as a listing screenshot.
  • --check covers it like the heroes, and orphanedHeroes never names it.
  • Refused: a path with {locale} or not ending .png, a path that is also a locale's hero, and the brand-card layout.
  • hero.fade and hero.crop apply to it as to the hero.

Existing heroes are unchanged

The split layout's background and window placement moved into shared helpers that the text-free drawing reuses; the SVG they produce for the hero is byte-for-byte the same. devkit-store-hero --check from this branch passes in all eight app repos that have heroes, and the committed examples are unchanged apart from the new text-free image in the split example.

Release

This is opt-in, so a minor release. Proposed note for the next release-notes/ file:

  • A text-free version of a split hero: set hero.textFreeFile to draw one more image, the hero's brand gradient and enlarged window with no icon, name or text, for a web page that sets its own headline above it. Nothing changes for an app that does not set it, and no hero needs regenerating.

Tests

npm run validate passes. New tests cover the field's validation, the output it adds, that the layout draws no text and centres the window, and that --check keeps the image current.

AI disclosure: this comment and the related code were written with the assistance of AI.

hero.textFreeFile (split layout only) draws one extra image beside the localized heroes: the
panel's brand gradient across the whole canvas, with the same window, whole and enlarged, centred
on it, and no icon, name, headline or subline. It is for pages that set the app's name and
headline in their own text above the image. The path has no {locale}, since one image serves
every locale, and --check covers it like the heroes.

The split layout's background and window placement move into shared helpers so both drawings use
them; existing heroes draw the same pixels, and the committed examples are unchanged apart from
the new text-free image in the split example.
@RyanEwen
RyanEwen merged commit 4a0a24b into main Nov 24, 2026
1 check passed
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