← Back to Pull requests

fix(adaptive): disable auto-focus on pane destination changes #3650

Closed
unknown closed this pull request without merging on Oct 22, 2026 01:15 UTC
View on GitHub
unknown unknown commented on Oct 21, 2026 17:35 UTC
Author

问题

升级到 compose-material3-adaptive 1.3.0 后,进入设置「播放器」页时,页面会自动向下滚动,停在底部的「倍速范围」(RangeSlider)处;进入数据源编辑页时也会自动将焦点移至首个输入框。

原因

adaptive-layout 1.3.0 在 PaneScaffoldDirective 中新增了默认开启的 shouldAutoFocusCurrentDestination = true。每次进入或切换 ThreePaneScaffold(ListDetailPaneScaffold)的目标 pane 时,框架都会对该 pane 的 focusGroup 调用 requestFocus()。

在触摸模式下,clickable、Switch、IconButton 等控件使用 Focusability.SystemDefined(触摸模式下不可聚焦),而 Material3 的 RangeSlider / Slider 与 TextField 使用无条件的 Focusability.Always。焦点搜索因此跳过页面上半部分的所有开关与下拉项,直接落到页面下方的首个 RangeSlider 滑块或输入框上,并触发 BringIntoView 将滚动容器拉到底部。

修复

新增 PaneScaffoldDirective.withoutAutoFocus() 将 shouldAutoFocusCurrentDestination 显式设为 false,并统一应用到应用内全部三处 ListDetailPaneScaffold 入口:

  • AniListDetailPaneScaffold(覆盖设置页、搜索页、缓存管理、通知中心、公告、Peer 过滤)

  • MediaSourceEditorScaffold(JSON API 与 Selector 数据源编辑页)

  • EditRssMediaSourceScreen(RSS 数据源编辑页)
  • 验证

  • :app:android:installDefaultDebug 安装至 Android 真机(PKG110)实测:进入设置各二级页(含「播放器」页)及数据源编辑页时均保持在页面顶部,不再自动聚焦滚屏。
  • Diff: 129 lines (+96 / -33) across 1 files Reviewer: Him188 Review duration: 459m
    All Vouch review confidence checks passed
    Residual risk 0.13 = Change Risk (0.32) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.32 · 129 lines diff across 1 files
    0.32
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.291
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3650"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 32.1% (LOW) · Higher = larger blast radius
    32.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 12.7% · Safe to merge
    12.7%