Skip to content

fix(ui): preserve page state and back navigation across rotation - #570

Merged
cwuom merged 6 commits into
masterfrom
fix/player-rotation-state
Oct 25, 2026
Merged

cwuom merged 6 commits into
masterfrom
fix/player-rotation-state

Conversation

@cwuom

@cwuom cwuom commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

描述 / Description

手机播放器横屏后切回竖屏时,宿主 Activity 重建会丢失底层页面的内存状态,导致内容重载及返回体验不连续。

现在由现有 Compose 页面响应方向和窗口配置变化,并重新应用方向锁与导航栏策略。语言和一加密度适配 Context 使用增量配置,避免旧方向、窗口尺寸或主题配置覆盖后续系统更新;密度适配同时保留明确选择的应用语言,跟随系统模式不固定语言。动态切换语言后在应用入口恢复设备密度适配,保持引导页预览缩放一致。

完整 Activity 旋转回归使用独立的离线 AVD,保留真实播放器点击、旋转、草稿、详情滚动和系统返回断言。CI 使用单值参数绕过 AGP 对逗号列表的截断,在现有测试 Runner 中恢复原生排除列表;额外核对 XML,要求普通分片没有独立宿主测试泄漏,旋转宿主只执行 Clean、Material 两例且均通过,避免前置条件跳过被当作成功。

类型 / Type

  • Bug 修复 / Bug Fix
  • 新功能 / New Feature
  • 文档更新 / Documentation Update
  • 其他(请描述)/ Other (please describe):

修复或解决的问题 / Issues Fixed or Closed by This PR

修复用户反馈的播放器横竖屏切换后需要额外返回、关闭后原页面内容重载的问题。

清单 / Checklist

  • 我已阅读并遵循贡献指南 / I have read and followed the contribution guidelines
  • 我已在本地测试这些更改 / I have tested these changes locally
  • 我已更新相关文档或注释(如适用) / I have updated relevant documentation or comments (if applicable)
  • 我确认本次更改没有破坏任何原有逻辑 / I confirm this change does not break existing behavior
  • 我确认本次更改保持向下兼容(如适用) / I confirm this change remains backward compatible (if applicable)
  • 我已运行必要的构建、测试或静态检查 / I have run the required build, tests, or static checks
  • 我确认没有提交密钥、Token 或其他敏感信息 / I confirm no secrets, tokens, or other sensitive information were committed
  • 涉及 UI 变更时,我已补充截图或录屏(如适用) / I have added screenshots or recordings for UI changes (if applicable)

其他信息 / Additional Information

验证结果:

  • 当前 HEAD d0a31ee7 的 CI #1105 首次运行已终态成功:8 项任务通过,Telegram 发布步骤按 PR 条件跳过;Native USB 36/36,无签名 Release 构建成功
  • 当前 HEAD 的 Codex、CodeRabbit 审查均完成且无可操作问题;两条历史 P2 均已修复并解决,未解决线程为 0
  • 当前 HEAD d0a31ee7 的远端 app/common JVM 报告:3566 项通过,1 项依赖本地网易云 Cookie 的烟测按既有条件跳过;本地语言、密度、导航与方向的针对性回归 33/33 通过
  • API 37 手机模拟器:Clean、Material 真实旋转回归 2/2,加既有返回、预测性返回取消、快速重开、输入隔离和系统栏回归 17/17
  • API 35 ARM64 本地 AVD:使用既有 Tablet 系统镜像和 sw411dp 手机窗口,调整夹具后两种主题的完整旋转回归 2/2,阶段日志均到达最终返回断言
  • 当前 HEAD 远端 API 35 设备回归:1474 项实际通过,5 项既有样本或设备条件 Assumption;普通分片路由门禁均通过、XML 无独立宿主测试泄漏。旋转宿主 Clean、Material 恰好两例实际通过,0 failure/error/skipped,日志均到达最终返回断言
  • CI XML 路由门禁:从实际 YAML 提取脚本验证 26 组正反样本,确认宿主泄漏、混入、缺例、重复、跳过、失败及无效报告均被拒绝
  • 测试 Runner 参数回归:API 35 红绿验证 4/4;真实 Runner 的仅发现模式确认普通两分片分别选择 658、666 例且无独立宿主测试,旋转宿主选择恰好两例(发现模式没有执行这些测试体)
  • SDK 28/32 配置合并回归:6/6,验证语言和密度覆盖不会固定旧方向、窗口、主题和字体配置,且两层包装后明确选择的应用语言不会丢失
  • SDK 28/32 动态语言回归:真实 Compose 中切换中、英、跟随系统,资源密度和配置密度均保持夹具预期的 532;修复前确认会变回 560
  • :app:assembleDebug :app:assembleDebugAndroidTest、:app:lintDebug verifyModuleBoundaries --offline 及 git diff --check 通过
  • lint 为 0 错误;现有 51 个 Warning、1 个 Hint 均未涉及本次修改文件

