mirror of
https://github.com/kuhyx/todo-app.git
synced 2026-11-27 20:09:20 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 706c2465f9 | |||
| 711b69233a | |||
| 7153630a2e |
136
lib/mcp/filing_skill.dart
Normal file
136
lib/mcp/filing_skill.dart
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:crdt_sync/crdt_sync.dart';
|
||||||
|
import 'package:mcp_dart/mcp_dart.dart';
|
||||||
|
|
||||||
|
/// The MCP Skills extension (revision 2026-07-28). mcp_dart 2.4.4 has no
|
||||||
|
/// typed API for it, so this file wires its two methods by hand: a
|
||||||
|
/// capability under `extensions`, `skills/list` + `skills/get`, and the
|
||||||
|
/// SKILL.md served as a plain resource the client reads and hash-checks.
|
||||||
|
const kSkillsExtensionId = 'io.modelcontextprotocol/skills';
|
||||||
|
|
||||||
|
/// The skill's name; Claude Code lists it as `todo:filing-tasks`.
|
||||||
|
const kFilingSkillName = 'filing-tasks';
|
||||||
|
|
||||||
|
/// SKILL.md's address. The last directory segment must equal the name.
|
||||||
|
const kFilingSkillUri = 'skill://todo/$kFilingSkillName/SKILL.md';
|
||||||
|
|
||||||
|
const _description =
|
||||||
|
"File, track and close a task in kuhy's todo app: the add_task fields, "
|
||||||
|
'the "MANUAL WORK REQUIRED: " title, the "Todo: <id8>" commit trailer '
|
||||||
|
'and closing with evidence. Use when asked to file, add or note a '
|
||||||
|
'task, when you find work you will not finish now, and before you '
|
||||||
|
"call a task's work done.";
|
||||||
|
|
||||||
|
// Kept in step with the copies in ~/.claude/CLAUDE.md and the
|
||||||
|
// md-file-conventions skill: `claude -p` board workers never load MCP
|
||||||
|
// skills, so those copies stay the source for them.
|
||||||
|
const _body = '''
|
||||||
|
# Filing tasks in the todo app
|
||||||
|
|
||||||
|
Tasks for kuhy's repos live in the todo app, never in TODO*.md files.
|
||||||
|
|
||||||
|
## add_task fields
|
||||||
|
|
||||||
|
- `repo`: `kuhyx/<origin repo name>`, e.g. `kuhyx/todo-app`.
|
||||||
|
- `title`: one line naming the work.
|
||||||
|
- `body`: markdown with what / where / done / verify.
|
||||||
|
- `done_check`: a shell command run from the repo root, offline, under
|
||||||
|
60 s, that exits 0 once the work is done. Its exit code settles it.
|
||||||
|
- `priority`: low | medium | high (default medium).
|
||||||
|
- `new_note: true` only when the task needs its own note; by default it
|
||||||
|
joins the repo's single open note as a `## title` section.
|
||||||
|
|
||||||
|
## Work only kuhy can do
|
||||||
|
|
||||||
|
A task that needs kuhy's manual work has a title that starts with
|
||||||
|
`MANUAL WORK REQUIRED: <what>`, in exactly those capitals.
|
||||||
|
|
||||||
|
## Closing a task
|
||||||
|
|
||||||
|
- Name the task in the commit that lands its work with a trailer line
|
||||||
|
`Todo: <id8>` (its 8-character id prefix). The post-commit hook runs
|
||||||
|
the task's done_check and closes it only on exit 0.
|
||||||
|
- A task still open after that commit, or one with `Check: manual`:
|
||||||
|
run its done_check yourself and only if it exits 0 call `close_task`
|
||||||
|
with evidence `"<commit sha> done_check exit 0"`.
|
||||||
|
- Never leave finished work's task open, and never close without
|
||||||
|
running its done_check.
|
||||||
|
''';
|
||||||
|
|
||||||
|
/// SKILL.md: frontmatter (JSON-quoted, which is valid YAML) then [_body].
|
||||||
|
final String filingSkillMd = [
|
||||||
|
'---',
|
||||||
|
'name: ${jsonEncode(kFilingSkillName)}',
|
||||||
|
'description: ${jsonEncode(_description)}',
|
||||||
|
'---',
|
||||||
|
_body,
|
||||||
|
].join('\n');
|
||||||
|
|
||||||
|
/// The skill's `skills/list` entry; its one file carries size and digest.
|
||||||
|
Map<String, dynamic> filingSkillEntry() {
|
||||||
|
final bytes = utf8.encode(filingSkillMd);
|
||||||
|
return {
|
||||||
|
'uri': kFilingSkillUri,
|
||||||
|
'frontmatter': {'name': kFilingSkillName, 'description': _description},
|
||||||
|
'resources': [
|
||||||
|
{
|
||||||
|
'uri': kFilingSkillUri,
|
||||||
|
'size': bytes.length,
|
||||||
|
'digest': 'sha256:${revisionOf(filingSkillMd)}',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Publishes the filing skill on [server]; call before it connects.
|
||||||
|
void registerFilingSkill(McpServer server) {
|
||||||
|
final low = server.server
|
||||||
|
..registerCapabilities(
|
||||||
|
const ServerCapabilities(extensions: {kSkillsExtensionId: {}}),
|
||||||
|
);
|
||||||
|
server.registerResource(
|
||||||
|
kFilingSkillName,
|
||||||
|
kFilingSkillUri,
|
||||||
|
(description: _description, mimeType: 'text/markdown'),
|
||||||
|
(uri, _) => ReadResourceResult(
|
||||||
|
contents: [
|
||||||
|
TextResourceContents(
|
||||||
|
uri: kFilingSkillUri,
|
||||||
|
mimeType: 'text/markdown',
|
||||||
|
text: filingSkillMd,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
void method(String name, Map<String, dynamic> Function(Object?) answer) =>
|
||||||
|
low.setRequestHandler<JsonRpcRequest>(
|
||||||
|
name,
|
||||||
|
(request, _) async => _Json(answer(request.params?['uri'])),
|
||||||
|
(id, params, meta) =>
|
||||||
|
JsonRpcRequest(id: id, method: name, params: params, meta: meta),
|
||||||
|
);
|
||||||
|
method(
|
||||||
|
'skills/list',
|
||||||
|
(_) => {
|
||||||
|
'skills': [filingSkillEntry()],
|
||||||
|
},
|
||||||
|
);
|
||||||
|
method('skills/get', (uri) {
|
||||||
|
if (uri == kFilingSkillUri) return {'skill': filingSkillEntry()};
|
||||||
|
throw McpError(ErrorCode.resourceNotFound.value, 'no skill at $uri');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A result whose JSON is already built.
|
||||||
|
class _Json implements BaseResultData {
|
||||||
|
const _Json(this.json);
|
||||||
|
|
||||||
|
final Map<String, dynamic> json;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<String, dynamic>? get meta => null;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<String, dynamic> toJson() => json;
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:mcp_dart/mcp_dart.dart';
|
import 'package:mcp_dart/mcp_dart.dart';
|
||||||
|
import 'package:todo/mcp/filing_skill.dart';
|
||||||
import 'package:todo/mcp/request_guard.dart';
|
import 'package:todo/mcp/request_guard.dart';
|
||||||
import 'package:todo/mcp/task_service.dart';
|
import 'package:todo/mcp/task_service.dart';
|
||||||
import 'package:todo/mcp/token_file.dart';
|
import 'package:todo/mcp/token_file.dart';
|
||||||
@ -204,6 +205,7 @@ McpServer _server(TaskService tasks) {
|
|||||||
['query'],
|
['query'],
|
||||||
tasks.search,
|
tasks.search,
|
||||||
);
|
);
|
||||||
|
registerFilingSkill(server);
|
||||||
return server;
|
return server;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -108,6 +108,7 @@ class AttachButton extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return IconButton(
|
return IconButton(
|
||||||
|
tooltip: 'attach',
|
||||||
icon: const Icon(Icons.attach_file, semanticLabel: 'Attach'),
|
icon: const Icon(Icons.attach_file, semanticLabel: 'Attach'),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final files = await (picking ?? pickAttachments)(context);
|
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.
|
// Not gated on advanced mode: attaching is basic capture.
|
||||||
AttachButton(onFiles: onAttachFiles, picking: attachmentPicking),
|
AttachButton(onFiles: onAttachFiles, picking: attachmentPicking),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
tooltip: 'new',
|
||||||
onPressed: onNewNote,
|
onPressed: onNewNote,
|
||||||
icon: const Icon(Icons.check, semanticLabel: 'New note'),
|
icon: const Icon(Icons.check, semanticLabel: 'New note'),
|
||||||
),
|
),
|
||||||
if (advanced)
|
if (advanced)
|
||||||
IconButton(
|
IconButton(
|
||||||
|
tooltip: 'sync',
|
||||||
onPressed: syncing ? null : onSync,
|
onPressed: syncing ? null : onSync,
|
||||||
icon: syncing
|
icon: syncing
|
||||||
? const WaitWatch(
|
? const WaitWatch(
|
||||||
@ -105,6 +107,7 @@ class CaptureAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
: const Icon(Icons.sync, semanticLabel: 'Sync'),
|
: const Icon(Icons.sync, semanticLabel: 'Sync'),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
tooltip: 'notes',
|
||||||
onPressed: onOpenList,
|
onPressed: onOpenList,
|
||||||
icon: const Icon(Icons.list, semanticLabel: 'Notes'),
|
icon: const Icon(Icons.list, semanticLabel: 'Notes'),
|
||||||
),
|
),
|
||||||
@ -123,6 +126,7 @@ class CaptureAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
),
|
),
|
||||||
CaptureConfirmMark(captured: captured),
|
CaptureConfirmMark(captured: captured),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
tooltip: 'settings',
|
||||||
onPressed: onOpenSettings,
|
onPressed: onOpenSettings,
|
||||||
icon: const Icon(Icons.settings, semanticLabel: 'Settings'),
|
icon: const Icon(Icons.settings, semanticLabel: 'Settings'),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -189,6 +189,7 @@ class _CloudImagesScreenState extends State<CloudImagesScreen> {
|
|||||||
),
|
),
|
||||||
if (!status.configured)
|
if (!status.configured)
|
||||||
IconButton(
|
IconButton(
|
||||||
|
tooltip: 'copy',
|
||||||
onPressed: () => unawaited(
|
onPressed: () => unawaited(
|
||||||
Clipboard.setData(
|
Clipboard.setData(
|
||||||
const ClipboardData(text: kAddLoginCommand),
|
const ClipboardData(text: kAddLoginCommand),
|
||||||
|
|||||||
@ -42,12 +42,14 @@ class _ConfirmDeleteDialog extends StatelessWidget {
|
|||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
key: const ValueKey('confirm-cancel'),
|
key: const ValueKey('confirm-cancel'),
|
||||||
|
tooltip: 'cancel',
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
onPressed: () => Navigator.of(context).pop(false),
|
onPressed: () => Navigator.of(context).pop(false),
|
||||||
icon: const Icon(Icons.close, semanticLabel: 'Cancel'),
|
icon: const Icon(Icons.close, semanticLabel: 'Cancel'),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
key: const ValueKey('confirm-delete'),
|
key: const ValueKey('confirm-delete'),
|
||||||
|
tooltip: 'delete',
|
||||||
onPressed: () => Navigator.of(context).pop(true),
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
icon: Icon(Icons.delete, color: error, semanticLabel: 'Delete'),
|
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';
|
part 'github_mirror_screen_widget.dart';
|
||||||
|
|
||||||
class _GitHubMirrorScreenState extends State<GitHubMirrorScreen> {
|
class _GitHubMirrorScreenState extends State<GitHubMirrorScreen> {
|
||||||
late final TextEditingController _owner = TextEditingController(
|
late final _owner = TextEditingController(text: widget.initial.owner);
|
||||||
text: widget.initial.owner,
|
late final _repo = TextEditingController(text: widget.initial.repo);
|
||||||
);
|
late final _token = TextEditingController(text: widget.initial.token);
|
||||||
late final TextEditingController _repo = TextEditingController(
|
late final _clientId = TextEditingController(text: widget.initial.clientId);
|
||||||
text: widget.initial.repo,
|
|
||||||
);
|
|
||||||
late final TextEditingController _token = TextEditingController(
|
|
||||||
text: widget.initial.token,
|
|
||||||
);
|
|
||||||
late final TextEditingController _clientId = TextEditingController(
|
|
||||||
text: widget.initial.clientId,
|
|
||||||
);
|
|
||||||
|
|
||||||
bool _testing = false;
|
bool _testing = false;
|
||||||
StatusCue? _status;
|
StatusCue? _status;
|
||||||
@ -177,6 +169,7 @@ class _GitHubMirrorScreenState extends State<GitHubMirrorScreen> {
|
|||||||
Align(
|
Align(
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: IconButton.filled(
|
child: IconButton.filled(
|
||||||
|
tooltip: 'connect',
|
||||||
onPressed: _connectGitHub,
|
onPressed: _connectGitHub,
|
||||||
icon: const Icon(Icons.login, semanticLabel: 'Connect GitHub'),
|
icon: const Icon(Icons.login, semanticLabel: 'Connect GitHub'),
|
||||||
),
|
),
|
||||||
@ -221,6 +214,7 @@ class _GitHubMirrorScreenState extends State<GitHubMirrorScreen> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
IconButton.outlined(
|
IconButton.outlined(
|
||||||
|
tooltip: 'test',
|
||||||
onPressed: _testing ? null : _test,
|
onPressed: _testing ? null : _test,
|
||||||
icon: _testing
|
icon: _testing
|
||||||
? const WaitWatch(
|
? const WaitWatch(
|
||||||
@ -238,6 +232,7 @@ class _GitHubMirrorScreenState extends State<GitHubMirrorScreen> {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
IconButton.filled(
|
IconButton.filled(
|
||||||
|
tooltip: 'save',
|
||||||
onPressed: _save,
|
onPressed: _save,
|
||||||
icon: const Icon(Icons.save, semanticLabel: 'Save'),
|
icon: const Icon(Icons.save, semanticLabel: 'Save'),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -99,6 +99,7 @@ class _NoteActionsSheetState extends State<NoteActionsSheet> {
|
|||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Align(
|
Align(
|
||||||
child: IconButton.outlined(
|
child: IconButton.outlined(
|
||||||
|
tooltip: 'delete',
|
||||||
color: Theme.of(context).colorScheme.error,
|
color: Theme.of(context).colorScheme.error,
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.delete_outline,
|
Icons.delete_outline,
|
||||||
|
|||||||
@ -16,6 +16,8 @@ const IconData kCreatedIcon = Icons.post_add;
|
|||||||
const IconData kUpdatedIcon = Icons.update;
|
const IconData kUpdatedIcon = Icons.update;
|
||||||
|
|
||||||
/// A labelled date range shown as one preset menu plus a custom picker.
|
/// 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 {
|
class DateRangeField extends StatelessWidget {
|
||||||
/// Creates a labelled date-range control.
|
/// Creates a labelled date-range control.
|
||||||
const DateRangeField({
|
const DateRangeField({
|
||||||
@ -96,12 +98,29 @@ class DateRangeField extends StatelessWidget {
|
|||||||
// A popup menu rather than DropdownButton: re-picking "Custom…" while a
|
// A popup menu rather than DropdownButton: re-picking "Custom…" while a
|
||||||
// custom range is shown must still reopen the picker.
|
// custom range is shown must still reopen the picker.
|
||||||
return PopupMenuButton<_Preset>(
|
return PopupMenuButton<_Preset>(
|
||||||
// Empty, not the label: a tooltip is painted on long-press.
|
tooltip: 'range',
|
||||||
tooltip: '',
|
|
||||||
onSelected: (p) => _select(context, p),
|
onSelected: (p) => _select(context, p),
|
||||||
itemBuilder: (_) => [
|
itemBuilder: (_) => [
|
||||||
for (final p in _Preset.values)
|
PopupMenuItem(
|
||||||
PopupMenuItem(value: p, child: p.glyph()),
|
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(
|
child: InputDecorator(
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
|||||||
@ -103,6 +103,7 @@ class _NoteDetailScreenState extends State<NoteDetailScreen> {
|
|||||||
picking: widget.attachmentPicking,
|
picking: widget.attachmentPicking,
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
tooltip: 'copy',
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
_copied ? Icons.check : Icons.copy_all,
|
_copied ? Icons.check : Icons.copy_all,
|
||||||
semanticLabel: 'Copy',
|
semanticLabel: 'Copy',
|
||||||
@ -110,6 +111,7 @@ class _NoteDetailScreenState extends State<NoteDetailScreen> {
|
|||||||
onPressed: _copy,
|
onPressed: _copy,
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
tooltip: 'delete',
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.delete_outline,
|
Icons.delete_outline,
|
||||||
semanticLabel: 'Delete note',
|
semanticLabel: 'Delete note',
|
||||||
|
|||||||
@ -67,6 +67,7 @@ class NoteEditorStepPage extends StatelessWidget {
|
|||||||
Align(
|
Align(
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
|
tooltip: 'exit',
|
||||||
icon: const Icon(Icons.arrow_back, semanticLabel: 'Exit guided'),
|
icon: const Icon(Icons.arrow_back, semanticLabel: 'Exit guided'),
|
||||||
onPressed: onExit,
|
onPressed: onExit,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -58,6 +58,7 @@ class _NoteEditorWizardState extends State<NoteEditorWizard> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
|
tooltip: 'cancel',
|
||||||
icon: const Icon(Icons.close, semanticLabel: 'Cancel'),
|
icon: const Icon(Icons.close, semanticLabel: 'Cancel'),
|
||||||
onPressed: widget.onCancel,
|
onPressed: widget.onCancel,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -51,6 +51,7 @@ class NoteTile extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
subtitle: _meta(context),
|
subtitle: _meta(context),
|
||||||
trailing: IconButton(
|
trailing: IconButton(
|
||||||
|
tooltip: 'actions',
|
||||||
icon: const Icon(Icons.more_vert, semanticLabel: 'Quick actions'),
|
icon: const Icon(Icons.more_vert, semanticLabel: 'Quick actions'),
|
||||||
onPressed: onActions,
|
onPressed: onActions,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -140,6 +140,7 @@ class _NotesListScreenState extends State<NotesListScreen> {
|
|||||||
_selectButton(),
|
_selectButton(),
|
||||||
// Eye, no label: open = Claude-made notes shown, slashed = hidden.
|
// Eye, no label: open = Claude-made notes shown, slashed = hidden.
|
||||||
IconButton(
|
IconButton(
|
||||||
|
tooltip: 'claude',
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
widget.appSettings.value.showClaudeNotes
|
widget.appSettings.value.showClaudeNotes
|
||||||
? Icons.visibility
|
? Icons.visibility
|
||||||
@ -148,31 +149,7 @@ class _NotesListScreenState extends State<NotesListScreen> {
|
|||||||
),
|
),
|
||||||
onPressed: _toggleClaudeNotes,
|
onPressed: _toggleClaudeNotes,
|
||||||
),
|
),
|
||||||
PopupMenuButton<NoteSort>(
|
_sortButton(),
|
||||||
// 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'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
// Filter icon with a badge counting user-applied facets. The
|
// Filter icon with a badge counting user-applied facets. The
|
||||||
// trailing padding + inward offset keep the badge from being
|
// trailing padding + inward offset keep the badge from being
|
||||||
// clipped at the screen edge.
|
// clipped at the screen edge.
|
||||||
@ -183,6 +160,7 @@ class _NotesListScreenState extends State<NotesListScreen> {
|
|||||||
label: Text('$badgeCount'),
|
label: Text('$badgeCount'),
|
||||||
offset: const Offset(-8, 4),
|
offset: const Offset(-8, 4),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
|
tooltip: 'filter',
|
||||||
icon: const Icon(Icons.filter_list, semanticLabel: 'Filter'),
|
icon: const Icon(Icons.filter_list, semanticLabel: 'Filter'),
|
||||||
onPressed: _openFilters,
|
onPressed: _openFilters,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -9,6 +9,7 @@ extension _Selecting on _NotesListScreenState {
|
|||||||
/// App-bar toggle into and out of selection mode (tinted while on).
|
/// App-bar toggle into and out of selection mode (tinted while on).
|
||||||
Widget _selectButton() => IconButton(
|
Widget _selectButton() => IconButton(
|
||||||
key: const ValueKey('select-mode'),
|
key: const ValueKey('select-mode'),
|
||||||
|
tooltip: 'select',
|
||||||
isSelected: _selection.active,
|
isSelected: _selection.active,
|
||||||
onPressed: _selection.toggleMode,
|
onPressed: _selection.toggleMode,
|
||||||
icon: const Icon(Icons.checklist, semanticLabel: 'Select'),
|
icon: const Icon(Icons.checklist, semanticLabel: 'Select'),
|
||||||
@ -40,4 +41,43 @@ extension _Selecting on _NotesListScreenState {
|
|||||||
onClear: _selection.clear,
|
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.
|
/// Set status, set priority, assign to repo, clear: icons only.
|
||||||
///
|
///
|
||||||
/// Menus pass `tooltip: ''` because a tooltip is visible text; the icons
|
/// One-word tooltips on hover/long-press per textgate rule.
|
||||||
/// carry semantic labels instead.
|
|
||||||
class NotesSelectionBar extends StatefulWidget {
|
class NotesSelectionBar extends StatefulWidget {
|
||||||
/// Creates the bar; every callback acts on the whole selection.
|
/// Creates the bar; every callback acts on the whole selection.
|
||||||
const NotesSelectionBar({
|
const NotesSelectionBar({
|
||||||
@ -70,7 +69,7 @@ class _NotesSelectionBarState extends State<NotesSelectionBar> {
|
|||||||
children: [
|
children: [
|
||||||
PopupMenuButton<Status>(
|
PopupMenuButton<Status>(
|
||||||
key: const ValueKey('bulk-status'),
|
key: const ValueKey('bulk-status'),
|
||||||
tooltip: '',
|
tooltip: 'status',
|
||||||
icon: const Icon(Icons.task_alt, semanticLabel: 'Set status'),
|
icon: const Icon(Icons.task_alt, semanticLabel: 'Set status'),
|
||||||
onSelected: widget.onStatus,
|
onSelected: widget.onStatus,
|
||||||
itemBuilder: (_) => [
|
itemBuilder: (_) => [
|
||||||
@ -84,7 +83,7 @@ class _NotesSelectionBarState extends State<NotesSelectionBar> {
|
|||||||
),
|
),
|
||||||
PopupMenuButton<Priority>(
|
PopupMenuButton<Priority>(
|
||||||
key: const ValueKey('bulk-priority'),
|
key: const ValueKey('bulk-priority'),
|
||||||
tooltip: '',
|
tooltip: 'priority',
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.flag_outlined,
|
Icons.flag_outlined,
|
||||||
semanticLabel: 'Set priority',
|
semanticLabel: 'Set priority',
|
||||||
@ -105,6 +104,7 @@ class _NotesSelectionBarState extends State<NotesSelectionBar> {
|
|||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
key: const ValueKey('bulk-assign'),
|
key: const ValueKey('bulk-assign'),
|
||||||
|
tooltip: 'assign',
|
||||||
onPressed: _assign,
|
onPressed: _assign,
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
refused ? Icons.block : Icons.drive_file_move_outline,
|
refused ? Icons.block : Icons.drive_file_move_outline,
|
||||||
|
|||||||
@ -83,6 +83,7 @@ class _RepoPickerSheetState extends State<RepoPickerSheet> {
|
|||||||
: null,
|
: null,
|
||||||
suffixIcon: IconButton(
|
suffixIcon: IconButton(
|
||||||
key: const ValueKey('repo-new-submit'),
|
key: const ValueKey('repo-new-submit'),
|
||||||
|
tooltip: 'use',
|
||||||
onPressed: _submit,
|
onPressed: _submit,
|
||||||
icon: const Icon(Icons.check, semanticLabel: 'Use repo'),
|
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/cloud_images_settings.dart';
|
||||||
import 'package:todo/ui/github_mirror_screen.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
|
/// Settings screen: the "Enable advanced" toggle plus links to the two sync
|
||||||
/// surfaces.
|
/// 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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
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',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -16,6 +16,30 @@ task (`id8 status priority repo title created_by`); `get_task` prints
|
|||||||
`created_by` is `claude` for notes filed through `add_task` or the CLI and
|
`created_by` is `claude` for notes filed through `add_task` or the CLI and
|
||||||
`kuhy` for everything else (a missing value reads as `kuhy`).
|
`kuhy` for everything else (a missing value reads as `kuhy`).
|
||||||
|
|
||||||
|
The server also publishes one skill through the MCP Skills extension
|
||||||
|
(`io.modelcontextprotocol/skills`, revision 2026-07-28): `filing-tasks`,
|
||||||
|
which Claude Code lists as `todo:filing-tasks`. It holds the `add_task` field
|
||||||
|
rules, the `MANUAL WORK REQUIRED:` title rule, the `Todo: <id8>` commit trailer
|
||||||
|
and the close-the-task rule. mcp_dart 2.4.4 has no Skills API, so
|
||||||
|
`lib/mcp/filing_skill.dart` registers the capability, `skills/list`,
|
||||||
|
`skills/get` and the SKILL.md resource itself; the entry's sha256 and size are
|
||||||
|
computed from the served text. `claude -p` board workers never load MCP
|
||||||
|
skills, so `~/.claude/CLAUDE.md` and the `md-file-conventions` skill keep
|
||||||
|
their copies.
|
||||||
|
|
||||||
|
Claude Code does not list the skill yet. In 2.1.332 the connect path runs
|
||||||
|
`Xg() && capabilities.resources ? fetchMcpSkillsForClient(...) : []`, and
|
||||||
|
`Xg()` returns the remote flag `tengu_wiggly_crystal` (default false). That
|
||||||
|
flag was false for kuhy's account on 2026-11-27, so the client never sent
|
||||||
|
`skills/list` (no `[mcp-skills]` line in `--debug` output). Even with the flag
|
||||||
|
on, the client still refuses MCP skills for team/enterprise orgs that set
|
||||||
|
`disableDirectMcpSkills`, for HIPAA/ZDR orgs and for plans it does not allow.
|
||||||
|
The server side was probed live on :8735 the same day: `initialize`
|
||||||
|
advertises the extension and `skills/list` plus `resources/read` serve the
|
||||||
|
SKILL.md. To recheck after a Claude Code update, run
|
||||||
|
`jq '.cachedGrowthBookFeatures.tengu_wiggly_crystal' ~/.claude.json`; once it
|
||||||
|
prints `true`, `/skills` in a new session should list `todo:filing-tasks`.
|
||||||
|
|
||||||
| What | Where |
|
| What | Where |
|
||||||
|---|---|
|
|---|---|
|
||||||
| Firebase seed (read once) | `~/.config/todo-mcp/firebase_auth.json` |
|
| Firebase seed (read once) | `~/.config/todo-mcp/firebase_auth.json` |
|
||||||
|
|||||||
88
pubspec.lock
88
pubspec.lock
@ -109,20 +109,20 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: crdt_sync_dart
|
path: crdt_sync_dart
|
||||||
ref: "crdt_sync_dart-v0.14.1"
|
ref: "crdt_sync_dart-v0.14.2"
|
||||||
resolved-ref: edd0f7a7882cb1d3904932ba94faa282d08165df
|
resolved-ref: "171a7f8ae34cec78df17a680e42878ca0b97c137"
|
||||||
url: "https://github.com/kuhyx/utils"
|
url: "https://github.com/kuhyx/utils"
|
||||||
source: git
|
source: git
|
||||||
version: "0.14.1"
|
version: "0.14.2"
|
||||||
crdt_sync_flutter:
|
crdt_sync_flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: crdt_sync_flutter
|
path: crdt_sync_flutter
|
||||||
ref: "crdt_sync_flutter-v0.9.1"
|
ref: "crdt_sync_flutter-v0.9.2"
|
||||||
resolved-ref: "48dc28ad97b97c787aba4479c3ce51aade6e86b5"
|
resolved-ref: "41af57870207f80a5bf571f15544a08fddcbe7bf"
|
||||||
url: "https://github.com/kuhyx/utils"
|
url: "https://github.com/kuhyx/utils"
|
||||||
source: git
|
source: git
|
||||||
version: "0.9.1"
|
version: "0.9.2"
|
||||||
cross_file:
|
cross_file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -167,11 +167,11 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
path: data_transfer_flutter
|
path: data_transfer_flutter
|
||||||
ref: "data_transfer_flutter-v0.2.3"
|
ref: "data_transfer_flutter-v0.2.4"
|
||||||
resolved-ref: bb2f92f459283a29ad4864cf37704cc5f749cc6d
|
resolved-ref: "5c2effe7d1148830c9e273e47a272791dc17509e"
|
||||||
url: "https://github.com/kuhyx/utils"
|
url: "https://github.com/kuhyx/utils"
|
||||||
source: git
|
source: git
|
||||||
version: "0.2.3"
|
version: "0.2.4"
|
||||||
dbus:
|
dbus:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -184,11 +184,11 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: design_system
|
path: design_system
|
||||||
ref: "design_system-v0.4.1"
|
ref: "design_system-v0.5.1"
|
||||||
resolved-ref: "422a5e53d975b7a1cbeadeb4e29ab0965bfc4bec"
|
resolved-ref: "7252ba0a7637f08dba09a79426817e423643c62f"
|
||||||
url: "https://github.com/kuhyx/utils"
|
url: "https://github.com/kuhyx/utils"
|
||||||
source: git
|
source: git
|
||||||
version: "0.4.1"
|
version: "0.5.1"
|
||||||
dev_build:
|
dev_build:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -233,10 +233,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: file_picker
|
name: file_picker
|
||||||
sha256: c3780977700b8962c3b9b6a9aa4e2c988956893d70d4a4fa2d7adf4ec9b9eaee
|
sha256: "5b99250437a4d34ee2cdc0686924452103540eaa1c248094b63f07f9d7216f6c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "13.4.0"
|
version: "13.4.1"
|
||||||
file_picker_darwin:
|
file_picker_darwin:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -249,10 +249,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: file_picker_linux
|
name: file_picker_linux
|
||||||
sha256: "9215ee8c672508cdd9a325202669f849e1baac883658626b3abed5d7777e6a4b"
|
sha256: cf3889644e8e54551f5c3a4f98b6b6ef5f0ef85c07d2a0c1a969538983be2f9b
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.4"
|
version: "2.0.5"
|
||||||
file_picker_platform_interface:
|
file_picker_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -415,6 +415,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.2.2"
|
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:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
@ -591,11 +599,11 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "kuhy_credit/flutter"
|
path: "kuhy_credit/flutter"
|
||||||
ref: "kuhy-credit-v0.3.0"
|
ref: "kuhy-credit-v0.3.2"
|
||||||
resolved-ref: c3946412729991bf1e9c3b6a5cc55dbe80419fc0
|
resolved-ref: adeb40f68e1d6c701da43e396fc46bffa3ef10c7
|
||||||
url: "https://github.com/kuhyx/utils"
|
url: "https://github.com/kuhyx/utils"
|
||||||
source: git
|
source: git
|
||||||
version: "0.3.0"
|
version: "0.3.2"
|
||||||
leak_tracker:
|
leak_tracker:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -796,6 +804,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.1"
|
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:
|
path_provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -1085,11 +1101,11 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: sync_settings_ui
|
path: sync_settings_ui
|
||||||
ref: "sync_settings_ui-v0.8.4"
|
ref: "sync_settings_ui-v0.8.6"
|
||||||
resolved-ref: "15ef5b44f186cea0ab163cc88cb8743c51d58247"
|
resolved-ref: "41af57870207f80a5bf571f15544a08fddcbe7bf"
|
||||||
url: "https://github.com/kuhyx/utils"
|
url: "https://github.com/kuhyx/utils"
|
||||||
source: git
|
source: git
|
||||||
version: "0.8.4"
|
version: "0.8.6"
|
||||||
synchronized:
|
synchronized:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1194,6 +1210,30 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.6.0"
|
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:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1254,10 +1294,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: xml
|
name: xml
|
||||||
sha256: "0fe8cc98946def31cbcbc8734aa4067031e6f65ea3a78a508060bfed2200bfeb"
|
sha256: "67f0aff7be013d107995e9b75bf4e7f2c3ef2dfdb2c8e68024bba0a7fd5756a4"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.1.0"
|
version: "7.0.1"
|
||||||
yaml:
|
yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
14
pubspec.yaml
14
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
|
# 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
|
# 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.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.105+1
|
version: 1.0.108+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.12.2
|
sdk: ^3.12.2
|
||||||
@ -33,12 +33,12 @@ dependencies:
|
|||||||
crdt_sync:
|
crdt_sync:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/kuhyx/utils
|
url: https://github.com/kuhyx/utils
|
||||||
ref: crdt_sync_dart-v0.14.1
|
ref: crdt_sync_dart-v0.14.2
|
||||||
path: crdt_sync_dart
|
path: crdt_sync_dart
|
||||||
crdt_sync_flutter:
|
crdt_sync_flutter:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/kuhyx/utils
|
url: https://github.com/kuhyx/utils
|
||||||
ref: crdt_sync_flutter-v0.9.1
|
ref: crdt_sync_flutter-v0.9.2
|
||||||
path: crdt_sync_flutter
|
path: crdt_sync_flutter
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
@ -50,9 +50,9 @@ dependencies:
|
|||||||
design_system:
|
design_system:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/kuhyx/utils
|
url: https://github.com/kuhyx/utils
|
||||||
ref: design_system-v0.4.1
|
ref: design_system-v0.5.1
|
||||||
path: design_system
|
path: design_system
|
||||||
file_picker: 13.4.0
|
file_picker: 13.4.1
|
||||||
file_selector: 1.1.0
|
file_selector: 1.1.0
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
@ -84,7 +84,7 @@ dependencies:
|
|||||||
kuhy_credit:
|
kuhy_credit:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/kuhyx/utils
|
url: https://github.com/kuhyx/utils
|
||||||
ref: kuhy-credit-v0.3.0
|
ref: kuhy-credit-v0.3.2
|
||||||
path: kuhy_credit/flutter
|
path: kuhy_credit/flutter
|
||||||
# Flutter 3.50 deprecates package:flutter/material.dart; the shared UI
|
# Flutter 3.50 deprecates package:flutter/material.dart; the shared UI
|
||||||
# packages (design_system, sync_settings_ui) sit on material_ui, so the app
|
# packages (design_system, sync_settings_ui) sit on material_ui, so the app
|
||||||
@ -111,7 +111,7 @@ dependencies:
|
|||||||
sync_settings_ui:
|
sync_settings_ui:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/kuhyx/utils
|
url: https://github.com/kuhyx/utils
|
||||||
ref: sync_settings_ui-v0.8.4
|
ref: sync_settings_ui-v0.8.6
|
||||||
path: sync_settings_ui
|
path: sync_settings_ui
|
||||||
url_launcher: 6.3.3
|
url_launcher: 6.3.3
|
||||||
uuid: 4.6.0
|
uuid: 4.6.0
|
||||||
|
|||||||
108
test/mcp/mcp_skill_test.dart
Normal file
108
test/mcp/mcp_skill_test.dart
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
// The task-filing skill over the MCP Skills extension (2026-07-28): the
|
||||||
|
// entry, the file list and the SKILL.md read must pass the same checks
|
||||||
|
// Claude Code runs before it lists `todo:<name>` and loads it.
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:crdt_sync/crdt_sync.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:mcp_dart/mcp_dart.dart';
|
||||||
|
|
||||||
|
import 'mcp_harness.dart';
|
||||||
|
|
||||||
|
const _ext = 'io.modelcontextprotocol/skills';
|
||||||
|
final _name = RegExp(r'^(?=.{1,64}$)[a-z0-9]+(?:-[a-z0-9]+)*$');
|
||||||
|
|
||||||
|
class _Raw implements BaseResultData {
|
||||||
|
_Raw(this.json);
|
||||||
|
|
||||||
|
final Map<String, dynamic> json;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<String, dynamic>? get meta => null;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<String, dynamic> toJson() => json;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
late McpHarness h;
|
||||||
|
late McpClient c;
|
||||||
|
|
||||||
|
setUp(() async {
|
||||||
|
h = McpHarness();
|
||||||
|
await h.start();
|
||||||
|
c = await h.connect();
|
||||||
|
});
|
||||||
|
tearDown(() => h.dispose());
|
||||||
|
|
||||||
|
Future<Map<String, dynamic>> send(String method, Map<String, dynamic> p) => c
|
||||||
|
.request(JsonRpcRequest(id: 0, method: method, params: p), _Raw.new)
|
||||||
|
.then((r) => r.json);
|
||||||
|
|
||||||
|
test('declares the extension on 2026-07-28', () {
|
||||||
|
expect(c.getProtocolVersion(), '2026-07-28');
|
||||||
|
expect(c.getServerCapabilities()?.extensions?[_ext], isNotNull);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('lists one valid entry and serves its SKILL.md', () async {
|
||||||
|
final list = await send('skills/list', {});
|
||||||
|
final skills = list['skills'] as List<dynamic>;
|
||||||
|
expect(skills, hasLength(1));
|
||||||
|
final entry = skills.single as Map<String, dynamic>;
|
||||||
|
final uri = entry['uri'] as String;
|
||||||
|
expect(uri, endsWith('/SKILL.md'));
|
||||||
|
final root = uri.substring(0, uri.length - '/SKILL.md'.length);
|
||||||
|
final last = root.substring(root.lastIndexOf('/') + 1);
|
||||||
|
final front = entry['frontmatter'] as Map<String, dynamic>;
|
||||||
|
expect(front['name'], last);
|
||||||
|
expect(_name.hasMatch(last), isTrue, reason: last);
|
||||||
|
expect(front['description'], isA<String>());
|
||||||
|
expect(uri, isNot(contains(r'$')));
|
||||||
|
|
||||||
|
final files = (entry['resources'] as List<dynamic>)
|
||||||
|
.cast<Map<String, dynamic>>();
|
||||||
|
final md = files.singleWhere((f) => f['uri'] == uri);
|
||||||
|
|
||||||
|
final got = await send('skills/get', {'uri': uri});
|
||||||
|
expect(got['skill'], entry);
|
||||||
|
|
||||||
|
final read = await c.readResource(ReadResourceRequest(uri: uri));
|
||||||
|
expect(read.contents, hasLength(1));
|
||||||
|
final content = read.contents.single as TextResourceContents;
|
||||||
|
expect(content.uri, uri);
|
||||||
|
final bytes = utf8.encode(content.text);
|
||||||
|
expect(md['size'], bytes.length);
|
||||||
|
expect(md['digest'], 'sha256:${revisionOf(content.text)}');
|
||||||
|
|
||||||
|
// The frontmatter in the file parses to exactly the listed one.
|
||||||
|
final text = content.text;
|
||||||
|
expect(text, startsWith('---\n'));
|
||||||
|
final end = text.indexOf('\n---\n', 4);
|
||||||
|
final lines = text.substring(4, end).split('\n');
|
||||||
|
final parsed = {
|
||||||
|
for (final l in lines)
|
||||||
|
l.substring(0, l.indexOf(':')): jsonDecode(
|
||||||
|
l.substring(l.indexOf(':') + 1).trim(),
|
||||||
|
),
|
||||||
|
};
|
||||||
|
expect(parsed, front);
|
||||||
|
|
||||||
|
final body = text.substring(end + 5);
|
||||||
|
for (final rule in [
|
||||||
|
'add_task',
|
||||||
|
'done_check',
|
||||||
|
'MANUAL WORK REQUIRED: ',
|
||||||
|
'Todo: <id8>',
|
||||||
|
'close_task',
|
||||||
|
]) {
|
||||||
|
expect(body, contains(rule));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test('skills/get on an unknown uri is an error', () async {
|
||||||
|
await expectLater(
|
||||||
|
send('skills/get', {'uri': 'skill://todo/nope/SKILL.md'}),
|
||||||
|
throwsA(isA<McpError>()),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
@ -16,15 +16,20 @@ final RegExp _word = RegExp('[A-Za-z]{2,}');
|
|||||||
Finder spoken(String part) =>
|
Finder spoken(String part) =>
|
||||||
find.bySemanticsLabel(RegExp(RegExp.escape(part)));
|
find.bySemanticsLabel(RegExp(RegExp.escape(part)));
|
||||||
|
|
||||||
/// Every string the tree paints: each [RichText] (which is what [Text] builds)
|
/// textgate one-word tooltip: no whitespace, <= 20 chars, no . ! ? , ; :
|
||||||
/// and every non-empty [Tooltip] message, since a tooltip is shown on
|
bool isOneWordTooltip(String s) =>
|
||||||
/// long-press. Text being typed lives in an [EditableText] and is the user's,
|
s.length <= 20 && !RegExp(r'[\s.!?,;:]').hasMatch(s);
|
||||||
/// so it is never painted through a [RichText] and is not collected.
|
|
||||||
|
/// 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) => [
|
List<String> paintedStrings(WidgetTester tester) => [
|
||||||
for (final w in tester.widgetList<RichText>(find.byType(RichText)))
|
for (final w in tester.widgetList<RichText>(find.byType(RichText)))
|
||||||
w.text.toPlainText(),
|
w.text.toPlainText(),
|
||||||
for (final t in tester.widgetList<Tooltip>(find.byType(Tooltip)))
|
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]
|
/// 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