feat: colored tag categories division like e621/gelbooru/rule34 and fix search for tags with parentheses
Build and Release / Build Windows x64 (push) Has been cancelled

This commit is contained in:
2026-09-04 20:56:35 +03:00
parent 384c07955c
commit d58b512020
11 changed files with 288 additions and 97 deletions
+1 -4
View File
@@ -21,10 +21,7 @@ class SearchService {
TagCacheService? get tagCacheService => _tagCacheService;
static String sanitizeToken(String raw) {
return raw
.replaceAll(RegExp(r'^[\(\)]+|[\(\)]+$'), '')
.trim()
.toLowerCase();
return raw.trim().toLowerCase();
}
List<String> parseTags(String query) {
+5 -4
View File
@@ -66,10 +66,11 @@ class TagCacheService {
int limit = 16,
Iterable<String>? priorityTags,
}) {
final cleanPrefix = prefix
.replaceAll(RegExp(r'^[\(\)]+|[\(\)]+$'), '')
.trim()
.toLowerCase();
var cleanPrefix = prefix.trim().toLowerCase();
// If the prefix has an unbalanced opening parenthesis at the start (e.g. '(cat'), strip it
if (cleanPrefix.startsWith('(') && !cleanPrefix.contains(')')) {
cleanPrefix = cleanPrefix.substring(1).trim();
}
if (cleanPrefix.isEmpty) return const [];
final prioritySet = priorityTags