Seat the path sheet header with the other sheets

The sheet background was taller than its content, leaving an empty band
above the drag handle. Use the shared sheet header, and rank the share
sheet's own contact with the same name and hash matcher.

Co-authored-by: zjs81 <zjs81@users.noreply.github.com>
This commit is contained in:
Cursor Agentandzjs81 committed 2026-11-20 22:30:35 +00:00
1 parent 3e1c71162d
commit c4675d810e
6 files changed
+203 -89

No files matched your search

+39
View File
@@ -88,6 +88,45 @@ void main() {
expect(timed.map((c) => c.name), ['A', 'B']);
});
test('a labeled key uses the same prefix, substring, then hash order', () {
expect(
rankLabeledKeyQuery(
name: 'Review Radio',
publicKeyHex: '6060abcd',
query: 'my',
aliases: ['My contact'],
),
ContactQueryRank.namePrefix,
);
expect(
rankLabeledKeyQuery(
name: 'Review Radio',
publicKeyHex: '6060abcd',
query: 'radio',
aliases: ['My contact'],
),
ContactQueryRank.nameContains,
);
expect(
rankLabeledKeyQuery(
name: 'Review Radio',
publicKeyHex: '6060abcd',
query: '6060',
aliases: ['My contact'],
),
ContactQueryRank.keyPrefix,
);
expect(
rankLabeledKeyQuery(
name: 'Review Radio',
publicKeyHex: '6060abcd',
query: 'zzzz',
aliases: ['My contact'],
),
isNull,
);
});
test('tie-break applies inside a rank, not across ranks', () {
final olderPrefix = _contact('Acre Older', [
0x01,
+40
View File
@@ -208,6 +208,46 @@ void main() {
expect(button.top, greaterThanOrEqualTo(list.bottom - 1));
});
testWidgets('the title sits at the top of the sheet', (tester) async {
tester.view.physicalSize = const Size(400, 800);
tester.view.devicePixelRatio = 1;
// A phone status bar. The sheet may pad for it, and must not add another
// empty band above the handle.
tester.view.padding = const FakeViewPadding(top: 47);
tester.view.viewPadding = const FakeViewPadding(top: 47);
addTearDown(tester.view.resetPhysicalSize);
addTearDown(tester.view.resetDevicePixelRatio);
addTearDown(tester.view.resetPadding);
addTearDown(tester.view.resetViewPadding);
await tester.pumpWidget(
MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: Builder(
builder: (context) => Scaffold(
body: TextButton(
onPressed: () => PathEditorSheet.show(
context,
availableContacts: _contacts,
pathHashByteWidth: 2,
),
child: const Text('open'),
),
),
),
),
);
await tester.tap(find.text('open'));
await tester.pumpAndSettle();
final sheetTop = tester.getTopLeft(find.byType(BottomSheet)).dy;
final titleTop = tester.getTopLeft(find.text('Build Path')).dy;
// Header only: 8px padding, a 4px handle, and a 10px gap. The status-bar
// inset stays outside the sheet, and there is no extra empty band.
expect(titleTop - sheetTop, inInclusiveRange(16, 36));
});
testWidgets('tapping a repeater adds a visible hop', (tester) async {
await _pumpSheet(tester);
await tester.enterText(