Restore classic settings and add request compatibility - #27
Conversation
Reviewer's GuideThis PR consistently restores the pre-redesign settings hierarchy across shared scaffolding, model management, extension/Skill Hub flows, and infrastructure pages by replacing narrow or folded layouts with classic headers, spacing, cards, forms, and fixed action rows, while keeping the current LineTheme palette and prior behavior/accessibility fixes. Sequence diagram for classic model provider selectionsequenceDiagram
actor User
participant ModelAddScreenView
participant ModelFormHelper
participant ModelConfig
User->>ModelAddScreenView: tap provider toggle
ModelAddScreenView->>ModelAddScreenView: updateProviderToggles(providerRow)
ModelAddScreenView->>ModelAddScreenView: updateBaseUrlHint()
ModelAddScreenView->>ModelAddScreenView: renderModelIdInput()
ModelAddScreenView->>ModelAddScreenView: updateQueryState()
ModelAddScreenView->>ModelAddScreenView: updateSaveState()
ModelAddScreenView->>ModelFormHelper: addToggle(providerRow, label, active, enabled, onClick)
ModelAddScreenView->>ModelConfig: protocolForIndex(index)
Flow diagram for restored classic settings page layoutflowchart TD
Open[Open settings subpage] --> Header[Classic centered header]
Header --> Content[Wide content area with restored margins]
Content --> Sections[Section cards and inline descriptions]
Sections --> Forms[Unfolded forms and restored field spacing]
Forms --> Actions[Fixed horizontal action rows]
Actions --> Theme[Apply current LineTheme colors]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 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/SettingsSectionView.java" line_range="36-40" />
<code_context>
- }
- if (row.getParent() instanceof android.view.ViewGroup) {
- ((android.view.ViewGroup) row.getParent()).removeView(row);
+ if (row != null) {
+ if (row.getParent() instanceof android.view.ViewGroup) {
+ ((android.view.ViewGroup) row.getParent()).removeView(row);
+ }
}
if (!divider) {
</code_context>
<issue_to_address>
**issue (bug_risk):** addRow(null, false) now passes null to LinearLayout.addView instead of returning early, which throws when an optional row is absent.
**Triggers:** When any caller supplies a null row to the public addRow API.
**Suggested fix:** Restore the early return when row is null before either addView path.
```suggestion
if (row == null) {
return;
}
if (row.getParent() instanceof android.view.ViewGroup) {
((android.view.ViewGroup) row.getParent()).removeView(row);
}
```
</issue_to_address>
### Comment 2
<location path="app/src/main/java/cn/lineai/ui/component/ModelListScreenView.java" line_range="184" />
<code_context>
TextView title = LineTheme.textMedium(context, model.getName(), LineTheme.FONT_MD, LineTheme.TEXT);
- title.setMaxLines(2);
- title.setEllipsize(android.text.TextUtils.TruncateAt.END);
+ title.setSingleLine(true);
info.addView(title, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
- TextView sub = LineTheme.text(context, provider + " / " + model.getModelId(), LineTheme.FONT_SM, LineTheme.TEXT_TERTIARY, Typeface.NORMAL);
- sub.setMaxLines(2);
- sub.setEllipsize(android.text.TextUtils.TruncateAt.END);
+ TextView sub = LineTheme.text(context, model.getModelId(), LineTheme.FONT_XS, LineTheme.TEXT_TERTIARY, Typeface.NORMAL);
+ sub.setSingleLine(true);
LinearLayout.LayoutParams subParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
</code_context>
<issue_to_address>
**issue (bug_risk):** Model and SkillHub item titles are now forced to one line without ellipsis configuration, so longer names are clipped rather than displayed with the previous two-line fallback.
**Triggers:** When a model name or SkillHub skill name exceeds the available card width.
**Suggested fix:** Retain two lines with ellipsize END, or explicitly set single-line ellipsize behavior if the classic layout requires one line.
```suggestion
title.setMaxLines(2);
title.setEllipsize(android.text.TextUtils.TruncateAt.END);
```
</issue_to_address>Sourcery assessment
Approval pending. 2 findings to address first.
Blocking findings: app/src/main/java/cn/lineai/ui/component/SettingsSectionView.java:40, app/src/main/java/cn/lineai/ui/component/ModelListScreenView.java:184
| if (row != null) { | ||
| if (row.getParent() instanceof android.view.ViewGroup) { | ||
| ((android.view.ViewGroup) row.getParent()).removeView(row); | ||
| } | ||
| } |
There was a problem hiding this comment.
issue (bug_risk): addRow(null, false) now passes null to LinearLayout.addView instead of returning early, which throws when an optional row is absent.
Triggers: When any caller supplies a null row to the public addRow API.
Suggested fix: Restore the early return when row is null before either addView path.
| if (row != null) { | |
| if (row.getParent() instanceof android.view.ViewGroup) { | |
| ((android.view.ViewGroup) row.getParent()).removeView(row); | |
| } | |
| } | |
| if (row == null) { | |
| return; | |
| } | |
| if (row.getParent() instanceof android.view.ViewGroup) { | |
| ((android.view.ViewGroup) row.getParent()).removeView(row); | |
| } |
| TextView title = LineTheme.textMedium(context, model.getName(), LineTheme.FONT_MD, LineTheme.TEXT); | ||
| title.setMaxLines(2); | ||
| title.setEllipsize(android.text.TextUtils.TruncateAt.END); | ||
| title.setSingleLine(true); |
There was a problem hiding this comment.
issue (bug_risk): Model and SkillHub item titles are now forced to one line without ellipsis configuration, so longer names are clipped rather than displayed with the previous two-line fallback.
Triggers: When a model name or SkillHub skill name exceeds the available card width.
Suggested fix: Retain two lines with ellipsize END, or explicitly set single-line ellipsize behavior if the classic layout requires one line.
| title.setSingleLine(true); | |
| title.setMaxLines(2); | |
| title.setEllipsize(android.text.TextUtils.TruncateAt.END); |
问题
#26 只恢复了设置主页和少量共用组件,进入模型、扩展、存储、SSH 等子页面后仍然存在第二套布局。同时,文件改动的接受/撤销会直接改写并重新保存对话消息,执行授权还会插入临时
pending/accepted工具结果,可能中断工具循环并改变后续模型请求的缓存前缀。MCP 工具卡片也使用了独立的背景与间距体系;统一思考档位未经供应商兼容映射,压缩请求固定传入off时会向 GLM 发送不合适的档位。修改
完整恢复设置树
LineTheme配色、隐藏 MCP 内部工具 ID、模型短列表高度修复、主题弹窗配色及无障碍标签。审阅与授权不再污染对话
diff_records.raw_json,不再调用ChatMessage.withToolReview修改原始消息。accepted工具结果;等待确认时也不再插入pending占位结果。显示与工具细节
ChatUiState和时间线组件完整接入;手动收起后不会被刷新重新打开。GLM 思考兼容与压缩接入
ReasoningCompatibility,在模型请求边界把应用的统一思考档位转换为供应商可接受的值。off/low → low、auto/medium/high → high、max → max,并在 GLM 请求中发送thinking.type=enabled与映射后的reasoning_effort。ModelClient共用兼容层;绕过ModelClient的专用摘要路径也显式接入相同映射。off在 GLM 上会转换为low;原生/responses/compact路径不包含思考参数,保持服务端压缩语义。验证
./gradlew test./gradlew :app:lintDebug./gradlew :app:assembleDebug