feat(app): clean up also offers every empty page, with select all/none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Opus 5.5 committed 2026-10-26 04:11:27 +01:00
1 parent ad62a7d258
commit 141e1a20d0
6 files changed
+59 -23

No files matched your search

+5 -4
View File
@@ -98,10 +98,11 @@ abstract class SynapseGraph implements RustOpaqueInterface {
/// journal); otherwise at the newest journal strictly before `before`.
Future<List<PageData>> journals({String? before, required int limit});
/// Pages that are probably leftovers of Logseq: its built-ins and pages with
/// `type:: system`. Only the organisational files (`contents`, `card`, `favorites`,
/// `hls__*`) and empty pages are preselected, and never a hub: a built-in title such as
/// `todo` may hold real content.
/// Pages worth cleaning up: leftovers of Logseq (its built-ins and pages with
/// `type:: system`) and empty pages (no text in any block, not a hub, no type, tags or
/// description). Of the Logseq ones only the organisational files (`contents`, `card`,
/// `favorites`, `hls__*`) and empty pages are preselected, and never a hub: a built-in
/// title such as `todo` may hold real content. Empty pages are all preselected.
Future<List<LegacyCandidate>> legacyCandidates();
/// Pages ordered by last update, most recent first.
+5 -4
View File
@@ -5290,10 +5290,11 @@ class SynapseGraphImpl extends RustOpaque implements SynapseGraph {
limit: limit,
);
/// Pages that are probably leftovers of Logseq: its built-ins and pages with
/// `type:: system`. Only the organisational files (`contents`, `card`, `favorites`,
/// `hls__*`) and empty pages are preselected, and never a hub: a built-in title such as
/// `todo` may hold real content.
/// Pages worth cleaning up: leftovers of Logseq (its built-ins and pages with
/// `type:: system`) and empty pages (no text in any block, not a hub, no type, tags or
/// description). Of the Logseq ones only the organisational files (`contents`, `card`,
/// `favorites`, `hls__*`) and empty pages are preselected, and never a hub: a built-in
/// title such as `todo` may hold real content. Empty pages are all preselected.
Future<List<LegacyCandidate>> legacyCandidates() => RustLib.instance.api
.crateApiGraphSynapseGraphLegacyCandidates(that: this);
+27 -5
View File
@@ -374,21 +374,43 @@ class _CleanupDialogState extends State<CleanupDialog> {
final colors = context.colors;
final items = widget.candidates;
return AlertDialog(
title: const Text('Remove legacy Logseq pages'),
title: const Text('Clean up pages'),
content: SizedBox(
width: 460,
child: items.isEmpty
? Text(
'No legacy pages found.',
'Nothing to clean up.',
style: TextStyle(color: colors.muted),
)
: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'This deletes the selected pages and their blocks.',
style: TextStyle(fontSize: 13, color: colors.muted),
Row(
children: [
Expanded(
child: Text(
'Empty pages and Logseq leftovers. This deletes the '
'selected pages and their blocks.',
style: TextStyle(fontSize: 13, color: colors.muted),
),
),
TextButton(
key: const Key('cleanup-toggle-all'),
onPressed: () => setState(() {
if (_checked.length == items.length) {
_checked.clear();
} else {
_checked.addAll([for (final c in items) c.id]);
}
}),
child: Text(
_checked.length == items.length
? 'Select none'
: 'Select all',
),
),
],
),
const SizedBox(height: 8),
Flexible(