Skip to content

fix: preserve iOS 26 pager glass across scrolling and theme changes - #262

Open
huhuanming wants to merge 2 commits into
mainfrom
codex/fix-ios26-pager-theme-edge
Open

huhuanming wants to merge 2 commits into
mainfrom
codex/fix-ios26-pager-theme-edge

Conversation

@huhuanming

@huhuanming huhuanming commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

On iOS 26, Wallet Home can lose its pinned scroll effect or leave the search/menu Glass capsules pale after scrolling, cancelling a horizontal swipe, or changing theme while Home remains mounted. This change keeps the local Pager’s native Hard effect and its scroll owner consistent across those transitions.

  • Extend the existing local fixed-overlay transition ownership to iOS 26: retain the source interactions, prepare incoming owners, and release temporary owners on settlement or cancellation. External-overlay transition handoff, native animated page scrolling, and the overlay theme layer retain their existing iOS 27 gates.
  • Handle real iOS 26 vertical drag offsets that arrive after the pan recognizer has ended/reset, while preserving current-page, synthetic-restore, inset correction, and native command guards.
  • Give originally transparent local Hard scroll owners the actual opaque Pager/ancestor color while they own the effect. Preserve custom backgrounds, update the owned color with theme changes, and restore the original nil/clear value on release. Compare UIColor values rather than object identity: the real collection view returns equivalent colors as distinct objects.
  • Retain the iOS 26 deferred appearance commit from this PR’s original theme fix. iOS 27 keeps its existing synchronous theme path and original background behavior.

The iOS 26/27 distinction is documented in source comments and the package SPEC. A minimal UIKit app reproduced pale capsules with transparent scroll backing on iOS 26 and normal dark capsules with the same setup on iOS 27. On iOS 26, changing only the backing and then advancing the actual scroll offset produced a reversible pale → dark → pale result. This establishes the observed trigger; it does not attribute the failure to an undocumented UIKit internal mechanism. A controlled pattern with the public native edge effect shown/hidden confirmed that the full fixed + sticky regions still blur their underlying content.

Validation:

  • The consumer’s installed native Pager source was changed first and rebuilt locally. The final SDK source is byte-identical to that consumer source (7df9bd7e…); Xcode logs confirm compilation of this file, successful native builds, and the installed App binary receipts.
  • iOS 26.0 Simulator Debug: clean cold-start natural vertical scrolling into the pinned state, cancelled half swipes, complete page switches/returns, two pinned light/dark cycles, rapid theme changes while expanded, and actual Search/Action Center open/return flows. Read-only native checks confirmed the real observed scroll owner, fixed/sticky interactions, correct theme backing and cleared transition ownership. The 17.33-second final dark recording had no pale capsule frames in 260 sampled frames at 15 fps.
  • Focused native XCTest, using the same final test binary: iOS 26 — 11 passed, 3 explicit OS skips, 0 failures; iOS 27 — 6 passed, 8 explicit OS skips, 0 failures. Coverage includes real-list/stand-in ownership, cancellation and cleanup, aligned-body KVO takeover/guards, original-color restoration, caller color protection, equivalent UIColor getters, and unchanged iOS 27 external/resize controls. The old production baseline failed the added iOS 26 ownership, KVO and background regression cases before the implementation was copied into the SDK.
  • iOS 27.0 Simulator Debug: cold-start vertical scrolling, pinned half-swipe cancellation, complete page switches/returns, light/dark transitions, and actual Search/Action Center open/return flows passed against the same-device appearance reference. Native inspection confirmed transparent scroll backing, zero backing leases, and the real fixed/sticky edge owner. The final consumer Pager object is byte-identical across the iOS 26/27 builds; their whole-App dylibs differ. iOS 27 evidence is a screenshot sequence, not a final video.
  • git diff --check, repository test-integrity checks (78 files; 3 non-gated advisories), and npm dist-tag validation (45 workspaces) passed. Final source, SPEC and native tests received independent review.

Physical-device and Release builds remain unverified. Hosted CI for the new head is pending; local Debug behavior and focused native XCTest do not establish hosted CI success.

