Skip to content

Commit d1f8719

Browse files
committed
[red] reproduce landscape keyboard panel overflow
Signed-off-by: Viwat Vchirawongkwin <viwat.v@chula.ac.th>
1 parent b8376fe commit d1f8719

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

‎app/test/widget/app_shell_test.dart‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,62 @@ Future<void> _focusLandscapeBlocks(WidgetTester tester) async {
9292
}
9393

9494
void main() {
95+
group('landscape software keyboard', () {
96+
for (final double inset in <double>[404, 440]) {
97+
testWidgets('keeps editing and navigation usable with $inset dp inset', (
98+
WidgetTester tester,
99+
) async {
100+
const ShellSurface lenovo = ShellSurface(
101+
'lenovo_landscape',
102+
Size(2000 / 1.5, 800),
103+
1.5,
104+
);
105+
await pumpShell(
106+
tester,
107+
connection: fakeConnection(initial: ConnState.ready),
108+
surface: lenovo,
109+
);
110+
final Finder editor = find.byType(EditableText).first;
111+
await tester.tap(editor);
112+
await tester.enterText(editor, '# keyboard recovery check');
113+
tester.view.viewInsets = FakeViewPadding(bottom: inset * 1.5);
114+
addTearDown(tester.view.resetViewInsets);
115+
await tester.pumpAndSettle();
116+
117+
expect(tester.takeException(), isNull);
118+
expect(tester.getSize(editor).height, greaterThanOrEqualTo(80));
119+
expect(tester.getRect(editor).bottom, lessThanOrEqualTo(800 - inset));
120+
expect(
121+
tester
122+
.widget<ConsoleStripView>(find.byType(ConsoleStripView))
123+
.collapsed,
124+
isTrue,
125+
);
126+
expect(
127+
tester.widget<EditableText>(editor).controller.text,
128+
'# keyboard recovery check',
129+
);
130+
final Finder blocks = _landscapeBlocksDestination();
131+
await tester.ensureVisible(blocks);
132+
expect(blocks.hitTestable(), findsOneWidget);
133+
134+
tester.view.resetViewInsets();
135+
await tester.pumpAndSettle();
136+
expect(tester.takeException(), isNull);
137+
expect(
138+
tester
139+
.widget<ConsoleStripView>(find.byType(ConsoleStripView))
140+
.collapsed,
141+
isFalse,
142+
);
143+
expect(
144+
tester.widget<EditableText>(editor).controller.text,
145+
'# keyboard recovery check',
146+
);
147+
});
148+
}
149+
});
150+
95151
group('A-05 shell renders and binds to Connection', () {
96152
testWidgets('shows the IDE navigation destinations on iPad landscape '
97153
'(connected)', (tester) async {

‎docs/specifications/App/specs.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,7 @@ implementation:
10111011
- **FR-UI-5** — The layout MUST be tablet-first but MUST NOT break on a phone (phone is best-effort). MUST (*source: PRD §13.2, §19, app.md §5; verify: golden; story: A-20*)
10121012
- **FR-UI-6** — Interactive controls MUST use large touch targets and MUST clearly communicate connection and run state (disconnected/connecting/ready/running/error). MUST (*source: PRD §13.2; verify: golden; story: A-22*)
10131013
- **FR-UI-7** — No UI panel MUST bind to BLE directly; every panel binds to `Connection`. MUST (*source: PRD §19, app.md §1; verify: unit; story: all A-2x/3x*)
1014+
- **FR-UI-8** — With a landscape software keyboard open, the connected shell MUST retain a usable editor viewport and reachable navigation without panel overflow. The console output strip MUST temporarily collapse to its status/actions bar while retaining buffered output; expanding it dismisses the keyboard. Navigation destinations MUST remain reachable by scrolling when height is constrained. Closing the keyboard restores the ordinary console layout and preserves the current document and selection. MUST (*source: FR-UI-1/5/6, NFR-A11Y-3; verify: widget and physical keyboard observations*)
10141015

10151016
### 4.14 Scan/Connect Flow UI (`lib/connect/`) — FR-CONNECT
10161017

0 commit comments

Comments
 (0)