Skip to content

chore(ui): remove dead banner ViewBuilder params from the Daily hubs - #1099

Merged
wei18 merged 1 commit into
mainfrom
chore/1096-remove-dead-daily-banner-params
Sep 21, 2026
Merged

wei18 merged 1 commit into
mainfrom
chore/1096-remove-dead-daily-banner-params

Conversation

@wei18

@wei18 wei18 commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Closes #1096
part of #1014

What

Drop the Banner generic and the banner: ViewBuilder param from DailyHubShellView (GameShellKit), DailyHubView (SudokuKit) and MinesweeperDailyHubView (MinesweeperKit), plus the two forwarding call sites. No production caller has passed one since #1020; the banner lives in the shared tabViewBottomAccessory. Today-case comments in both Live+TabRoots.swift are rewritten as mirrors and no longer describe a dead param. GameShellKit stays zero-dependency.

Kept on purpose: the now single-child VStack(spacing: 0) in DailyHubShellView.body, so the structure TXT moves on line 1 only (PM-accepted).

Finding: one test DID pass a banner

BannerSlotDarkBandRegressionTests (the #851 dark-band pin) built DailyHubView(viewModel:) { BannerSlotView(…) } through a trailing closure, so the issue's banner: regex could never match it. PM ruling (A): keep the pin, reconstruct the pre-#1024 in-shell composition in the fixture (VStack(spacing: 0) { DailyHubView; BannerSlotView }.background(page token)). Proof it is faithful: base-rendered vs head-rendered PNG for postFix_themedBackground_dailyHubDarkMode_bannerOpen_noBand are cmp byte-identical.

Other test touches: DailyHubViewTabReturnRetryTests.swift DailyHubView<EmptyView> → DailyHubView (compile fix). DailyHubShellViewGenericityTests needed no edit — its 3 sites infer the generics.

Snapshot changes — 29 .txt, line 1 only, 0 PNG

git diff --stat origin/main -- '**/__Snapshots__/**' → 29 files, 1 insertion + 1 deletion each, all .txt.

Files Old line 1 (pattern) New line 1 (pattern)
SudokuKit DailyHubViewTests (10) …GV8SudokuUI12DailyHubViewVS_9EmptyView_GVS_30_EnvironmentKeyWritingModifier…GS5_… …V8SudokuUI12DailyHubViewGVS_30_EnvironmentKeyWritingModifier…GS4_…
SudokuKit TodayTabViewTests (5) …TodayTabHostO8SudokuUI8AppRouteGVS4_12DailyHubViewVS_9EmptyView__GVS_30_…GS8_… …TodayTabHostO8SudokuUI8AppRouteVS4_12DailyHubView_GVS_30_…GS7_…
MinesweeperKit MinesweeperDailyHubSnapshotTests (9) …NavigationPathGV13MinesweeperUI23MinesweeperDailyHubViewVS_9EmptyView__GVS_30_…GS7_… …NavigationPathV13MinesweeperUI23MinesweeperDailyHubView_GVS_30_…GS6_…
MinesweeperKit MinesweeperTodayTabViewTests (5) …TodayTabHostO13MinesweeperUI8AppRouteGVS4_23MinesweeperDailyHubViewVS_9EmptyView__… …TodayTabHostO13MinesweeperUI8AppRouteVS4_23MinesweeperDailyHubView_…

The root type loses its EmptyView generic argument; the mangling substitution indices after it renumber (e.g. GS5_→GS4_, GS8_→GS7_, GS7_→GS6_); exact prefixes vary per fixture wrapper. Store-frame and ASC-emit suites are green and their baselines untouched.

Spliced, not re-recorded. This host is on macOS 27.0 (#1097): all 29 files are already red on clean origin/main from renderer drift (line 4 NSClipView → SwiftUI.HostingClipView, or a 1pt _FocusRingView y-shift). A record-mode run would have baked that drift into 29 baselines. Instead each file = head-rendered line 1 + committed lines 2+. Proofs:

  1. Line 1 is OS-independent: base-rendered line 1 (macOS 27) == committed line 1 on origin/main, 29/29.
  2. For all 29 files, diff(spliced, head-rendered) == diff(origin/main committed, base-rendered) — drift lines only, no line 1.

Base vs head (no-record), same commands and exact filters, sequential

Base = clean detached tree at 331b4de7. Post = this branch after the splice.

Suite BASE HEAD (post-splice)
GameShellKit full 124/124 pass 124/124 pass
MinesweeperKit full (412 tests) failed, 59 issues failed, 59 issues — identical failing-test set; 44/44 structure-diff lines identical
SudokuKit --filter DailyHub (76) failed, 20 issues failed, 20 issues — identical set; 22/22 identical
SudokuKit --filter TodayTab (5) failed, 10 issues failed, 10 issues — identical set; 10/10 identical
SudokuKit --filter ASCScreenshotEmit (9) pass pass
SudokuKit --filter BoardLoaderViewDailyPrecheckTests (6) pass pass
SudokuKit --filter BannerSlotDarkBandRegressionTests (1) failed, 1 issue (PNG) failed, 1 issue (PNG)

These runs are red, and red identically on base — they are not green.

#1097 (environment) — base-identical failures, not from this PR

  • Affected suites: 30 PNG (DailyHubViewTests 10, TodayTabViewTests 5, MinesweeperDailyHubSnapshotTests 9, MinesweeperTodayTabViewTests 5, BannerSlotDarkBandRegressionTests 1) + the drift lines in the same 29 TXT.
  • Untouched MinesweeperKit suites red on both: ProgressScreenTests, MinesweeperCompletionSnapshotTests, MinesweeperPracticeHubSnapshotTests, MinesweeperControlClusterSnapshotTests, MinesweeperBoardLoaderViewFailedExitTests.
  • Rendered-vs-rendered: the failing output each run produced was copied out of swift-snapshot-testing's shared temp dir (head before the base run overwrote it). 30/30 PNG cmp byte-identical base↔head; 29/29 TXT differ at exactly 1c1. Zero PNG failures exist only at head. No PNG was re-recorded.

Positive control for the banner: search

git grep -n -E '(^|[^A-Za-z_])banner:' -- '*.swift'

Other gates

  • swiftlint --strict on changed Swift files: 0 violations. scan:hygiene, gitleaks: pass.
  • iOS Simulator builds (Debug, generic destination): Sudoku ** BUILD SUCCEEDED **, Minesweeper ** BUILD SUCCEEDED ** (after tuist generate).

🤖 Generated with Claude Code

Drop the `Banner` generic and the `banner:` param from DailyHubShellView,
DailyHubView and MinesweeperDailyHubView. No production caller has passed
one since #1020; the banner lives in the shared tabViewBottomAccessory.

- BannerSlotDarkBandRegressionTests passed a banner via trailing closure;
  it now reconstructs the old in-shell composition so the #851 no-band
  pin stays (base vs head rendered PNG byte-identical).
- 29 assertViewStructure TXT baselines: line 1 only (root type loses the
  generic argument), spliced rather than re-recorded so the macOS 27
  renderer drift (#1097) is not baked in. No PNG changes.

Closes #1096
part of #1014

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@wei18

wei18 commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

PM review record, head 2326b962: CR + acceptance ACCEPT / MERGE.

  • Compile proof, done because a banner: regex cannot see trailing-closure callers: swift build --build-tests succeeds for GameShellKit, SudokuKit and MinesweeperKit. None of the three Daily types declares Banner any more. All 29 DailyHub(Shell)?View construction sites were read, and none passes a banner.
  • No production behaviour change. Non-snapshot hunks are the param and generic removal, the forwarding call-site removal, comments, and test fixtures only. DailyHubShellView.body keeps its single-child wrapper, as ruled.
  • Line-1 splice: 29 .txt files, 1+/1− each, verified by script; the new line 1 drops the EmptyView generic argument with substitution indices renumbered by −1. No .png changed.
  • Base vs head, reproduced independently in the reviewer's own throwaways under macOS 27: GameShellKit 124/124 on both; MinesweeperKit 59 issues with the same 37 failing names on both; SudokuKit DailyHub 20 issues (10 names), TodayTab 10 issues (5 names), dark-band 1 PNG, all identical on both. All remaining failures are test(snapshots): strict baselines fail after the macOS 27 upgrade (2026-09-16), renderer drift with no code change #1097 environment drift. On spliced files the only remaining difference is the drift line; line 1 matches on both sides.
  • Dark-band fix(shell): faint dark-mode background banding on hub screens (both apps) #851 pin: the rendered PNGs from head and base are byte-identical (cmp), so the fixture reconstruction is faithful.
  • Hygiene: CI 7/7, including SwiftLint (changed files) and the ASC frame-drift gate; Closes #1096 only; GameShellKit Package.swift unchanged.

@wei18
wei18 merged commit 4cc9807 into main Sep 21, 2026
7 checks passed
@wei18
wei18 deleted the chore/1096-remove-dead-daily-banner-params branch September 21, 2026 17:54
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.

chore(ui): remove dead banner ViewBuilder params from the Daily hubs (unused since #1020)

1 participant