Recordings — iOS 26 Simulator Debug

Before: the original theme-only candidate, naturally scrolling Home into the pinned state, turns both capsules pale.

scroll-ios26-a3637640-before-natural.mp4

After: final locally rebuilt source, natural scrolling → pinned header → half-swipe cancellation → page switching/return, without pale capsules.

scroll-ios26-7df9bd7e-natural-dark.mp4

After: the same final build, pinned dark → light → dark, followed by a cancelled horizontal swipe.

scroll-ios26-7df9bd7e-pinned-theme.mp4
Earlier recordings of the original theme-only repair

Before that repair:

ios26-system-theme-valid.mp4

After that repair (historical candidate; the final scrolling/theme acceptance is recorded above):

ios26-pager-theme-after-fix.mp4

@sidmorizon

Copy link
Copy Markdown
Contributor

@codex review

@sidmorizon

Copy link
Copy Markdown
Contributor

@codex security review

@sidmorizon

Copy link
Copy Markdown
Contributor

Devin Cloud review ↗

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T08:08:28.473950Z 2a32604 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sidmorizon

Copy link
Copy Markdown
Contributor

Cursor review failed.

Remote error: cursor_permission_denied: HTTP 403 Forbidden: Cloud Agent is not available for free users. Please upgrade to Pro.

@cursor

cursor Bot commented Nov 13, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 2a326049e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 2a326049e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sidmorizon

Copy link
Copy Markdown
Contributor

@huhuanming huhuanming changed the title fix: restore iOS 26 pager glass after theme changes fix: preserve iOS 26 pager glass across scrolling and theme changes Nov 13, 2026
Comment on lines +2944 to +2945
for (UIScrollView *scrollView in _scrollEdgeBackgroundStates.keyEnumerator.allObjects) {
[self applyScrollEdgeBackgroundToScrollView:scrollView];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 P2: Ancestor theme changes leave stale backing

Severity: non-severe

When only an ancestor's background changes, syncScrollEdgeAppearance does not run and the active list keeps its old color. The page and its Hard edge then display different theme colors until another pager update.

Comment on lines +2905 to +2906
UIColor *candidate = [view.backgroundColor resolvedColorWithTraitCollection:_topOverlayHostView.traitCollection];
if (candidate != nil && CGColorGetAlpha(candidate.CGColor) >= 1) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 P2: Dynamic ancestor backing uses wrong appearance

Severity: non-severe

When an ancestor and overlay use different appearances, resolvedColorWithTraitCollection: resolves the ancestor's dynamic color using the overlay's style. The iOS 26 list then paints a different background from its ancestor.

Comment on lines +2867 to +2870
if (scrollView == nil || scrollView == _topEdgeScrollView ||
[_programmaticScrollEdges objectForKey:scrollView] != nil ||
(_pendingTopOverlayAppearanceCommit && scrollView == _observedScrollView &&
[self canPreserveHorizontalScrollEdgesAllowExternalOverlay:NO])) return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 P1 释放旧滚动 owner 时恢复待提交的背景

Problem

iOS 26 本地 smooth Hard pager 切换主题后,此处会因 pending commit 保留列表 A 的背景,但 _topEdgeScrollView 已被清空。若回调执行前调用 setPageWithoutAnimation 切到 B,detachScrollObserver 只清除 observed 指针;后续 commit 仅重绑 B,且没有 transition owner 触发 A 的背景恢复。另一次 mount 在该窗口释放 A 也有同样问题。

Impact

A 失去最后一个 owner 后仍保留 Pager 写入的不透明背景;移出或复用 A 时无法恢复原来的 nil/clear,后续 syncScrollEdgeAppearance 还会继续改写 A,造成新位置的背景被旧 Pager 覆盖。

Recommendation

在 observer/managed-scroll 释放并清除旧 observed 指针后,重新检查 A 的剩余 owner 并恢复其背景租约;增加 pending theme commit 期间无动画切页及列表替换的回归用例。

Codex local session ↗

This branch has not been deployed

No deployments
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.

2 participants