CI 跟进时修复同步工作目录测试的就绪文件握手:子进程原先创建文件后再写入,父进程可能读到空串并误报锁检查失败;现在完整写入同目录临时文件后原子发布,保留全部锁和回收断言。本地跨进程回归 16/16;同步模块全量 1027 通过、2 项容量测试和 1 项未配置的 WebDAV Provider 测试按既有配置跳过。

旋转回归先在修复前确认首次横屏会替换 Activity,修复后验证 Activity 身份、搜索草稿、详情滚动位置和原有返回层级保持。另有真实无旋转开关播放器的对照路径及导航 owner 重组回归。

本次不调整视觉布局,未新增截图或录屏;未操作真实设备。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T00:42:10.776659Z d0a31ee New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf04fa73a0

ℹ️ 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".

Comment thread app/src/main/java/moe/ouom/neriplayer/util/platform/DeviceUtil.kt
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 44a6c1f and d0a31ee.

Files selected for processing: 1
  • modules/sync/src/test/java/moe/ouom/neriplayer/data/sync/archive/SyncArchiveWorkspaceRecoveryTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

改动新增播放器旋转和详情页面状态连续性测试。MainActivity 在配置变化后重新应用播放页方向及导航栏可见性。语言本地化和 OnePlus 密度修正改用新建的空配置,并新增测试检查后续配置合并时窗口、主题、语言和密度属性的保留。CI 新增旋转测试分组及结果校验,并更新仪器测试运行器以合并额外排除类参数。同步工作区恢复测试改为通过临时文件和原子移动发布就绪文件。

Priority: Normal

Merge Risk: Minimal · up to d0a31

No actionable merge-blocking risk is established by the supplied evidence.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 51 functions across 10 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 标题准确概括了本次变更的主要内容:修复旋转时页面状态和返回导航的保持问题。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

cwuom commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1d181b1b9

ℹ️ 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".

cwuom commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

cwuom commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

cwuom commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cwuom
cwuom merged commit 83ae03a into master Oct 25, 2026
9 checks passed
liaolon added a commit to liaolon/NeriPlayer that referenced this pull request Oct 25, 2026
带入上游:
- fix(ui): preserve page state and back navigation across rotation (cwuom#570)
- fix(download): prevent cancelled mobile batches from restoring (cwuom#566)
- fix(nowplaying): sync matched favorites and refine song sheets (cwuom#562)
- feat(lyrics): add ColorOS 16/17 lockscreen lyrics with Root and Shizuku (cwuom#563)
- fix(lyrics): preserve Bluetooth lyrics in display metadata (cwuom#560)
- fix(ui): stabilize cover morphs and improve Clean switch contrast (cwuom#561)
- fix(netease): isolate rejected songs during playlist sync (cwuom#559)
- feat(backup): protect configuration exports and warn on HTTP WebDAV (cwuom#557)
- perf(ui): defer expensive UI work and complete Clean theme styling (cwuom#556)
- fix(auth): persist accounts when Android Keystore is unavailable (cwuom#554)
- fix(lyrics): apply translation mode before publishing songs (cwuom#553)
- fix(local): restore scanned audio playback and metadata writes (cwuom#551)

与心动模式改动的重叠文件(NowPlayingScreen、NowPlayingQueueSheet、
MoreOptionsMainContent、PersistedPlayerState、PersistedPlayerStateMapping、
PlayerManager、PlayerManagerPersistenceExtensions、NeteaseClient)均为自动合并,
无冲突;heartbeatMode 持久化字段与恢复调用保持完整。
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