Skip to content

🎨 Palette: 为异步提交按钮添加平滑过渡效果 - #197

Open
01luyicheng wants to merge 1 commit into
devfrom
palette-ux-button-loading-17176571655609954033
Open

01luyicheng wants to merge 1 commit into
devfrom
palette-ux-button-loading-17176571655609954033

Conversation

@01luyicheng

Copy link
Copy Markdown
Owner

💡 What: 使用 AnimatedContent 和 Row 包装配对按钮内容,并将加载指示器的颜色改为 LocalContentColor.current。
🎯 Why: 避免状态切换时的突兀视觉变化,并修复禁用状态下对比度不足的问题。
📸 Before/After: (纯视觉动画和对比度改进)
♿ Accessibility: 提高了禁用状态下 Loading 图标的视觉对比度,确保键盘焦点状态更清晰。


PR created automatically by Jules for task 17176571655609954033 started by @01luyicheng

Co-authored-by: 01luyicheng <172185967+01luyicheng@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI lite review requested due to automatic review settings August 6, 2026 12:39
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@Luyicheng-Agent

Copy link
Copy Markdown
Collaborator

🤖 自动提交后正确性审查(过去 24 小时提交) — commit 44f379c (2026-08-06)

对本 PR 进行了多维度追踪审查,结论:未发现高影响缺陷(无崩溃 / 数据丢失 / 安全 / 严重功能退化)。

审查要点:

  1. AnimatedContent 默认 transitionSpec(crossfade+scale)——与文件中已有的 ConnectionStatusAnimated/VpnStatusCard 模式一致(见 REV62 注释),过渡期间两状态叠加淡入淡出,无空白闪烁。
  2. LocalContentColor.current 语义——spinner 仅在 isPairingInProgress=true 时显示,此时 enabled = … && !isPairingInProgress = false(按钮 disabled)。Material3 Button 在 disabled 态提供 LocalContentColor = onSurface@0.38,容器为 onSurface@0.12,对比度良好且可见。旧代码用 onPrimary(白色)在浅灰 disabled 容器上反而对比度不足——本 PR 实际修复了该问题。
  3. Row 包裹——AnimatedContent 移除了隐式 RowScope,显式 Row(Center) 正确保留了 spinner+text 并排居中,无窄屏裁剪。
  4. 状态重组——Boolean targetState 以 == 触发过渡,lambda 内使用局部 isPairing 参数(非捕获的 uiState),模式正确。

唯一建议(非缺陷):LocalContentColor 依赖 import androidx.compose.material3.* 通配符解析(第 43 行)。当前可正确编译(material3 包导出该 API),但建议显式 import androidx.compose.material3.LocalContentColor 以提升可读性、避免未来包重构时的隐式依赖。

另:未发现 PairingSection 相关 Compose UI 测试覆盖,建议后续补充(非阻塞)。CI 当前 pending,待 Android Build & Test 通过后可最终确认编译。

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.

3 participants