Skip to content

fix: refresh native controls after foreground and viewport changes - #233

Merged
rdlabo merged 4 commits into
mainfrom
fix/restore-tabs-after-device-layout-change
Sep 28, 2026
Merged

rdlabo merged 4 commits into
mainfrom
fix/restore-tabs-after-device-layout-change

Conversation

@rdlabo

@rdlabo rdlabo commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Native controls can remain hidden after foregrounding or a viewport change when their control snapshot is unchanged: those events scheduled a measurement, but snapshot deduplication skipped the native update. Force a refresh on visibility restoration and window/visual-viewport resize, using the existing RAF and pending-update handling. Reset transient native rejections through the same refresh path.

The change is limited to the runtime and three regression cases. Each new case fails against the original implementation and passes with the fix. The exact reported iPhone Duo fold/foreground/portrait sequence has not yet been reproduced through CLI, so resolution of that full sequence remains unconfirmed.

Validation:

  • Native UI Shell E2E: 95 passed; final refresh/rejection checks: 5 passed.
  • Theme and production demo builds, formatting, and demo lint passed.
  • Senior review completed with no remaining findings.

Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

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.

Devin Review found 2 potential issues.

Devin Review

await page.waitForTimeout(750);
const previous = await page.evaluate((event) => {
const snapshot = Capacitor.registerPlugin<ShellMock>('IonicNativeUIShell').updates.at(-1)!;
if (event === 'foreground') document.dispatchEvent(new Event('visibilitychange'));

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.

🔍 前景復帰テストは非表示期間を再現しない

表示中の document に visibilitychange を送るため、非表示時の検索終了と復帰後の表示回復は通らない。実機のバックグラウンド復帰も確認したい。

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +1255 to +1256
else if (event === 'window-resize') window.dispatchEvent(new Event('resize'));
else window.visualViewport!.dispatchEvent(new Event('resize'));

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.

🔍 リサイズテストは寸法を変えない

resize イベントのみを送るため、寸法変更後の再測定やネイティブ配置は検証できない。回転・折りたたみ時の実寸法で確認したい。

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Playwright test results

passed  373 passed

Details

stats  373 tests across 20 suites
duration  4 minutes, 8 seconds
commit  0026744
info  This detailed result covers Ionic 9 only. Ionic 8 runs against the same screenshots in a separate matrix job; check the workflow run for both results. To update the screenshots, comment with /update-screenshots.

github-actions Bot added a commit that referenced this pull request Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

📊 Ionic 9 Playwright Test Report

View the detailed Ionic 9 report: https://rdlabo-dev.github.io/ionic-theme-ios27/pr-233/

Ionic 8 runs against the same screenshots in a separate matrix job. View both results in the workflow run.

github-actions Bot added a commit that referenced this pull request Sep 28, 2026
github-actions Bot added a commit that referenced this pull request Sep 28, 2026
github-actions Bot added a commit that referenced this pull request Sep 28, 2026
github-actions Bot added a commit that referenced this pull request Sep 28, 2026
@rdlabo
rdlabo merged commit 647eef3 into main Sep 28, 2026
11 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

npm beta published

CI passed for the merge commit 647eef34274b. Install the immutable version with:

npm install @rdlabo/ionic-theme-ios27@1.2.0-beta.pr233.sha647eef34274b

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.

1 participant