Skip to content

Restore classic settings UI with current theme colors - #26

Merged
LangLang03 merged 1 commit into
masterfrom
dev
Sep 5, 2026
Merged

Restore classic settings UI with current theme colors#26
LangLang03 merged 1 commit into
masterfrom
dev

Conversation

@LangLang03

@LangLang03 LangLang03 commented Sep 5, 2026

Copy link
Copy Markdown
Owner

问题

设置 UI 重构把原来的分区卡片拆成了大量连续独立卡片,并移除了多数行内说明与彩色图标底板。设置主页、思考深度、工具与执行、模型提供商等页面因此显得密集,层级也弱于重构前。

调整结果

  • 恢复设置主页的旧版结构:分区标题、整块分组卡片、组内分割线、行内说明,以及 36dp 的主题色图标底板。
  • 恢复共享 SettingsSectionViewActionRowViewOptionRowViewSwitchRowViewSectionHeaderView 的旧版尺寸、间距与层级,因此设置子页重新使用连续分组,而不是每行一个独立卡片。
  • 恢复简单设置页、工具设置页、SSH 设置页和内存设置页的旧版卡片背景与内容边距。
  • 恢复工具与执行页的分段执行目标选择器,同时继续隐藏内部工具 ID。
  • 恢复添加模型入口和预设提供商的旧版独立卡片,避免共享行回退后出现无背景裸行。
  • 恢复扩展/高级功能共用卡片的旧版图标、徽标、说明与边框结构。
  • 保留当前 LineTheme / ThemePalette 配色及内置主题色阶;没有回退主题颜色。
  • 保留重构后的功能修复:统一页头按钮尺寸、主题保存按钮右侧留白、SSH 私钥折叠、响应式操作区、存储页刷新按钮测量,以及工具内部 ID 隐藏。
  • 更新 update.md,明确 1.2.8-max 使用旧版设置结构与新版配色。

回归验证

  • ./gradlew :app:testDebugUnitTest
  • ./gradlew :app:lintDebug
  • ./gradlew :app:assembleDebug
  • Robolectric Native Graphics 截图复核:设置主页的 7 套内置主题、思考深度、模型提供商、工具与执行、扩展页。

以上检查全部通过。

Summary by Sourcery

Restore the classic grouped settings UI while retaining current theme colors and existing functional fixes.

Enhancements:

  • Restore grouped settings layouts with section headers, inline descriptions, dividers, themed icon backgrounds, and consistent card styling across the settings screens.
  • Preserve the current theme palette while reinstating standalone cards for model providers, extensions, advanced options, and other settings entries.
  • Restore segmented execution-target selection in tool settings while retaining hidden internal tool identifiers and existing UI corrections.

Documentation:

  • Document the restored settings structure and continued use of the updated theme colors.

Tests:

  • Update layout and screenshot regression coverage to verify grouped settings sections, standalone cards, spacing, themed backgrounds, and hidden tool identifiers.

@sourcery-ai

sourcery-ai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR restores the pre-refactor settings visual hierarchy by rebuilding grouped sections, shared row styling, standalone entry cards, and segmented execution controls, while continuing to use the current LineTheme/ThemePalette colors and preserving prior functional UI fixes. Layout tests and release notes are updated to reflect and verify the restored presentation.

File-Level Changes

Change Details Files
Restored grouped settings-page hierarchy while retaining the current theme palette.
  • Rebuilt the settings home with uppercase section headers, elevated group containers, inline descriptions, dividers, chevrons, and 36dp accent icon backgrounds.
  • Updated shared row and section components to use restored dimensions, spacing, typography, active-state styling, and group behavior.
  • Converted affected settings screens back to elevated card backgrounds with consistent content padding.
app/src/main/java/cn/lineai/ui/component/SettingsScreenView.java
app/src/main/java/cn/lineai/ui/component/SettingsSectionView.java
app/src/main/java/cn/lineai/ui/component/SectionHeaderView.java
app/src/main/java/cn/lineai/ui/component/ActionRowView.java
app/src/main/java/cn/lineai/ui/component/OptionRowView.java
app/src/main/java/cn/lineai/ui/component/SwitchRowView.java
app/src/main/java/cn/lineai/ui/component/SimpleSettingsScreenView.java
app/src/main/java/cn/lineai/ui/component/ToolSettingsScreenView.java
app/src/main/java/cn/lineai/ui/component/SshSettingsScreenView.java
app/src/main/java/cn/lineai/ui/component/MemorySettingsScreenView.java
Reintroduced standalone card treatments for model and extension-related entry points.
  • Implemented dedicated provider and add-model cards with icon treatments, descriptions, badges/protocol labels, and chevrons instead of bare shared rows.
  • Restored extension/tool card backgrounds and spacing while preserving hidden internal tool IDs.
app/src/main/java/cn/lineai/ui/component/CardViewHelper.java
app/src/main/java/cn/lineai/ui/component/ModelAddOptionsScreenView.java
app/src/main/java/cn/lineai/ui/component/MCPSettingsScreenView.java
Restored segmented execution-target selection and preserved existing functional UI corrections.
  • Replaced execution-target option rows with a segmented local/SSH/terminal-provider selector.
  • Retained header sizing, theme-save spacing, SSH key collapsing, responsive action layout, storage refresh measurement, and internal-ID hiding fixes.
