fix(#509): inline tap feedback (no snackbar) + plain Hide button

Owner feedback: per-tap snackbars appeared over the version/About row and
blocked the next tap; and a 'Hide' switch sitting ON read backwards.

- Tap progress + unlock/already-unlocked now render inline under the
  version number (2s auto-clear timer), so nothing overlays the tap target
  or the app bottom.
- Experimental 'Hide' is now a plain action row, not a switch.

Agent: QuietSnow (session 31eaba02)
chore/542-assets2
Strycher 3 months ago
parent 567745db18
commit a20eebb4ba

@ -218,8 +218,8 @@
"settings_experimental": "Experimental",
"settings_experimentalSubtitle": "Advanced and in-development features",
"settings_experimentalDescription": "These features are experimental and may change or be removed at any time. They default to off.",
"settings_experimentalHide": "Hide this section",
"settings_experimentalHideSubtitle": "Re-hide Experimental. Unlock again with 7 taps on the version row.",
"settings_experimentalHide": "Hide Experimental section",
"settings_experimentalHideSubtitle": "Unlock again anytime with 7 taps on the version row.",
"settings_experimentalUnlocked": "Experimental features unlocked",
"settings_experimentalAlreadyUnlocked": "Experimental features are already unlocked",
"settings_experimentalCountdown": "{count} more taps to unlock experimental features",

@ -1111,13 +1111,13 @@ abstract class AppLocalizations {
/// No description provided for @settings_experimentalHide.
///
/// In en, this message translates to:
/// **'Hide this section'**
/// **'Hide Experimental section'**
String get settings_experimentalHide;
/// No description provided for @settings_experimentalHideSubtitle.
///
/// In en, this message translates to:
/// **'Re-hide Experimental. Unlock again with 7 taps on the version row.'**
/// **'Unlock again anytime with 7 taps on the version row.'**
String get settings_experimentalHideSubtitle;
/// No description provided for @settings_experimentalUnlocked.

@ -552,11 +552,11 @@ class AppLocalizationsBg extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -549,11 +549,11 @@ class AppLocalizationsDe extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -540,11 +540,11 @@ class AppLocalizationsEn extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -550,11 +550,11 @@ class AppLocalizationsEs extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -554,11 +554,11 @@ class AppLocalizationsFr extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -552,11 +552,11 @@ class AppLocalizationsHu extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -552,11 +552,11 @@ class AppLocalizationsIt extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -526,11 +526,11 @@ class AppLocalizationsJa extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -526,11 +526,11 @@ class AppLocalizationsKo extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -546,11 +546,11 @@ class AppLocalizationsNl extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -554,11 +554,11 @@ class AppLocalizationsPl extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -552,11 +552,11 @@ class AppLocalizationsPt extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -551,11 +551,11 @@ class AppLocalizationsRu extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -546,11 +546,11 @@ class AppLocalizationsSk extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -544,11 +544,11 @@ class AppLocalizationsSl extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -541,11 +541,11 @@ class AppLocalizationsSv extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -548,11 +548,11 @@ class AppLocalizationsUk extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -519,11 +519,11 @@ class AppLocalizationsZh extends AppLocalizations {
'These features are experimental and may change or be removed at any time. They default to off.';
@override
String get settings_experimentalHide => 'Hide this section';
String get settings_experimentalHide => 'Hide Experimental section';
@override
String get settings_experimentalHideSubtitle =>
'Re-hide Experimental. Unlock again with 7 taps on the version row.';
'Unlock again anytime with 7 taps on the version row.';
@override
String get settings_experimentalUnlocked => 'Experimental features unlocked';

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -61,6 +63,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
static const Duration _experimentalTapWindow = Duration(seconds: 3);
int _versionTapCount = 0;
DateTime? _lastVersionTap;
// Inline feedback shown in the version row itself (no snackbar — a bottom
// snackbar overlaps the very row being tapped and blocks the next tap).
String? _versionHint;
Timer? _versionHintTimer;
@override
void initState() {
@ -68,6 +74,12 @@ class _SettingsScreenState extends State<SettingsScreen> {
_loadVersionInfo();
}
@override
void dispose() {
_versionHintTimer?.cancel();
super.dispose();
}
Future<void> _loadVersionInfo() async {
final packageInfo = await PackageInfo.fromPlatform();
if (!mounted) return;
@ -82,7 +94,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
if (settingsService.settings.experimentalUnlocked) {
_versionTapCount = 0;
_showVersionSnack(l10n.settings_experimentalAlreadyUnlocked);
_setVersionHint(l10n.settings_experimentalAlreadyUnlocked);
return;
}
@ -98,26 +110,18 @@ class _SettingsScreenState extends State<SettingsScreen> {
if (remaining <= 0) {
_versionTapCount = 0;
settingsService.setExperimentalUnlocked(true);
_showVersionSnack(l10n.settings_experimentalUnlocked);
_setVersionHint(l10n.settings_experimentalUnlocked);
} else if (remaining <= 3) {
_showVersionSnack(
l10n.settings_experimentalCountdown(remaining),
brief: true,
);
_setVersionHint(l10n.settings_experimentalCountdown(remaining));
}
}
void _showVersionSnack(String message, {bool brief = false}) {
ScaffoldMessenger.of(context)
..hideCurrentSnackBar()
..showSnackBar(
SnackBar(
content: Text(message),
duration: brief
? const Duration(milliseconds: 900)
: const Duration(seconds: 2),
),
);
void _setVersionHint(String hint) {
_versionHintTimer?.cancel();
setState(() => _versionHint = hint);
_versionHintTimer = Timer(const Duration(seconds: 2), () {
if (mounted) setState(() => _versionHint = null);
});
}
@override
@ -229,7 +233,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
Widget _experimentalPane(BuildContext context) {
final l10n = context.l10n;
final settingsService = context.watch<AppSettingsService>();
final settingsService = context.read<AppSettingsService>();
return ListView(
padding: const EdgeInsets.all(16),
children: [
@ -242,17 +246,14 @@ class _SettingsScreenState extends State<SettingsScreen> {
const SizedBox(height: 16),
// Future me-centric/experimental toggles land here (e.g. Fast Sync
// #118, CoreScope repeats #524). Empty of features until they arrive.
// A plain action (not a switch) — "hide" is a one-shot, and a switch
// whose ON state means "hidden" read backwards.
Card(
child: SwitchListTile(
secondary: const Icon(Icons.visibility_off_outlined),
child: ListTile(
leading: const Icon(Icons.visibility_off_outlined),
title: Text(l10n.settings_experimentalHide),
subtitle: Text(l10n.settings_experimentalHideSubtitle),
value: settingsService.settings.experimentalUnlocked,
onChanged: (value) {
if (!value) {
settingsService.setExperimentalUnlocked(false);
}
},
onTap: () => settingsService.setExperimentalUnlocked(false),
),
),
],
@ -735,13 +736,31 @@ class _SettingsScreenState extends State<SettingsScreen> {
title: Text(l10n.settings_about),
// Tapping the version number counts toward the #509 unlock and is
// absorbed here; tapping elsewhere on the row still opens the dialog.
// Progress is shown inline (below), never as a snackbar.
subtitle: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: _handleVersionTap,
child: Text(
l10n.settings_aboutVersion(
_appVersion.isEmpty ? l10n.common_loading : _appVersion,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
l10n.settings_aboutVersion(
_appVersion.isEmpty ? l10n.common_loading : _appVersion,
),
),
if (_versionHint != null)
Padding(
padding: const EdgeInsets.only(top: 2),
child: Text(
_versionHint!,
style: TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.primary,
),
),
),
],
),
),
onTap: () => _showAbout(context),

Loading…
Cancel
Save

Powered by TurnKey Linux.