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

Open
#819 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
json, swift
Domain
design, desktop

Research direction

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.

Written by the indexing model from the issue text.

Description

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

Dominant language
Swift
Stars
184
Forks
12
Avg merge
3h 50m
Merged PRs (30d)
387

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Seb-GRAF/StableBar

All issues in Seb-GRAF/StableBar

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.