mirror of
https://github.com/kuhyx/todo-app.git
synced 2026-11-22 19:32:20 +01:00
Audit icons: add 1-word hover tooltips
Todo: fe70b845
This commit is contained in:
parent
f20e2ab16f
commit
7153630a2e
@ -108,6 +108,7 @@ class AttachButton extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IconButton(
|
||||
tooltip: 'attach',
|
||||
icon: const Icon(Icons.attach_file, semanticLabel: 'Attach'),
|
||||
onPressed: () async {
|
||||
final files = await (picking ?? pickAttachments)(context);
|
||||
|
||||
@ -87,11 +87,13 @@ class CaptureAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
// Not gated on advanced mode: attaching is basic capture.
|
||||
AttachButton(onFiles: onAttachFiles, picking: attachmentPicking),
|
||||
IconButton(
|
||||
tooltip: 'new',
|
||||
onPressed: onNewNote,
|
||||
icon: const Icon(Icons.check, semanticLabel: 'New note'),
|
||||
),
|
||||
if (advanced)
|
||||
IconButton(
|
||||
tooltip: 'sync',
|
||||
onPressed: syncing ? null : onSync,
|
||||
icon: syncing
|
||||
? const WaitWatch(
|
||||
@ -105,6 +107,7 @@ class CaptureAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
: const Icon(Icons.sync, semanticLabel: 'Sync'),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: 'notes',
|
||||
onPressed: onOpenList,
|
||||
icon: const Icon(Icons.list, semanticLabel: 'Notes'),
|
||||
),
|
||||
@ -123,6 +126,7 @@ class CaptureAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
),
|
||||
CaptureConfirmMark(captured: captured),
|
||||
IconButton(
|
||||
tooltip: 'settings',
|
||||
onPressed: onOpenSettings,
|
||||
icon: const Icon(Icons.settings, semanticLabel: 'Settings'),
|
||||
),
|
||||
|
||||
@ -189,6 +189,7 @@ class _CloudImagesScreenState extends State<CloudImagesScreen> {
|
||||
),
|
||||
if (!status.configured)
|
||||
IconButton(
|
||||
tooltip: 'copy',
|
||||
onPressed: () => unawaited(
|
||||
Clipboard.setData(
|
||||
const ClipboardData(text: kAddLoginCommand),
|
||||
|
||||
@ -42,12 +42,14 @@ class _ConfirmDeleteDialog extends StatelessWidget {
|
||||
actions: [
|
||||
IconButton(
|
||||
key: const ValueKey('confirm-cancel'),
|
||||
tooltip: 'cancel',
|
||||
autofocus: true,
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
icon: const Icon(Icons.close, semanticLabel: 'Cancel'),
|
||||
),
|
||||
IconButton(
|
||||
key: const ValueKey('confirm-delete'),
|
||||
tooltip: 'delete',
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
icon: Icon(Icons.delete, color: error, semanticLabel: 'Delete'),
|
||||
),
|
||||
|
||||
@ -15,18 +15,10 @@ import 'package:todo/ui/status_cue.dart';
|
||||
part 'github_mirror_screen_widget.dart';
|
||||
|
||||
class _GitHubMirrorScreenState extends State<GitHubMirrorScreen> {
|
||||
late final TextEditingController _owner = TextEditingController(
|
||||
text: widget.initial.owner,
|
||||
);
|
||||
late final TextEditingController _repo = TextEditingController(
|
||||
text: widget.initial.repo,
|
||||
);
|
||||
late final TextEditingController _token = TextEditingController(
|
||||
text: widget.initial.token,
|
||||
);
|
||||
late final TextEditingController _clientId = TextEditingController(
|
||||
text: widget.initial.clientId,
|
||||
);
|
||||
late final _owner = TextEditingController(text: widget.initial.owner);
|
||||
late final _repo = TextEditingController(text: widget.initial.repo);
|
||||
late final _token = TextEditingController(text: widget.initial.token);
|
||||
late final _clientId = TextEditingController(text: widget.initial.clientId);
|
||||
|
||||
bool _testing = false;
|
||||
StatusCue? _status;
|
||||
@ -177,6 +169,7 @@ class _GitHubMirrorScreenState extends State<GitHubMirrorScreen> {
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: IconButton.filled(
|
||||
tooltip: 'connect',
|
||||
onPressed: _connectGitHub,
|
||||
icon: const Icon(Icons.login, semanticLabel: 'Connect GitHub'),
|
||||
),
|
||||
@ -221,6 +214,7 @@ class _GitHubMirrorScreenState extends State<GitHubMirrorScreen> {
|
||||
Row(
|
||||
children: [
|
||||
IconButton.outlined(
|
||||
tooltip: 'test',
|
||||
onPressed: _testing ? null : _test,
|
||||
icon: _testing
|
||||
? const WaitWatch(
|
||||
@ -238,6 +232,7 @@ class _GitHubMirrorScreenState extends State<GitHubMirrorScreen> {
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
IconButton.filled(
|
||||
tooltip: 'save',
|
||||
onPressed: _save,
|
||||
icon: const Icon(Icons.save, semanticLabel: 'Save'),
|
||||
),
|
||||
|
||||
@ -99,6 +99,7 @@ class _NoteActionsSheetState extends State<NoteActionsSheet> {
|
||||
const SizedBox(height: 16),
|
||||
Align(
|
||||
child: IconButton.outlined(
|
||||
tooltip: 'delete',
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
icon: const Icon(
|
||||
Icons.delete_outline,
|
||||
|
||||
@ -16,6 +16,8 @@ const IconData kCreatedIcon = Icons.post_add;
|
||||
const IconData kUpdatedIcon = Icons.update;
|
||||
|
||||
/// A labelled date range shown as one preset menu plus a custom picker.
|
||||
///
|
||||
/// One-word tooltips on hover/long-press per textgate rule.
|
||||
class DateRangeField extends StatelessWidget {
|
||||
/// Creates a labelled date-range control.
|
||||
const DateRangeField({
|
||||
@ -96,12 +98,29 @@ class DateRangeField extends StatelessWidget {
|
||||
// A popup menu rather than DropdownButton: re-picking "Custom…" while a
|
||||
// custom range is shown must still reopen the picker.
|
||||
return PopupMenuButton<_Preset>(
|
||||
// Empty, not the label: a tooltip is painted on long-press.
|
||||
tooltip: '',
|
||||
tooltip: 'range',
|
||||
onSelected: (p) => _select(context, p),
|
||||
itemBuilder: (_) => [
|
||||
for (final p in _Preset.values)
|
||||
PopupMenuItem(value: p, child: p.glyph()),
|
||||
PopupMenuItem(
|
||||
value: _Preset.any,
|
||||
child: Tooltip(message: 'any', child: _Preset.any.glyph()),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: _Preset.today,
|
||||
child: Tooltip(message: 'today', child: _Preset.today.glyph()),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: _Preset.week,
|
||||
child: Tooltip(message: 'week', child: _Preset.week.glyph()),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: _Preset.month,
|
||||
child: Tooltip(message: 'month', child: _Preset.month.glyph()),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: _Preset.custom,
|
||||
child: Tooltip(message: 'custom', child: _Preset.custom.glyph()),
|
||||
),
|
||||
],
|
||||
child: InputDecorator(
|
||||
decoration: InputDecoration(
|
||||
|
||||
@ -103,6 +103,7 @@ class _NoteDetailScreenState extends State<NoteDetailScreen> {
|
||||
picking: widget.attachmentPicking,
|
||||
),
|
||||
IconButton(
|
||||
tooltip: 'copy',
|
||||
icon: Icon(
|
||||
_copied ? Icons.check : Icons.copy_all,
|
||||
semanticLabel: 'Copy',
|
||||
@ -110,6 +111,7 @@ class _NoteDetailScreenState extends State<NoteDetailScreen> {
|
||||
onPressed: _copy,
|
||||
),
|
||||
IconButton(
|
||||
tooltip: 'delete',
|
||||
icon: const Icon(
|
||||
Icons.delete_outline,
|
||||
semanticLabel: 'Delete note',
|
||||
|
||||
@ -67,6 +67,7 @@ class NoteEditorStepPage extends StatelessWidget {
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: IconButton(
|
||||
tooltip: 'exit',
|
||||
icon: const Icon(Icons.arrow_back, semanticLabel: 'Exit guided'),
|
||||
onPressed: onExit,
|
||||
),
|
||||
|
||||
@ -58,6 +58,7 @@ class _NoteEditorWizardState extends State<NoteEditorWizard> {
|
||||
Row(
|
||||
children: [
|
||||
IconButton(
|
||||
tooltip: 'cancel',
|
||||
icon: const Icon(Icons.close, semanticLabel: 'Cancel'),
|
||||
onPressed: widget.onCancel,
|
||||
),
|
||||
|
||||
@ -51,6 +51,7 @@ class NoteTile extends StatelessWidget {
|
||||
),
|
||||
subtitle: _meta(context),
|
||||
trailing: IconButton(
|
||||
tooltip: 'actions',
|
||||
icon: const Icon(Icons.more_vert, semanticLabel: 'Quick actions'),
|
||||
onPressed: onActions,
|
||||
),
|
||||
|
||||
@ -140,6 +140,7 @@ class _NotesListScreenState extends State<NotesListScreen> {
|
||||
_selectButton(),
|
||||
// Eye, no label: open = Claude-made notes shown, slashed = hidden.
|
||||
IconButton(
|
||||
tooltip: 'claude',
|
||||
icon: Icon(
|
||||
widget.appSettings.value.showClaudeNotes
|
||||
? Icons.visibility
|
||||
@ -148,31 +149,7 @@ class _NotesListScreenState extends State<NotesListScreen> {
|
||||
),
|
||||
onPressed: _toggleClaudeNotes,
|
||||
),
|
||||
PopupMenuButton<NoteSort>(
|
||||
// Empty, not omitted: null falls back to the painted "Show menu".
|
||||
tooltip: '',
|
||||
icon: const Icon(Icons.sort, semanticLabel: 'Sort'),
|
||||
initialValue: _sort,
|
||||
onSelected: _setSort,
|
||||
itemBuilder: (_) => const [
|
||||
PopupMenuItem(
|
||||
value: NoteSort.modifiedDesc,
|
||||
child: Icon(Icons.update, semanticLabel: 'Last updated'),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: NoteSort.createdDesc,
|
||||
child: Icon(Icons.post_add, semanticLabel: 'Newest created'),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: NoteSort.alphabetical,
|
||||
child: Icon(Icons.sort_by_alpha, semanticLabel: 'Alphabetical'),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: NoteSort.priorityDesc,
|
||||
child: Icon(Icons.flag_outlined, semanticLabel: 'Priority'),
|
||||
),
|
||||
],
|
||||
),
|
||||
_sortButton(),
|
||||
// Filter icon with a badge counting user-applied facets. The
|
||||
// trailing padding + inward offset keep the badge from being
|
||||
// clipped at the screen edge.
|
||||
@ -183,6 +160,7 @@ class _NotesListScreenState extends State<NotesListScreen> {
|
||||
label: Text('$badgeCount'),
|
||||
offset: const Offset(-8, 4),
|
||||
child: IconButton(
|
||||
tooltip: 'filter',
|
||||
icon: const Icon(Icons.filter_list, semanticLabel: 'Filter'),
|
||||
onPressed: _openFilters,
|
||||
),
|
||||
|
||||
@ -9,6 +9,7 @@ extension _Selecting on _NotesListScreenState {
|
||||
/// App-bar toggle into and out of selection mode (tinted while on).
|
||||
Widget _selectButton() => IconButton(
|
||||
key: const ValueKey('select-mode'),
|
||||
tooltip: 'select',
|
||||
isSelected: _selection.active,
|
||||
onPressed: _selection.toggleMode,
|
||||
icon: const Icon(Icons.checklist, semanticLabel: 'Select'),
|
||||
@ -40,4 +41,43 @@ extension _Selecting on _NotesListScreenState {
|
||||
onClear: _selection.clear,
|
||||
);
|
||||
}
|
||||
|
||||
/// App-bar sort menu: one icon per order, each with a one-word tooltip.
|
||||
Widget _sortButton() => PopupMenuButton<NoteSort>(
|
||||
// One word, not omitted: null falls back to the painted "Show menu".
|
||||
tooltip: 'sort',
|
||||
icon: const Icon(Icons.sort, semanticLabel: 'Sort'),
|
||||
initialValue: _sort,
|
||||
onSelected: _setSort,
|
||||
itemBuilder: (_) => const [
|
||||
PopupMenuItem(
|
||||
value: NoteSort.modifiedDesc,
|
||||
child: Tooltip(
|
||||
message: 'updated',
|
||||
child: Icon(Icons.update, semanticLabel: 'Last updated'),
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: NoteSort.createdDesc,
|
||||
child: Tooltip(
|
||||
message: 'newest',
|
||||
child: Icon(Icons.post_add, semanticLabel: 'Newest created'),
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: NoteSort.alphabetical,
|
||||
child: Tooltip(
|
||||
message: 'alphabetical',
|
||||
child: Icon(Icons.sort_by_alpha, semanticLabel: 'Alphabetical'),
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: NoteSort.priorityDesc,
|
||||
child: Tooltip(
|
||||
message: 'priority',
|
||||
child: Icon(Icons.flag_outlined, semanticLabel: 'Priority'),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@ -13,8 +13,7 @@ const kRefusalFlash = Duration(milliseconds: 1500);
|
||||
|
||||
/// Set status, set priority, assign to repo, clear: icons only.
|
||||
///
|
||||
/// Menus pass `tooltip: ''` because a tooltip is visible text; the icons
|
||||
/// carry semantic labels instead.
|
||||
/// One-word tooltips on hover/long-press per textgate rule.
|
||||
class NotesSelectionBar extends StatefulWidget {
|
||||
/// Creates the bar; every callback acts on the whole selection.
|
||||
const NotesSelectionBar({
|
||||
@ -70,7 +69,7 @@ class _NotesSelectionBarState extends State<NotesSelectionBar> {
|
||||
children: [
|
||||
PopupMenuButton<Status>(
|
||||
key: const ValueKey('bulk-status'),
|
||||
tooltip: '',
|
||||
tooltip: 'status',
|
||||
icon: const Icon(Icons.task_alt, semanticLabel: 'Set status'),
|
||||
onSelected: widget.onStatus,
|
||||
itemBuilder: (_) => [
|
||||
@ -84,7 +83,7 @@ class _NotesSelectionBarState extends State<NotesSelectionBar> {
|
||||
),
|
||||
PopupMenuButton<Priority>(
|
||||
key: const ValueKey('bulk-priority'),
|
||||
tooltip: '',
|
||||
tooltip: 'priority',
|
||||
icon: const Icon(
|
||||
Icons.flag_outlined,
|
||||
semanticLabel: 'Set priority',
|
||||
@ -105,6 +104,7 @@ class _NotesSelectionBarState extends State<NotesSelectionBar> {
|
||||
),
|
||||
IconButton(
|
||||
key: const ValueKey('bulk-assign'),
|
||||
tooltip: 'assign',
|
||||
onPressed: _assign,
|
||||
icon: Icon(
|
||||
refused ? Icons.block : Icons.drive_file_move_outline,
|
||||
|
||||
@ -83,6 +83,7 @@ class _RepoPickerSheetState extends State<RepoPickerSheet> {
|
||||
: null,
|
||||
suffixIcon: IconButton(
|
||||
key: const ValueKey('repo-new-submit'),
|
||||
tooltip: 'use',
|
||||
onPressed: _submit,
|
||||
icon: const Icon(Icons.check, semanticLabel: 'Use repo'),
|
||||
),
|
||||
|
||||
@ -22,6 +22,8 @@ import 'package:todo/ui/app_route.dart';
|
||||
import 'package:todo/ui/cloud_images_settings.dart';
|
||||
import 'package:todo/ui/github_mirror_screen.dart';
|
||||
|
||||
part 'settings_screen_actions.dart';
|
||||
|
||||
/// Settings screen: the "Enable advanced" toggle plus links to the two sync
|
||||
/// surfaces.
|
||||
///
|
||||
@ -141,87 +143,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Exports every note to a single Markdown file. On mobile this opens the
|
||||
/// system share sheet; on desktop it writes the canonical `~/src/todo/
|
||||
/// BACKLOG.md` so a future tool/agent has a stable path to read.
|
||||
Future<void> _export() async {
|
||||
final notes = await widget.repository.listNotes();
|
||||
final markdown = NotesMarkdown.export(notes);
|
||||
await exportBacklog(markdown, notes.length);
|
||||
}
|
||||
|
||||
/// Imports notes from a user-picked Markdown file, merging by id so a
|
||||
/// stale backup never clobbers a newer local edit (see
|
||||
/// [NoteRepository.importNotes]).
|
||||
Future<void> _import() async {
|
||||
const group = XTypeGroup(
|
||||
label: 'Markdown',
|
||||
extensions: ['md', 'markdown', 'txt'],
|
||||
// UTIs/MIME so the picker accepts the file on iOS/Android too.
|
||||
uniformTypeIdentifiers: ['net.daringfireball.markdown', 'public.text'],
|
||||
mimeTypes: ['text/markdown', 'text/plain'],
|
||||
);
|
||||
final file = await openFile(acceptedTypeGroups: const [group]);
|
||||
if (file == null) return; // user cancelled
|
||||
final content = await file.readAsString();
|
||||
final notes = NotesMarkdown.parse(content);
|
||||
await widget.repository.importNotes(notes);
|
||||
}
|
||||
|
||||
/// Retries the sync after a passphrase is entered; the lock tile follows
|
||||
/// [e2eLocked], which the run updates.
|
||||
Future<void> _syncNow() async {
|
||||
try {
|
||||
await runSync(
|
||||
widget.repository,
|
||||
widget.initial,
|
||||
httpClient: widget.httpClient,
|
||||
firebaseFactory: widget.firebaseFactory,
|
||||
stateStore: widget.stateStore,
|
||||
);
|
||||
} on Exception {
|
||||
// The capture screen's status line reports sync failures.
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _openSyncSettings() async {
|
||||
await Navigator.of(context).push<void>(
|
||||
appRoute(
|
||||
context,
|
||||
(_) => SyncSettingsScreen(
|
||||
accountLoader: widget.accountLoader ?? loadAccount,
|
||||
accountSaver: widget.accountSaver ?? saveAccount,
|
||||
accountClearer: widget.accountClearer ?? clearAccount,
|
||||
sessionProbe: widget.sessionProbe ?? isFirebaseConfigured,
|
||||
firebaseFactory: widget.firebaseFactory ?? openFirebase,
|
||||
googleFirebaseFactory:
|
||||
widget.googleFirebaseFactory ?? openFirebaseWithGoogle,
|
||||
googleAvailable: widget.googleAvailable ?? googleSignInSupported,
|
||||
backup: BackupSlot(label: 'notes', export: _export, import: _import),
|
||||
),
|
||||
name: '/settings/sync',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _openGitHubMirror() async {
|
||||
await Navigator.of(context).push<SyncSettings>(
|
||||
appRoute(
|
||||
context,
|
||||
(_) => GitHubMirrorScreen(
|
||||
initial: widget.initial,
|
||||
repository: widget.repository,
|
||||
appSettings: widget.appSettings,
|
||||
analytics: widget.analytics,
|
||||
httpClient: widget.httpClient,
|
||||
firebaseFactory: widget.firebaseFactory,
|
||||
stateStore: widget.stateStore,
|
||||
),
|
||||
name: '/settings/github',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
|
||||
89
lib/ui/settings_screen_actions.dart
Normal file
89
lib/ui/settings_screen_actions.dart
Normal file
@ -0,0 +1,89 @@
|
||||
/// The settings screen's actions: Markdown export/import, sync now, and the
|
||||
/// routes to the two sync screens.
|
||||
///
|
||||
/// A `part` of `settings_screen.dart` because they read the screen's
|
||||
/// private state; split out for file size.
|
||||
part of 'settings_screen.dart';
|
||||
|
||||
extension _SettingsActions on _SettingsScreenState {
|
||||
/// Exports every note to a single Markdown file. On mobile this opens the
|
||||
/// system share sheet; on desktop it writes the canonical `~/src/todo/
|
||||
/// BACKLOG.md` so a future tool/agent has a stable path to read.
|
||||
Future<void> _export() async {
|
||||
final notes = await widget.repository.listNotes();
|
||||
final markdown = NotesMarkdown.export(notes);
|
||||
await exportBacklog(markdown, notes.length);
|
||||
}
|
||||
|
||||
/// Imports notes from a user-picked Markdown file, merging by id so a
|
||||
/// stale backup never clobbers a newer local edit (see
|
||||
/// [NoteRepository.importNotes]).
|
||||
Future<void> _import() async {
|
||||
const group = XTypeGroup(
|
||||
label: 'Markdown',
|
||||
extensions: ['md', 'markdown', 'txt'],
|
||||
// UTIs/MIME so the picker accepts the file on iOS/Android too.
|
||||
uniformTypeIdentifiers: ['net.daringfireball.markdown', 'public.text'],
|
||||
mimeTypes: ['text/markdown', 'text/plain'],
|
||||
);
|
||||
final file = await openFile(acceptedTypeGroups: const [group]);
|
||||
if (file == null) return; // user cancelled
|
||||
final content = await file.readAsString();
|
||||
final notes = NotesMarkdown.parse(content);
|
||||
await widget.repository.importNotes(notes);
|
||||
}
|
||||
|
||||
/// Retries the sync after a passphrase is entered; the lock tile follows
|
||||
/// [e2eLocked], which the run updates.
|
||||
Future<void> _syncNow() async {
|
||||
try {
|
||||
await runSync(
|
||||
widget.repository,
|
||||
widget.initial,
|
||||
httpClient: widget.httpClient,
|
||||
firebaseFactory: widget.firebaseFactory,
|
||||
stateStore: widget.stateStore,
|
||||
);
|
||||
} on Exception {
|
||||
// The capture screen's status line reports sync failures.
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _openSyncSettings() async {
|
||||
await Navigator.of(context).push<void>(
|
||||
appRoute(
|
||||
context,
|
||||
(_) => SyncSettingsScreen(
|
||||
accountLoader: widget.accountLoader ?? loadAccount,
|
||||
accountSaver: widget.accountSaver ?? saveAccount,
|
||||
accountClearer: widget.accountClearer ?? clearAccount,
|
||||
sessionProbe: widget.sessionProbe ?? isFirebaseConfigured,
|
||||
firebaseFactory: widget.firebaseFactory ?? openFirebase,
|
||||
googleFirebaseFactory:
|
||||
widget.googleFirebaseFactory ?? openFirebaseWithGoogle,
|
||||
googleAvailable: widget.googleAvailable ?? googleSignInSupported,
|
||||
backup: BackupSlot(label: 'notes', export: _export, import: _import),
|
||||
),
|
||||
name: '/settings/sync',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _openGitHubMirror() async {
|
||||
await Navigator.of(context).push<SyncSettings>(
|
||||
appRoute(
|
||||
context,
|
||||
(_) => GitHubMirrorScreen(
|
||||
initial: widget.initial,
|
||||
repository: widget.repository,
|
||||
appSettings: widget.appSettings,
|
||||
analytics: widget.analytics,
|
||||
httpClient: widget.httpClient,
|
||||
firebaseFactory: widget.firebaseFactory,
|
||||
stateStore: widget.stateStore,
|
||||
),
|
||||
name: '/settings/github',
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
76
pubspec.lock
76
pubspec.lock
@ -167,11 +167,11 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
path: data_transfer_flutter
|
||||
ref: "data_transfer_flutter-v0.2.3"
|
||||
resolved-ref: bb2f92f459283a29ad4864cf37704cc5f749cc6d
|
||||
ref: "data_transfer_flutter-v0.2.4"
|
||||
resolved-ref: "5c2effe7d1148830c9e273e47a272791dc17509e"
|
||||
url: "https://github.com/kuhyx/utils"
|
||||
source: git
|
||||
version: "0.2.3"
|
||||
version: "0.2.4"
|
||||
dbus:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -184,11 +184,11 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: design_system
|
||||
ref: "design_system-v0.4.1"
|
||||
resolved-ref: "422a5e53d975b7a1cbeadeb4e29ab0965bfc4bec"
|
||||
ref: "design_system-v0.5.1"
|
||||
resolved-ref: "7252ba0a7637f08dba09a79426817e423643c62f"
|
||||
url: "https://github.com/kuhyx/utils"
|
||||
source: git
|
||||
version: "0.4.1"
|
||||
version: "0.5.1"
|
||||
dev_build:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -233,10 +233,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: file_picker
|
||||
sha256: c3780977700b8962c3b9b6a9aa4e2c988956893d70d4a4fa2d7adf4ec9b9eaee
|
||||
sha256: "5b99250437a4d34ee2cdc0686924452103540eaa1c248094b63f07f9d7216f6c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "13.4.0"
|
||||
version: "13.4.1"
|
||||
file_picker_darwin:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -249,10 +249,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: file_picker_linux
|
||||
sha256: "9215ee8c672508cdd9a325202669f849e1baac883658626b3abed5d7777e6a4b"
|
||||
sha256: cf3889644e8e54551f5c3a4f98b6b6ef5f0ef85c07d2a0c1a969538983be2f9b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.4"
|
||||
version: "2.0.5"
|
||||
file_picker_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -415,6 +415,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.2.2"
|
||||
flutter_svg:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_svg
|
||||
sha256: "4565a66f0a968f2e1ab4197854686990258aadab9572eb80a7655053a01dc302"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.5.0"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@ -591,11 +599,11 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "kuhy_credit/flutter"
|
||||
ref: "kuhy-credit-v0.3.0"
|
||||
resolved-ref: c3946412729991bf1e9c3b6a5cc55dbe80419fc0
|
||||
ref: "kuhy-credit-v0.3.2"
|
||||
resolved-ref: adeb40f68e1d6c701da43e396fc46bffa3ef10c7
|
||||
url: "https://github.com/kuhyx/utils"
|
||||
source: git
|
||||
version: "0.3.0"
|
||||
version: "0.3.2"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -796,6 +804,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.9.1"
|
||||
path_parsing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_parsing
|
||||
sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
path_provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -1085,11 +1101,11 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: sync_settings_ui
|
||||
ref: "sync_settings_ui-v0.8.4"
|
||||
resolved-ref: "15ef5b44f186cea0ab163cc88cb8743c51d58247"
|
||||
ref: "sync_settings_ui-v0.8.5"
|
||||
resolved-ref: abfb596d7ce2f28acfefbd55e7b3227257325261
|
||||
url: "https://github.com/kuhyx/utils"
|
||||
source: git
|
||||
version: "0.8.4"
|
||||
version: "0.8.5"
|
||||
synchronized:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1194,6 +1210,30 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.6.0"
|
||||
vector_graphics:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_graphics
|
||||
sha256: "06081e4f2d8f17c306aa58989520694b463ad411bc7c7b93e76afa3e41ca17ac"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
vector_graphics_codec:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_graphics_codec
|
||||
sha256: "023f3afd1b08d040406e7ccc324f5173c04762a59e374f29d04cef00a4940742"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
vector_graphics_compiler:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_graphics_compiler
|
||||
sha256: "4c9d2e7121eea8b4f160e6e435900a0ae7214cfc97c2d6cf84c25532b789b50d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.4"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1254,10 +1294,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: xml
|
||||
sha256: "0fe8cc98946def31cbcbc8734aa4067031e6f65ea3a78a508060bfed2200bfeb"
|
||||
sha256: "67f0aff7be013d107995e9b75bf4e7f2c3ef2dfdb2c8e68024bba0a7fd5756a4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.1.0"
|
||||
version: "7.0.1"
|
||||
yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
10
pubspec.yaml
10
pubspec.yaml
@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
version: 1.0.105+1
|
||||
version: 1.0.106+1
|
||||
|
||||
environment:
|
||||
sdk: ^3.12.2
|
||||
@ -50,9 +50,9 @@ dependencies:
|
||||
design_system:
|
||||
git:
|
||||
url: https://github.com/kuhyx/utils
|
||||
ref: design_system-v0.4.1
|
||||
ref: design_system-v0.5.1
|
||||
path: design_system
|
||||
file_picker: 13.4.0
|
||||
file_picker: 13.4.1
|
||||
file_selector: 1.1.0
|
||||
flutter:
|
||||
sdk: flutter
|
||||
@ -84,7 +84,7 @@ dependencies:
|
||||
kuhy_credit:
|
||||
git:
|
||||
url: https://github.com/kuhyx/utils
|
||||
ref: kuhy-credit-v0.3.0
|
||||
ref: kuhy-credit-v0.3.2
|
||||
path: kuhy_credit/flutter
|
||||
# Flutter 3.50 deprecates package:flutter/material.dart; the shared UI
|
||||
# packages (design_system, sync_settings_ui) sit on material_ui, so the app
|
||||
@ -111,7 +111,7 @@ dependencies:
|
||||
sync_settings_ui:
|
||||
git:
|
||||
url: https://github.com/kuhyx/utils
|
||||
ref: sync_settings_ui-v0.8.4
|
||||
ref: sync_settings_ui-v0.8.5
|
||||
path: sync_settings_ui
|
||||
url_launcher: 6.3.3
|
||||
uuid: 4.6.0
|
||||
|
||||
@ -16,15 +16,20 @@ final RegExp _word = RegExp('[A-Za-z]{2,}');
|
||||
Finder spoken(String part) =>
|
||||
find.bySemanticsLabel(RegExp(RegExp.escape(part)));
|
||||
|
||||
/// Every string the tree paints: each [RichText] (which is what [Text] builds)
|
||||
/// and every non-empty [Tooltip] message, since a tooltip is shown on
|
||||
/// long-press. Text being typed lives in an [EditableText] and is the user's,
|
||||
/// so it is never painted through a [RichText] and is not collected.
|
||||
/// textgate one-word tooltip: no whitespace, <= 20 chars, no . ! ? , ; :
|
||||
bool isOneWordTooltip(String s) =>
|
||||
s.length <= 20 && !RegExp(r'[\s.!?,;:]').hasMatch(s);
|
||||
|
||||
/// Every string the tree paints: each [RichText] (which is what [Text] builds),
|
||||
/// and every non-empty [Tooltip] message that is not an allowed one-word
|
||||
/// tooltip. Text being typed lives in an [EditableText] and is the user's, so
|
||||
/// it is never painted through a [RichText] and is not collected.
|
||||
List<String> paintedStrings(WidgetTester tester) => [
|
||||
for (final w in tester.widgetList<RichText>(find.byType(RichText)))
|
||||
w.text.toPlainText(),
|
||||
for (final t in tester.widgetList<Tooltip>(find.byType(Tooltip)))
|
||||
if ((t.message ?? '').isNotEmpty) t.message!,
|
||||
if ((t.message ?? '').isNotEmpty && !isOneWordTooltip(t.message!))
|
||||
t.message!,
|
||||
];
|
||||
|
||||
/// Fails if any painted string still holds a word once every [content]
|
||||
|
||||
21
test/tooltips_test.dart
Normal file
21
test/tooltips_test.dart
Normal file
@ -0,0 +1,21 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:todo/ui/capture_screen.dart';
|
||||
import 'package:todo/ui/text_free_localizations.dart';
|
||||
|
||||
import 'capture_screen_harness.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('app bar icon buttons show one-word tooltips on long-press', (
|
||||
tester,
|
||||
) async {
|
||||
await pumpCapture(tester, prefs: configuredPrefs);
|
||||
await tester.pump();
|
||||
|
||||
expect(find.byTooltip('settings'), findsOneWidget);
|
||||
expect(find.byTooltip('notes'), findsOneWidget);
|
||||
|
||||
await tester.longPress(find.byTooltip('settings'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('settings'), findsOneWidget);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user