Merge branch 'worktree-agent-a785be85dc8fbff78'

This commit is contained in:
2026-12-02 20:15:14 +00:00
26 changed files with 1105 additions and 96 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));