Chat: unnamed chats take the harness title, harness default per folder, word-safe tables, Send later

- New chat: a cleared Name creates the chat without an operator title; the
  list shows the harness's own title, or the default name until it has one.
  The server no longer records "New chat" for a blank title and OpenCode
  is created without a title so it names the session itself.
- New chat harness defaults to the one last used in the chosen folder,
  else anywhere, else OpenCode; remembered on the device per server.
- Markdown tables wrap at word boundaries and never go below a column's
  longest word (tokens over ~40 characters may break); a table whose words
  cannot fit scrolls sideways with the code block affordance.
- Composer: right-click, long-press, Shift+F10 or the context menu key on
  Send opens Send later... (30 min, 1 h, tomorrow 9:00, usage reset, pick a
  time), sent through the same path with send_at.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 19:55:40 +00:00
parent c441400f36
commit b1fcdcf2c3
22 changed files with 1059 additions and 90 deletions
@@ -156,7 +156,7 @@ void main() {
_host(
child: const ChatMarkdownView(
text:
'```\nvery_long_identifier_very_long_identifier_very_long_identifier\n```\n\n| Heading one | Heading two | Heading three |\n| --- | --- | --- |\n| alpha alpha alpha | beta beta beta | gamma gamma gamma |',
'```\nvery_long_identifier_very_long_identifier_very_long_identifier\n```\n\n| H1 | H2 | H3 |\n| --- | --- | --- |\n| a a a a a a a a | b b b b b b | c c c c c c |',
),
),
);
@@ -23,16 +23,11 @@ void main() {
) async {
await pumpTable(
tester,
'| Item | Description | Status |\n| --- | --- | --- |\n'
// Short words, so every column's longest word fits side by side.
'| No | Text | Ok |\n| --- | --- | --- |\n'
'| one | ${List.filled(30, 'word').join(' ')} | done |',
);
expect(
find.descendant(
of: find.byType(ChatMarkdownView),
matching: find.byType(Scrollable),
),
findsNothing,
);
expect(find.text('Scroll horizontally'), findsNothing);
expect(tableRect(tester).right, lessThanOrEqualTo(screenRight));
final description = tester.getSize(find.textContaining('word word'));
final status = tester.getSize(find.text('done'));
@@ -49,6 +44,44 @@ void main() {
expect(tableRect(tester).right, lessThanOrEqualTo(screenRight));
});
testWidgets('a word is never broken to fit; the table scrolls instead', (
tester,
) async {
// Seven columns whose words cannot all fit 390 pixels side by side.
const words = ['Column', 'Another', 'Heading', 'Numbers', 'Remarks'];
await pumpTable(
tester,
'| ${words.join(' | ')} | Owner | Status |\n'
'| --- | --- | --- | --- | --- | --- | --- |\n'
'| a b | c d | e f | g h | i j | k l | m n |',
);
expect(find.text('Scroll horizontally'), findsOneWidget);
expect(
find.bySemanticsLabel('Horizontally scrollable table'),
findsOneWidget,
);
expect(tableRect(tester).width, greaterThan(screenRight));
// Each heading stays on one line: no word broke inside itself.
final line = tester.getSize(find.text('Owner')).height;
for (final word in words) {
expect(tester.getSize(find.text(word)).height, line);
}
});
testWidgets('a column keeps its longest word when the table fits', (
tester,
) async {
await pumpTable(
tester,
'| Column | Notes |\n| --- | --- |\n'
'| x | ${List.filled(40, 'note').join(' ')} |',
);
expect(find.text('Scroll horizontally'), findsNothing);
expect(tableRect(tester).right, lessThanOrEqualTo(screenRight));
final header = tester.getSize(find.text('Column')).height;
expect(header, tester.getSize(find.text('x')).height);
});
testWidgets('a narrow table keeps its content width', (tester) async {
await pumpTable(tester, '| a | b |\n| --- | --- |\n| 1 | 2 |');
expect(tableRect(tester).width, lessThan(screenRight / 2));