app/src/main/java/cn/lineai/ui/component/MCPSettingsScreenView.java
app/src/main/java/cn/lineai/ui/component/ThemeSettingsScreenView.java
app/src/main/java/cn/lineai/ui/component/SshSettingsScreenView.java
Expanded layout regression coverage and documented the restored structure.
  • Adjusted tests to verify grouped rows, dividers, card backgrounds, icon sizing, spacing, provider cards, and internal-ID hiding across themes.
  • Updated release notes to describe the legacy settings structure paired with current colors.
app/src/test/java/cn/lineai/ui/component/SecondaryScreenLayoutTest.java
app/src/test/java/cn/lineai/ui/component/UiCorrectionsTest.java
update.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@LangLang03
LangLang03 merged commit 9da8d1c into master Sep 5, 2026
3 checks passed

@sourcery-ai sourcery-ai 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.

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="app/src/main/java/cn/lineai/ui/component/SettingsScreenView.java" line_range="15" />
<code_context>
 import android.widget.TextView;
 import cn.lineai.R;

-public final class SettingsScreenView extends ScreenSurfaceView {
+public final class SettingsScreenView extends LinearLayout {
     public interface Listener {
</code_context>
<issue_to_address>
**issue (broader_impact):** These screens no longer inherit `ScreenSurfaceView`, so they no longer execute its `onMeasure` logic that applies the 792dp reading-width gutter. In split-screen, tablet, and landscape layouts, their content expands to the full window width instead of retaining the established centered reading width.

**Triggers:** When any of these screens is displayed in a window wider than 792dp.

**Suggested fix:** Keep these classes extending `ScreenSurfaceView`, or move the reading-width measurement behavior into a shared base used by them.
</issue_to_address>

### Comment 2
<location path="app/src/main/java/cn/lineai/ui/component/ActionRowView.java" line_range="57" />
<code_context>

         if (onClick != null) {
             setClickable(true);
-            setBackground(LineTheme.pressable(context));
             setOnClickListener(v -> onClick.run());
         }
</code_context>
<issue_to_address>
**nitpick (bug_risk):** Clickable action and option rows no longer have a pressable background, so taps invoke their listeners without any pressed/ripple visual feedback. This removes the interaction affordance from every caller that relies on these shared row components.

**Triggers:** When the user taps an `ActionRowView` or an inactive `OptionRowView`.

**Suggested fix:** Retain the pressable background for clickable rows and layer the active option color on top of it where needed.
</issue_to_address>

### Comment 3
<location path="app/src/main/java/cn/lineai/ui/component/SectionHeaderView.java" line_range="14" />
<code_context>
         setIncludeFontPadding(false);
         setTypeface(android.graphics.Typeface.create("sans-serif-medium", android.graphics.Typeface.NORMAL));
-        LineTheme.padding(this, 28, 0, 28, 0);
-        if (android.os.Build.VERSION.SDK_INT >= 28) setAccessibilityHeading(true);
+        setLetterSpacing(0.05f);
+        LineTheme.padding(this, LineTheme.LG, 0, LineTheme.LG, 0);
</code_context>
<issue_to_address>
**issue (bug_risk):** `SectionHeaderView` no longer marks section titles as accessibility headings, so screen readers expose these titles as ordinary text and users lose the ability to navigate the settings hierarchy by headings.

**Triggers:** When a screen reader is enabled.

**Suggested fix:** Keep `setAccessibilityHeading(true)` for API 28 and above while applying the restored visual styling.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: app/src/main/java/cn/lineai/ui/component/SettingsScreenView.java:15, app/src/main/java/cn/lineai/ui/component/SectionHeaderView.java:14


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

import android.widget.TextView;
import cn.lineai.R;

public final class SettingsScreenView extends ScreenSurfaceView {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (broader_impact): These screens no longer inherit ScreenSurfaceView, so they no longer execute its onMeasure logic that applies the 792dp reading-width gutter. In split-screen, tablet, and landscape layouts, their content expands to the full window width instead of retaining the established centered reading width.

Triggers: When any of these screens is displayed in a window wider than 792dp.

Suggested fix: Keep these classes extending ScreenSurfaceView, or move the reading-width measurement behavior into a shared base used by them.


if (onClick != null) {
setClickable(true);
setBackground(LineTheme.pressable(context));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nitpick (bug_risk): Clickable action and option rows no longer have a pressable background, so taps invoke their listeners without any pressed/ripple visual feedback. This removes the interaction affordance from every caller that relies on these shared row components.

Triggers: When the user taps an ActionRowView or an inactive OptionRowView.

Suggested fix: Retain the pressable background for clickable rows and layer the active option color on top of it where needed.

setIncludeFontPadding(false);
setTypeface(android.graphics.Typeface.create("sans-serif-medium", android.graphics.Typeface.NORMAL));
LineTheme.padding(this, 28, 0, 28, 0);
if (android.os.Build.VERSION.SDK_INT >= 28) setAccessibilityHeading(true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): SectionHeaderView no longer marks section titles as accessibility headings, so screen readers expose these titles as ordinary text and users lose the ability to navigate the settings hierarchy by headings.

Triggers: When a screen reader is enabled.

Suggested fix: Keep setAccessibilityHeading(true) for API 28 and above while applying the restored visual styling.

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