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

Abierto
#819 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
30/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
json, swift
Área
design, desktop

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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).

Lenguaje dominante
Swift
Estrellas
184
Forks
12
Merge medio
3 h 50 min
PR fusionados (30 d)
387

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Seb-GRAF/StableBar

Todos los issues de Seb-GRAF/StableBar

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.