The docs hero is sometimes drawn before the system pill's first reading

未关闭
#802 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
56/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
macos, swift
领域
desktop, testing

调研方向

Start with Sources/StableBar/DocsImages.swift, especially DocsImages.snapshot and its readiness check, then trace how the system widget’s first output reaches the bar presentation. Reproduce with taskpolicy -b StableBar --render-docs-images DIR and compare repeated docs/hero-dark renders. Done when every widget shows its sample output before capture and repeated renders produce the same pixels.

由索引模型根据 Issue 内容生成。

描述

bug

What happens

docs/hero-dark is sometimes drawn before the system pill's first reading reaches the bar. The pill then shows … and …% instead of the sample's 18% and 54%. The pill is narrower, so the bar's right end and the calendar popup under it sit further right than in a good drawing.

When it happens in Draw main's screens, every pull request based on that commit gets a false changed screen in its before/after comparison. A maintainer has to tell it apart from a real change before adding visual-ok. The Docs images job draws the same image, so a stable release could also commit a README hero showing … …%.

Steps to reproduce

Seen on CI only, twice so far (2026-11-01 and 2026-11-18):

  1. A push to main runs Draw main's screens (StableBar --render-docs-images).
  2. A pull request based on that commit draws its own docs images and compares them with main's.
  3. One side's hero-dark has … …% in the system pill; the other side has 18% and 54%.

taskpolicy -b StableBar --render-docs-images DIR, run a few times, may reproduce it locally by slowing the drawing down.

Expected

The docs images wait until every widget on the bar shows its sample output, so two runs of one commit draw the same pixels, as CONTRIBUTING's Docs images section says they do.

Environment

CI, macos-26 runner (Apple silicon, 3 cores), Xcode 26.6. main at 937c40e.

Evidence

Diagnosis

  • DocsImages.render draws the hero from sampleStore(…) (Sources/StableBar/DocsImages.swift). Its system-monitor widget is the "type": "system" widget setup adds (SetupPreferences.WidgetSet.system). The sample configuration defines a system command provider that runs /bin/cat "$CONFIG_DIR/system.json", with interval: 3600.
  • DocsImages.snapshot passes OffscreenSnapshot.write a readiness check and a fixed 3-second settle. The check waits until the sample workspaces exist and no store.scripts entry has outputNumber == 0.
  • The bad drawing shows the pill's placeholders, so that check, or the settle after it, didn't cover the pill's first reading. Either the system widget's output isn't among the store.scripts entries the check reads, or the reading arrived but the bar hadn't shown it within the settle on a busy runner. Which one is unverified.
  • A fix would wait on what the bar shows for each widget, for example its presentation having received an output, rather than on the time a settle allows.

Related

  • #395 made the docs images draw the same on every run (fixed date, offline Store, sample app). This is a remaining source of difference between runs.
  • #432 noticed the same difference in its description, but no issue was filed.
  • #794 (draft) found the same kind of race in scenes, where a fixed settle ends before a view's data loads. This one is in the docs images and happens without parallel drawing.

Triaged by Claude Code (Claude Opus 5.5).

主要语言
Swift
星标
184
派生
12
平均合并
3 小时 50 分钟
30 天内合并 PR
387

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Seb-GRAF/StableBar 的其他 Issue

查看 Seb-GRAF/StableBar 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。