Skip to content

fix: 应用页搜索框吸顶及颜色一致性#57

Open
yixing233 wants to merge 4 commits into1812z:mainfrom
yixing233:update-2
Open

fix: 应用页搜索框吸顶及颜色一致性#57
yixing233 wants to merge 4 commits into1812z:mainfrom
yixing233:update-2

Conversation

@yixing233
Copy link
Copy Markdown

变更内容\n- 应用页中仅搜索框吸顶,\已启用xxx\文本不吸顶\n- 吸顶状态下,搜索容器背景按与顶部栏一致的滚动叠色规则计算\n- 吸顶后搜索框内部背景为白色\n\n## 影响文件\n- lib/pages/whitelist_page.dart\n- lib/widgets/app_list_widgets.dart\n\n## 验证\n- dart analyze 通过\n- 已完成 split-per-abi release 构建验证\n

Copilot AI review requested due to automatic review settings April 5, 2026 17:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

该 PR 调整应用页(WhitelistPage)搜索区域的吸顶行为与吸顶时的颜色规则,使仅搜索框吸顶,并在吸顶状态下让搜索容器背景与顶部栏滚动叠色规则保持一致。

Changes:

  • 将“已启用 xxx”说明文本从搜索组件中拆出,改为随列表滚动、不吸顶的 SliverToBoxAdapter。
  • 新增吸顶的 SliverPersistentHeader,仅搜索框区域 pinned,并根据 overlapsContent 计算吸顶容器背景色(surface tint overlay)。
  • AppListSearchHeader 增加可配置的 searchBarBackgroundColor,用于吸顶/非吸顶状态下搜索框底色差异。

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lib/widgets/app_list_widgets.dart 为搜索头组件新增可选的搜索框背景色入参,并用于配置 SearchBar.backgroundColor
lib/pages/whitelist_page.dart 拆分说明文本与搜索栏;新增 pinned 搜索栏 Sliver,并实现与 AppBar 一致的滚动叠色计算与吸顶样式。

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/pages/whitelist_page.dart Outdated
searchFocusNode: _searchFocus,
hintText: l10n.searchApps,
searchBarBackgroundColor: overlapsContent
? Colors.white
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

searchBarBackgroundColor is set to Colors.white when the header is pinned. This hard-codes a light color and will look incorrect (and may reduce contrast) in dark theme / dynamic color. Consider deriving the pinned search bar background from the current ColorScheme (e.g., a surface/container token, or conditional on Theme.of(context).brightness).

Suggested change
? Colors.white
? cs.surfaceContainerHighest

Copilot uses AI. Check for mistakes.
: cs.surface;
return Material(
color: pinnedBg,
surfaceTintColor: Theme.of(context).colorScheme.surfaceTint,
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

surfaceTintColor is provided on this Material, but elevation is always 0, so the tint will not be applied by Material (and the actual background tinting is already handled via ElevationOverlay.applySurfaceTint). Consider removing surfaceTintColor to avoid confusion, or set elevation to match the intended scrolled-under behavior and let Material handle tinting.

Suggested change
surfaceTintColor: Theme.of(context).colorScheme.surfaceTint,

Copilot uses AI. Check for mistakes.
弋星 and others added 2 commits April 6, 2026 10:41
统一进度条调整的数字样式.
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