style: align sidebar tree chevrons and give titles more room
The project band no longer adds inner padding, so its folder chevron and + sit on the same two vertical lines as the session rows' subagent chevron and ⋮. Every session row now reserves the same 18px chevron column, so a session without subagents starts its title exactly where a parent does, and the compact left/right insets leave the title more width. 0.4.11 (411).
This commit is contained in:
1 parent
9cbd97d532
commit
0f850b6191
6 files changed
+83
-14
No files matched your search
@@ -5,6 +5,18 @@
|
||||
|
||||
---
|
||||
|
||||
## 0.4.11 侧栏对齐调整(分支 `flutter`)
|
||||
|
||||
| 项 | 结果 |
|
||||
| --- | --- |
|
||||
| 折叠箭头对齐 | 项目分组带内部 contentPadding 归零(外层仍为 8):分组折叠箭头与有子代理会话行的箭头在同一条竖线上 |
|
||||
| 左右边距 | 会话行左右均为 8;项目带的 + 与会话行的 ⋮ 也都在右侧 8 的同一竖线上,标题可用宽度更大 |
|
||||
| 标题起点 | 所有顶层会话行都保留固定 18px 的箭头列(无子代理时留空),标题横向起点一致;子代理行缩进 32 并保留竖线 |
|
||||
| 测试 | 新增「分组箭头/子代理箭头同列、有无子代理的标题同起点」用例;52 项全过 |
|
||||
| 版本 | **0.4.11(code 411)** |
|
||||
|
||||
---
|
||||
|
||||
## 0.4.10 子代理树折叠、Agent Task 行与只读输入(分支 `flutter`)
|
||||
|
||||
| 项 | 结果 |
|
||||
|
||||
@@ -5,7 +5,7 @@ Android first. This branch (`flutter`) is a framework evaluation: the same
|
||||
feature set as the earlier Asuka/Go and MyGo attempts, reimplemented in
|
||||
Flutter to compare mobile UI maturity.
|
||||
|
||||
Status: 0.4.10 — servers (passwordless / password login, HTTP/HTTPS and
|
||||
Status: 0.4.11 — servers (passwordless / password login, HTTP/HTTPS and
|
||||
SOCKS5/socks5h proxy, self-signed certificates and pinning, or a pairing link
|
||||
over the OpenChamber private relay with end-to-end encryption; the pairing
|
||||
link is pasted or scanned with the camera), session list with search and live
|
||||
|
||||
@@ -315,10 +315,11 @@ class _SessionListPaneState extends State<SessionListPane> {
|
||||
// Compact like a session row: two dense lines in a 56px band.
|
||||
dense: true,
|
||||
minTileHeight: 56,
|
||||
// The band already insets by 8. A Material 3 list tile ends at 24
|
||||
// (start 16), so 16 here makes the + line up with the session
|
||||
// rows' ⋮.
|
||||
contentPadding: const EdgeInsets.only(left: 8, right: 16),
|
||||
// The band already insets by 8, the same as a session row's
|
||||
// content padding. No padding inside it then makes the folder
|
||||
// chevron and the + share one vertical line with the session rows'
|
||||
// chevron and ⋮.
|
||||
contentPadding: EdgeInsets.zero,
|
||||
leading: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@@ -576,16 +577,22 @@ class _SessionListPaneState extends State<SessionListPane> {
|
||||
// Compact: both the project band and a session row are 56 high.
|
||||
dense: true,
|
||||
minTileHeight: 56,
|
||||
// A fixed chevron column for every session row: rows without
|
||||
// subagents keep the same title start as rows with them. A short gap
|
||||
// after it keeps the title space wide.
|
||||
contentPadding: child
|
||||
? const EdgeInsets.only(left: 32, right: 8)
|
||||
: const EdgeInsets.only(left: 8, right: 8),
|
||||
horizontalTitleGap: 8,
|
||||
selected: selected,
|
||||
selectedTileColor: scheme.primary.withValues(alpha: 0.10),
|
||||
leading: child
|
||||
? Icon(Icons.smart_toy_outlined,
|
||||
size: 16, color: scheme.onSurfaceVariant)
|
||||
? null
|
||||
: children.isEmpty
|
||||
? null
|
||||
? const SizedBox(width: 18)
|
||||
: SizedBox(
|
||||
width: 32,
|
||||
height: 32,
|
||||
width: 18,
|
||||
height: 40,
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
expanded
|
||||
@@ -596,7 +603,7 @@ class _SessionListPaneState extends State<SessionListPane> {
|
||||
padding: EdgeInsets.zero,
|
||||
visualDensity: VisualDensity.compact,
|
||||
constraints:
|
||||
const BoxConstraints(minWidth: 32, minHeight: 32),
|
||||
const BoxConstraints(minWidth: 18, minHeight: 40),
|
||||
onPressed: () => setState(() {
|
||||
if (expanded) {
|
||||
_expandedChildren.remove(session.id);
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
/// The app version sent to the server in pairing and relay handshakes.
|
||||
const appVersion = '0.4.10';
|
||||
const appVersion = '0.4.11';
|
||||
+1
-1
@@ -2,7 +2,7 @@ name: openchamber
|
||||
description: "A lightweight OpenChamber client for phones."
|
||||
publish_to: 'none'
|
||||
|
||||
version: 0.4.10+410
|
||||
version: 0.4.11+411
|
||||
|
||||
environment:
|
||||
sdk: ^3.14.0
|
||||
|
||||
@@ -82,7 +82,7 @@ void main() {
|
||||
await tester.tap(find.byTooltip('展开子代理'));
|
||||
await tester.pump();
|
||||
expect(find.text('输出 hello'), findsOneWidget);
|
||||
expect(find.byIcon(Icons.smart_toy_outlined), findsOneWidget);
|
||||
expect(find.textContaining('子代理 · general'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.text('输出 hello'));
|
||||
await tester.pump();
|
||||
@@ -131,4 +131,54 @@ void main() {
|
||||
final menu = tester.getCenter(find.byIcon(Icons.more_vert));
|
||||
expect(add.dx, closeTo(menu.dx, 0.5));
|
||||
});
|
||||
|
||||
testWidgets('tree chevrons line up with the folder chevron and titles start alike',
|
||||
(tester) async {
|
||||
final app = AppState();
|
||||
final now = DateTime.now().millisecondsSinceEpoch;
|
||||
app.sessions = [
|
||||
Session(
|
||||
id: 'parent',
|
||||
title: '子代理输出 hello',
|
||||
agent: 'build',
|
||||
location: Location(r'C:\msys64\home\Gary\Sources\pineapple-notepad'),
|
||||
created: now,
|
||||
updated: now,
|
||||
),
|
||||
Session(
|
||||
id: 'child',
|
||||
parentID: 'parent',
|
||||
title: '输出 hello',
|
||||
agent: 'general',
|
||||
location: Location(r'C:\msys64\home\Gary\Sources\pineapple-notepad'),
|
||||
created: now - 500,
|
||||
updated: now - 500,
|
||||
),
|
||||
Session(
|
||||
id: 'plain',
|
||||
title: '无子代理的会话',
|
||||
agent: 'build',
|
||||
location: Location(r'C:\msys64\home\Gary\Sources\pineapple-notepad'),
|
||||
created: now - 1000,
|
||||
updated: now - 1000,
|
||||
),
|
||||
];
|
||||
addTearDown(app.dispose);
|
||||
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(body: SessionListPane(app: app)),
|
||||
));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// The folder chevron and a parent's subagent chevron are on one line.
|
||||
final folder = tester.getCenter(find.byIcon(Icons.expand_more).first);
|
||||
final tree = tester.getCenter(find.byTooltip('展开子代理'));
|
||||
expect(tree.dx, closeTo(folder.dx, 0.5));
|
||||
|
||||
// A session without subagents keeps the chevron column, so its title
|
||||
// starts where a parent's does and loses no width.
|
||||
final parentTitle = tester.getTopLeft(find.text('子代理输出 hello')).dx;
|
||||
final plainTitle = tester.getTopLeft(find.text('无子代理的会话')).dx;
|
||||
expect(plainTitle, closeTo(parentTitle, 0.5));
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user