mirror of
https://github.com/block/buzz.git
synced 2026-10-27 04:30:52 +00:00
Attach hidden connection action to labelled wordmark
Keep the developer entry without a keyboard path by product decision. Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Signed-off-by: kenny lopez <klopez4212@gmail.com>
This commit is contained in:
@@ -323,14 +323,7 @@ class _PairingWelcomeView extends HookWidget {
|
||||
setupContent == null &&
|
||||
!signInPending &&
|
||||
!isBusy;
|
||||
final welcome = Semantics(
|
||||
customSemanticsActions: canRevealOptions
|
||||
? {
|
||||
const CustomSemanticsAction(label: 'More connection options'):
|
||||
revealOptions,
|
||||
}
|
||||
: null,
|
||||
child: Padding(
|
||||
final welcome = Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: Grid.gutter,
|
||||
vertical: Grid.sm,
|
||||
@@ -355,6 +348,17 @@ class _PairingWelcomeView extends HookWidget {
|
||||
constraints: const BoxConstraints(maxWidth: 320),
|
||||
child: AspectRatio(
|
||||
aspectRatio: 777 / 326,
|
||||
child: Semantics(
|
||||
// Hidden developer entry intentionally has no
|
||||
// keyboard shortcut. Keep its assistive action
|
||||
// on the existing labelled wordmark node.
|
||||
customSemanticsActions: canRevealOptions
|
||||
? {
|
||||
const CustomSemanticsAction(
|
||||
label: 'More connection options',
|
||||
): revealOptions,
|
||||
}
|
||||
: null,
|
||||
child: OnboardingWordmark(
|
||||
key: const Key('pairing-buzz-wordmark'),
|
||||
color: context._onboardingIsDark
|
||||
@@ -363,6 +367,7 @@ class _PairingWelcomeView extends HookWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: Grid.xxs),
|
||||
Text(
|
||||
'Your people, your agents, your projects —\nall in one place.',
|
||||
@@ -397,9 +402,7 @@ class _PairingWelcomeView extends HookWidget {
|
||||
child: IgnorePointer(
|
||||
ignoring: page != selectedPage,
|
||||
child: AnimatedSlide(
|
||||
key: ValueKey(
|
||||
'welcome-panel-$page',
|
||||
),
|
||||
key: ValueKey('welcome-panel-$page'),
|
||||
offset: Offset(
|
||||
page == selectedPage
|
||||
? 0
|
||||
@@ -430,7 +433,6 @@ class _PairingWelcomeView extends HookWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
return PopScope(
|
||||
canPop: !showingOptions,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:buzz/shared/hosted/hosted_community_creation.dart';
|
||||
import 'package:buzz/shared/hosted/hosted_environment.dart';
|
||||
import 'package:buzz/features/onboarding/hosted_connect_page.dart';
|
||||
@@ -10,6 +12,7 @@ import 'package:buzz/shared/hosted/builderlab_account.dart';
|
||||
import 'package:buzz/shared/hosted/hosted_community_connection.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/semantics.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
@@ -46,7 +49,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
await revealOptions(tester);
|
||||
await revealOptionsWithSemantics(tester);
|
||||
await tester.pumpAndSettle();
|
||||
tester.view.physicalSize = const Size(420, 900);
|
||||
await tester.pumpAndSettle();
|
||||
@@ -322,3 +325,31 @@ Future<void> revealOptions(WidgetTester tester) async {
|
||||
await tester.pump(const Duration(milliseconds: 50));
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> revealOptionsWithSemantics(WidgetTester tester) async {
|
||||
final handle = tester.ensureSemantics();
|
||||
try {
|
||||
await tester.pump();
|
||||
final wordmark = tester.getSemantics(find.bySemanticsLabel('Buzz'));
|
||||
final data = wordmark.getSemanticsData();
|
||||
final actionIds = data.customSemanticsActionIds!;
|
||||
expect(actionIds, hasLength(1));
|
||||
expect(
|
||||
CustomSemanticsAction.getAction(actionIds.single)!.label,
|
||||
'More connection options',
|
||||
);
|
||||
// The action belongs to the wordmark, never an unlabelled page-sized stop.
|
||||
expect(data.label, 'Buzz');
|
||||
expect(wordmark.rect.height, lessThan(200));
|
||||
wordmark.owner!.performAction(
|
||||
wordmark.id,
|
||||
ui.SemanticsAction.customAction,
|
||||
actionIds.single,
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Enter a community link').hitTestable(), findsOneWidget);
|
||||
expect(find.text('Use a pairing code').hitTestable(), findsOneWidget);
|
||||
} finally {
|
||||
handle.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user