A widget package's preview stays light in a dark Settings window

Aperta
#819 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
json, swift
Ambito
design, desktop

Direzione di ricerca

Start with Sources/StableBar/PackageDetailView.swift:185 and :414, then read Sources/StableBar/WidgetPackage.swift:14 and the referenced stablebar-packages CONTRIBUTING.md preview guidance. Compare the optional dark screenshot proposal with CI generated previews; either path changes the package format and involves both repositories. Done means Settings shows the preview matching the bar appearance, with the existing screenshot as fallback, and package validation and indexing support the chosen format.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Problem

A widget package's page in Settings → Store shows its Store screenshot. Authors make it by hand: 520 × 144 pixels, "the widget centered on a plain background" (stablebar-packages CONTRIBUTING.md, Preview). Every current preview is drawn in Light mode. In a dark Settings window it is a bright slab above dark rows, and it shows the widget in colors the bar won't use: Status ring's dark ring and Wi-Fi glyph turn light on a dark bar.

Themes don't have this problem: the page draws their preview for the bar's appearance (draft.themePreview?.configuration(for: appearance), Sources/StableBar/PackageDetailView.swift:185).

Proposal

Show the preview for the appearance the bar uses, and fall back to the single screenshot. There are two ways to get it, and both change the package format, so it's a maintainer's call:

  1. An optional dark screenshot. package.json gains a second path, such as screenshotDark, and the index gains a matching URL. stablebar-packages CI checks it like screenshot, and its README can show both with <picture>. This is the smaller change, but authors make two images by hand, and they can drift from the widget.
  2. Previews drawn by StableBar. Store CI draws each package's widgets offscreen, as --render-scenes does, in Light and Dark. It uses sample values the package declares and publishes both images. Previews then come from the real layout engine and stay current, but this needs a format for sample values and CI work in both repositories.

Drawing the preview live in Settings doesn't work today. StableBar must not run a package's providers or commands before review. WidgetSampleContent draws a widget's default layout with generic sample values, not the package's own layout (Sources/StableBar/PackageListPreview.swift:62). Status ring would show as an icon and a number, not as its ring.

Possible today

No. PackagePreview shows screenshotData before anything else (Sources/StableBar/PackageDetailView.swift:414), and the manifest and the index each have one screenshot. WidgetPackageManifest rejects unknown keys (Sources/StableBar/WidgetPackage.swift:14), so a package using a new key needs a minimumVersion at or above the release that adds it. The index ignores keys it doesn't know. Checked on origin/main at da7455a and on stablebar-packages main.

Related

  • #144 / #152 added previews to the package list.
  • #818 covers the page's icon, which differs from the row's.

Triaged by Claude Code (Claude Opus 5.5).

Lingua principale
Swift
Stelle
184
Fork
12
Merge medio
3h 50m
PR unite (30g)
387

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Seb-GRAF/StableBar

Tutte le issue di Seb-GRAF/StableBar

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.