fix(settings): limit web-session dialog to the profile status icon
Tapping the display name or surrounding whitespace was opening the web-session dialog; only the checkmark/info icon should. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
9888985deb
commit
2d65aeec29
1 changed files with 62 additions and 53 deletions
|
|
@ -46,7 +46,15 @@ class ProfileCard extends StatelessWidget {
|
|||
userLogin: authStore.user.details!.login,
|
||||
radius: 12,
|
||||
),
|
||||
title: GestureDetector(
|
||||
title: Text.rich(
|
||||
TextSpan(
|
||||
text: authStore.user.details!.displayName,
|
||||
children: [
|
||||
const WidgetSpan(child: SizedBox(width: 6)),
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
final navigator = Navigator.of(context);
|
||||
showDialog(
|
||||
|
|
@ -59,13 +67,15 @@ class ProfileCard extends StatelessWidget {
|
|||
actions: hasToken
|
||||
? [
|
||||
TextButton(
|
||||
onPressed: Navigator.of(dialogContext).pop,
|
||||
onPressed:
|
||||
Navigator.of(dialogContext).pop,
|
||||
child: const Text('OK'),
|
||||
),
|
||||
]
|
||||
: [
|
||||
TextButton(
|
||||
onPressed: Navigator.of(dialogContext).pop,
|
||||
onPressed:
|
||||
Navigator.of(dialogContext).pop,
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
FilledButton(
|
||||
|
|
@ -73,7 +83,8 @@ class ProfileCard extends StatelessWidget {
|
|||
Navigator.of(dialogContext).pop();
|
||||
navigator.push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => LoginWebView(),
|
||||
builder: (context) =>
|
||||
LoginWebView(),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
@ -83,13 +94,10 @@ class ProfileCard extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
},
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
text: authStore.user.details!.displayName,
|
||||
children: [
|
||||
const WidgetSpan(child: SizedBox(width: 6)),
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
// Padding enlarges the hit target without stealing taps
|
||||
// on the display name / surrounding ListTile.
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: Icon(
|
||||
hasToken
|
||||
? Icons.check_circle_outline_rounded
|
||||
|
|
@ -98,11 +106,12 @@ class ProfileCard extends StatelessWidget {
|
|||
color: hasToken ? Colors.green : Colors.amber,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
trailing: const Icon(Icons.chevron_right_rounded),
|
||||
onTap: () => _showAccountOptionsModalBottomSheet(context),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue