Skip to content

Commit 0570f79

Browse files
acking-youclaude
andauthored
feat(app-server): new-session UX — guidance, config inheritance, sidebar sync (#10)
* feat(app-server): new-session UX — guidance, config inheritance, sidebar sync Improve the brand-new-conversation experience in the Flutter remote-control UI: - Empty state: a new conversation now shows a guidance view (title + four tappable, remote-control-flavored starter prompts: explore the project, run/fix tests, review changes, plan a feature) instead of a bare hint. Tapping a card prefills + focuses the composer. Localized in en + zh. - Config inheritance: the model / permission mode / plan mode / reasoning effort the user last chose are remembered per service (sessionDefaultsProvider) and seeded into each new conversation, instead of resetting to hard defaults. - Sidebar sync: a new session is inserted into the left conversations pane the instant thread/start returns (newest-first), and its message preview is preserved through the thread/list reconcile so it never flickers to "(untitled)". Review-driven hardening: per-service defaults (a model picked on one service can't leak onto another), reset a stale plan toggle on a fresh conversation, and drop a seeded reasoning effort the seeded model doesn't support. Tests: +3 widget tests (mode inheritance, new session appears with its preview, guidance card prefills the composer); existing empty-state assertions updated to the guidance view. Co-Authored-By: Claude Opus 4.8 <[email protected]> * feat(app-server): unify session UI — conversations sidebar, pickers, cards Bring the whole app-session experience onto one soft-card design language (matching the new-session guidance cards): Conversations sidebar: - soft rounded rows (icon + preview + relative-time subtitle), time grouping (Active / Today / Earlier), refined selected + running states, a circular "new conversation" button, a project chip, and a search box that appears once there are enough conversations. Pickers (model / permission / effort): - a shared _optionSheet: drag handle + title + soft option rows (icon + label + description), the selected one filled with a check. Conversation cards: - tool / grouped-tool / file-change cards become soft bordered cards with an accent icon and chevron-expand; the approval card becomes a neutral soft card; the implement bar + error banner become floating rounded cards. The plan card was already on-style. i18n: relative-time strings, group labels, search hint, picker titles (en + zh). Tests: +3 (time grouping, search filter); existing picker/sidebar tests updated to the new widgets. analyze clean, 81 tests pass. Co-Authored-By: Claude Opus 4.8 <[email protected]> * fix(app-server): conversation scroll — no blank on open, edge scrollbar - Opening a content-heavy conversation showed a blank / mid-content view until the user scrolled: a tall, variable-height ListView lays out lazily over several frames, so the single post-frame jump used a stale maxScrollExtent. _scrollToEnd(force) now re-jumps to the bottom across frames until the extent settles, so a long conversation opens at the latest message. - The conversation scrollbar floated at the centred 820px column's edge (mid-window). The scroll area is now full-width (content centred via horizontal padding) so the scrollbar sits flush at the window edge, and a shared thin/rounded scrollbarTheme makes it subtle like a modern web chat. Co-Authored-By: Claude Opus 4.8 <[email protected]> * fix(app-server): stable conversation scrollbar via SuperListView The conversation thumb jumped/resized while scrolling a long session: a plain ListView.builder estimates total scroll extent from a running average of the laid-out rows' heights, and this transcript mixes very short rows (message bubbles, one-word "done" replies) with very tall ones (command / code / output cards, a compacted dump, a huge markdown list). As differently sized rows enter and leave the viewport, that average — and thus maxScrollExtent, the thumb's denominator — lurches, so the thumb size and position jump instead of tracking the drag. Swap ListView.builder for SuperListView.builder (super_sliver_list): it keeps the same lazy virtualization and ScrollController but derives the scroll extent from per-item estimates reconciled against each row's real height as it passes the cache area, so maxScrollExtent stays stable and the thumb is smooth and 1:1 draggable. Two cleanups land in the same edit: hoist the `_rows` getter (was re-scanned for itemCount and again per itemBuilder = O(n^2) per build) into one local, and give each row a stable ValueKey so the extent table tracks rows across streaming upserts and group transitions. `_MessageView` / `_GroupedActivityCard` gain super.key so the keys compile. The settle() loop, _atBottom math, jump-to-latest FAB, and the single SelectionArea are left untouched. Dependency pinned to 0.4.1 (MIT, pure-Dart, all platforms); the buggy-on-desktop animateToItem/ListController path is deliberately avoided. Verified: analyze clean, 81/81 tests pass, and on the live Windows app the thumb keeps a constant size and advances proportionally across the whole range — including scrolling through the tall markdown block — and drags 1:1; the long conversation still opens at the latest message (no blank). Co-Authored-By: Claude Opus 4.8 <[email protected]> * fix(app-server): bundle Noto Sans SC for even Chinese on desktop Chinese rendered with Flutter's default fonts looks thin and unevenly weighted on Windows: with no declared CJK font the OS picks a fallback face per glyph-run and synthesizes weights. Bundle Noto Sans SC (SIL OFL 1.1) and make it the app's primary family on desktop so 中文 and Latin share one evenly-weighted typeface. Desktop-only by design: the ~17 MB font would be dead weight on mobile, whose OS CJK fonts (iOS PingFang SC, Android Noto Sans CJK) already render Chinese well. The font is declared ONLY in pubspec-desktop.yaml (a copy of pubspec.yaml plus a fonts: block); the default pubspec.yaml omits it, so Android/iOS/test builds never bundle it. The 3 desktop release jobs copy the desktop manifest over pubspec.yaml before building; the 2 mobile jobs are untouched. - lib/src/fonts.dart: shared font config. isDesktop is gated on defaultTargetPlatform (NOT dart:io) so `flutter test` — which forces the platform to android — takes the mobile branch and never references the desktop-only family. - theme.dart: fontFamily = Noto Sans SC on desktop, null (system) on mobile, plus a CJK fallback chain (PingFang SC / Noto Sans CJK / Microsoft YaHei). - 10 monospace code/diff/command/markdown styles gain a CJK fallback so Chinese-in-code renders in a real face while ASCII stays monospaced. - release.yml: app-windows/linux/macos swap in pubspec-desktop.yaml. - AGENTS.md: documents the two-manifest scheme + local preview command. Engine caveat (unchanged): Flutter on Windows uses grayscale AA, not ClearType (flutter/flutter#63043), so CJK still reads marginally softer than a native Win32 app — but the thin/uneven weight (the reported complaint) is fixed. Verified: analyze clean, 81/81 tests pass (default no-font manifest), and on the live Windows app (desktop manifest) the new-session cards and title render in Noto Sans SC with even, properly-weighted strokes. Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
1 parent 26ba763 commit 0570f79

18 files changed

Lines changed: 1974 additions & 371 deletions

‎.github/workflows/release.yml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ jobs:
115115
- uses: Swatinem/rust-cache@v2
116116
with:
117117
key: app-windows
118+
# Desktop bundles Noto Sans SC (fixes thin/uneven Chinese on Windows);
119+
# mobile uses the OS CJK font, so only the desktop jobs swap in the
120+
# manifest that declares the font. See AGENTS.md › Fonts.
121+
- name: Activate desktop manifest (bundle Noto Sans SC)
122+
shell: bash
123+
working-directory: apps/flutter
124+
run: cp pubspec-desktop.yaml pubspec.yaml
118125
- name: Build Windows app
119126
working-directory: apps/flutter
120127
run: |
@@ -160,6 +167,10 @@ jobs:
160167
run: |
161168
sudo apt-get update -y
162169
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
170+
- name: Activate desktop manifest (bundle Noto Sans SC)
171+
shell: bash
172+
working-directory: apps/flutter
173+
run: cp pubspec-desktop.yaml pubspec.yaml
163174
- name: Build Linux app
164175
working-directory: apps/flutter
165176
run: |
@@ -255,6 +266,10 @@ jobs:
255266
- uses: Swatinem/rust-cache@v2
256267
with:
257268
key: app-macos
269+
- name: Activate desktop manifest (bundle Noto Sans SC)
270+
shell: bash
271+
working-directory: apps/flutter
272+
run: cp pubspec-desktop.yaml pubspec.yaml
258273
- name: Build macOS app
259274
working-directory: apps/flutter
260275
run: |

‎AGENTS.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,32 @@ cargo doc --workspace --no-deps
174174
flutter_rust_bridge_codegen generate # after editing crates/pocket-codex-bridge/src/api/
175175
```
176176

177+
### Fonts (desktop-only Noto Sans SC)
178+
179+
Chinese renders thin and unevenly weighted on Windows with Flutter's default
180+
fonts, so **desktop** builds bundle **Noto Sans SC** (`apps/flutter/assets/fonts/`,
181+
SIL OFL 1.1). To keep the ~17 MB out of the Android/iOS artifacts, the font is
182+
declared only in `apps/flutter/pubspec-desktop.yaml`, **not** the default
183+
`pubspec.yaml`:
184+
185+
- `pubspec.yaml` — the default used by mobile, `flutter test`, and local dev.
186+
No font. Source of truth for dependencies.
187+
- `pubspec-desktop.yaml` — a copy of `pubspec.yaml` **plus** a `fonts:` block.
188+
The desktop release jobs (`app-windows` / `app-linux` / `app-macos` in
189+
`.github/workflows/release.yml`) `cp pubspec-desktop.yaml pubspec.yaml` before
190+
building. **Keep its dependencies in sync with `pubspec.yaml`.**
191+
192+
`lib/src/fonts.dart` sets the primary family to `Noto Sans SC` only on desktop
193+
(gated on `defaultTargetPlatform`, so `flutter test` — forced to android — takes
194+
the mobile branch); mobile/web use the OS CJK font (PingFang SC / Noto Sans CJK).
195+
To preview the bundled font locally on desktop:
196+
197+
```bash
198+
cp apps/flutter/pubspec-desktop.yaml apps/flutter/pubspec.yaml
199+
(cd apps/flutter && fvm flutter pub get && fvm flutter run -d windows)
200+
git checkout -- apps/flutter/pubspec.yaml # restore before committing
201+
```
202+
177203
## 8. Working with submodules
178204

179205
`deps/codex` and `deps/pb-mapper` are git submodules. They pin specific
16.9 MB
Binary file not shown.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'
2+
3+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4+
This license is copied below, and is also available with a FAQ at:
5+
https://scripts.sil.org/OFL
6+
7+
8+
-----------------------------------------------------------
9+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10+
-----------------------------------------------------------
11+
12+
PREAMBLE
13+
The goals of the Open Font License (OFL) are to stimulate worldwide
14+
development of collaborative font projects, to support the font creation
15+
efforts of academic and linguistic communities, and to provide a free and
16+
open framework in which fonts may be shared and improved in partnership
17+
with others.
18+
19+
The OFL allows the licensed fonts to be used, studied, modified and
20+
redistributed freely as long as they are not sold by themselves. The
21+
fonts, including any derivative works, can be bundled, embedded,
22+
redistributed and/or sold with any software provided that any reserved
23+
names are not used by derivative works. The fonts and derivatives,
24+
however, cannot be released under any other type of license. The
25+
requirement for fonts to remain under this license does not apply
26+
to any document created using the fonts or their derivatives.
27+
28+
DEFINITIONS
29+
"Font Software" refers to the set of files released by the Copyright
30+
Holder(s) under this license and clearly marked as such. This may
31+
include source files, build scripts and documentation.
32+
33+
"Reserved Font Name" refers to any names specified as such after the
34+
copyright statement(s).
35+
36+
"Original Version" refers to the collection of Font Software components as
37+
distributed by the Copyright Holder(s).
38+
39+
"Modified Version" refers to any derivative made by adding to, deleting,
40+
or substituting -- in part or in whole -- any of the components of the
41+
Original Version, by changing formats or by porting the Font Software to a
42+
new environment.
43+
44+
"Author" refers to any designer, engineer, programmer, technical
45+
writer or other person who contributed to the Font Software.
46+
47+
PERMISSION & CONDITIONS
48+
Permission is hereby granted, free of charge, to any person obtaining
49+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
50+
redistribute, and sell modified and unmodified copies of the Font
51+
Software, subject to the following conditions:
52+
53+
1) Neither the Font Software nor any of its individual components,
54+
in Original or Modified Versions, may be sold by itself.
55+
56+
2) Original or Modified Versions of the Font Software may be bundled,
57+
redistributed and/or sold with any software, provided that each copy
58+
contains the above copyright notice and this license. These can be
59+
included either as stand-alone text files, human-readable headers or
60+
in the appropriate machine-readable metadata fields within text or
61+
binary files as long as those fields can be easily viewed by the user.
62+
63+
3) No Modified Version of the Font Software may use the Reserved Font
64+
Name(s) unless explicit written permission is granted by the corresponding
65+
Copyright Holder. This restriction only applies to the primary font name as
66+
presented to the users.
67+
68+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69+
Software shall not be used to promote, endorse or advertise any
70+
Modified Version, except to acknowledge the contribution(s) of the
71+
Copyright Holder(s) and the Author(s) or with their explicit written
72+
permission.
73+
74+
5) The Font Software, modified or unmodified, in part or in whole,
75+
must be distributed entirely under this license, and must not be
76+
distributed under any other license. The requirement for fonts to
77+
remain under this license does not apply to any document created
78+
using the Font Software.
79+
80+
TERMINATION
81+
This license becomes null and void if any of the above conditions are
82+
not met.
83+
84+
DISCLAIMER
85+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93+
OTHER DEALINGS IN THE FONT SOFTWARE.

‎apps/flutter/lib/l10n/app_en.arb‎

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,37 @@
142142
"language": "Language",
143143
"languageSystem": "Follow system",
144144
"languageChinese": "简体中文",
145-
"languageEnglish": "English"
145+
"languageEnglish": "English",
146+
"newSessionTitle": "What should the remote Codex work on?",
147+
"newSessionSubtitle": "Pick a starting point, or just type your task below.",
148+
"suggestExploreTitle": "Explore the project",
149+
"suggestExplorePrompt": "Give me an overview of this project — its structure, main modules, and tech stack.",
150+
"suggestTestsTitle": "Run & fix tests",
151+
"suggestTestsPrompt": "Run the test suite and fix any failing tests.",
152+
"suggestDiffTitle": "Review changes",
153+
"suggestDiffPrompt": "Summarize the current working-tree changes against the main branch.",
154+
"suggestPlanTitle": "Plan a feature",
155+
"suggestPlanPrompt": "Help me plan out a new feature before writing any code.",
156+
"searchConversations": "Search conversations",
157+
"noMatchingThreads": "No matching conversations",
158+
"groupActive": "Active",
159+
"groupToday": "Today",
160+
"groupEarlier": "Earlier",
161+
"running": "Running…",
162+
"timeJustNow": "just now",
163+
"timeMinutesAgo": "{n}m ago",
164+
"@timeMinutesAgo": {
165+
"placeholders": { "n": { "type": "int" } }
166+
},
167+
"timeHoursAgo": "{n}h ago",
168+
"@timeHoursAgo": {
169+
"placeholders": { "n": { "type": "int" } }
170+
},
171+
"timeYesterday": "yesterday",
172+
"timeDaysAgo": "{n}d ago",
173+
"@timeDaysAgo": {
174+
"placeholders": { "n": { "type": "int" } }
175+
},
176+
"modelLabel": "Model",
177+
"permissionLabel": "Permission"
146178
}

‎apps/flutter/lib/l10n/app_zh.arb‎

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,37 @@
142142
"language": "语言",
143143
"languageSystem": "跟随系统",
144144
"languageChinese": "简体中文",
145-
"languageEnglish": "English"
145+
"languageEnglish": "English",
146+
"newSessionTitle": "想让远程 Codex 做点什么?",
147+
"newSessionSubtitle": "选一个起点,或直接在下方输入你的任务。",
148+
"suggestExploreTitle": "了解项目",
149+
"suggestExplorePrompt": "介绍一下这个项目的结构、主要模块和技术栈。",
150+
"suggestTestsTitle": "运行并修复测试",
151+
"suggestTestsPrompt": "运行测试套件,并修复所有失败的用例。",
152+
"suggestDiffTitle": "审查改动",
153+
"suggestDiffPrompt": "总结当前工作区相对主分支的改动。",
154+
"suggestPlanTitle": "规划功能",
155+
"suggestPlanPrompt": "在写代码之前,帮我规划一个新功能。",
156+
"searchConversations": "搜索会话",
157+
"noMatchingThreads": "没有匹配的会话",
158+
"groupActive": "进行中",
159+
"groupToday": "今天",
160+
"groupEarlier": "更早",
161+
"running": "运行中…",
162+
"timeJustNow": "刚刚",
163+
"timeMinutesAgo": "{n} 分钟前",
164+
"@timeMinutesAgo": {
165+
"placeholders": { "n": { "type": "int" } }
166+
},
167+
"timeHoursAgo": "{n} 小时前",
168+
"@timeHoursAgo": {
169+
"placeholders": { "n": { "type": "int" } }
170+
},
171+
"timeYesterday": "昨天",
172+
"timeDaysAgo": "{n} 天前",
173+
"@timeDaysAgo": {
174+
"placeholders": { "n": { "type": "int" } }
175+
},
176+
"modelLabel": "模型",
177+
"permissionLabel": "权限"
146178
}

‎apps/flutter/lib/l10n/gen/app_localizations.dart‎

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,144 @@ abstract class AppLocalizations {
901901
/// In en, this message translates to:
902902
/// **'English'**
903903
String get languageEnglish;
904+
905+
/// No description provided for @newSessionTitle.
906+
///
907+
/// In en, this message translates to:
908+
/// **'What should the remote Codex work on?'**
909+
String get newSessionTitle;
910+
911+
/// No description provided for @newSessionSubtitle.
912+
///
913+
/// In en, this message translates to:
914+
/// **'Pick a starting point, or just type your task below.'**
915+
String get newSessionSubtitle;
916+
917+
/// No description provided for @suggestExploreTitle.
918+
///
919+
/// In en, this message translates to:
920+
/// **'Explore the project'**
921+
String get suggestExploreTitle;
922+
923+
/// No description provided for @suggestExplorePrompt.
924+
///
925+
/// In en, this message translates to:
926+
/// **'Give me an overview of this project — its structure, main modules, and tech stack.'**
927+
String get suggestExplorePrompt;
928+
929+
/// No description provided for @suggestTestsTitle.
930+
///
931+
/// In en, this message translates to:
932+
/// **'Run & fix tests'**
933+
String get suggestTestsTitle;
934+
935+
/// No description provided for @suggestTestsPrompt.
936+
///
937+
/// In en, this message translates to:
938+
/// **'Run the test suite and fix any failing tests.'**
939+
String get suggestTestsPrompt;
940+
941+
/// No description provided for @suggestDiffTitle.
942+
///
943+
/// In en, this message translates to:
944+
/// **'Review changes'**
945+
String get suggestDiffTitle;
946+
947+
/// No description provided for @suggestDiffPrompt.
948+
///
949+
/// In en, this message translates to:
950+
/// **'Summarize the current working-tree changes against the main branch.'**
951+
String get suggestDiffPrompt;
952+
953+
/// No description provided for @suggestPlanTitle.
954+
///
955+
/// In en, this message translates to:
956+
/// **'Plan a feature'**
957+
String get suggestPlanTitle;
958+
959+
/// No description provided for @suggestPlanPrompt.
960+
///
961+
/// In en, this message translates to:
962+
/// **'Help me plan out a new feature before writing any code.'**
963+
String get suggestPlanPrompt;
964+
965+
/// No description provided for @searchConversations.
966+
///
967+
/// In en, this message translates to:
968+
/// **'Search conversations'**
969+
String get searchConversations;
970+
971+
/// No description provided for @noMatchingThreads.
972+
///
973+
/// In en, this message translates to:
974+
/// **'No matching conversations'**
975+
String get noMatchingThreads;
976+
977+
/// No description provided for @groupActive.
978+
///
979+
/// In en, this message translates to:
980+
/// **'Active'**
981+
String get groupActive;
982+
983+
/// No description provided for @groupToday.
984+
///
985+
/// In en, this message translates to:
986+
/// **'Today'**
987+
String get groupToday;
988+
989+
/// No description provided for @groupEarlier.
990+
///
991+
/// In en, this message translates to:
992+
/// **'Earlier'**
993+
String get groupEarlier;
994+
995+
/// No description provided for @running.
996+
///
997+
/// In en, this message translates to:
998+
/// **'Running…'**
999+
String get running;
1000+
1001+
/// No description provided for @timeJustNow.
1002+
///
1003+
/// In en, this message translates to:
1004+
/// **'just now'**
1005+
String get timeJustNow;
1006+
1007+
/// No description provided for @timeMinutesAgo.
1008+
///
1009+
/// In en, this message translates to:
1010+
/// **'{n}m ago'**
1011+
String timeMinutesAgo(int n);
1012+
1013+
/// No description provided for @timeHoursAgo.
1014+
///
1015+
/// In en, this message translates to:
1016+
/// **'{n}h ago'**
1017+
String timeHoursAgo(int n);
1018+
1019+
/// No description provided for @timeYesterday.
1020+
///
1021+
/// In en, this message translates to:
1022+
/// **'yesterday'**
1023+
String get timeYesterday;
1024+
1025+
/// No description provided for @timeDaysAgo.
1026+
///
1027+
/// In en, this message translates to:
1028+
/// **'{n}d ago'**
1029+
String timeDaysAgo(int n);
1030+
1031+
/// No description provided for @modelLabel.
1032+
///
1033+
/// In en, this message translates to:
1034+
/// **'Model'**
1035+
String get modelLabel;
1036+
1037+
/// No description provided for @permissionLabel.
1038+
///
1039+
/// In en, this message translates to:
1040+
/// **'Permission'**
1041+
String get permissionLabel;
9041042
}
9051043

9061044
class _AppLocalizationsDelegate

0 commit comments

Comments
 (0)