Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a568a3df9 | ||
|
|
d58b512020 |
@@ -10,7 +10,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/RarDog/Lunaris/releases"><img src="https://img.shields.io/badge/Version-3.1.0-8A2BE2?style=for-the-badge&logo=semver&logoColor=white" alt="Version 3.1.0" /></a>
|
<a href="https://github.com/RarDog/Lunaris/releases"><img src="https://img.shields.io/badge/Version-3.1.2-8A2BE2?style=for-the-badge&logo=semver&logoColor=white" alt="Version 3.1.2" /></a>
|
||||||
<img src="https://img.shields.io/badge/Flutter-3.47+-02569B?style=for-the-badge&logo=flutter&logoColor=white" alt="Flutter" />
|
<img src="https://img.shields.io/badge/Flutter-3.47+-02569B?style=for-the-badge&logo=flutter&logoColor=white" alt="Flutter" />
|
||||||
<img src="https://img.shields.io/badge/Platform-Android%20%7C%20Linux%20%7C%20Windows-00C853?style=for-the-badge" alt="Platforms" />
|
<img src="https://img.shields.io/badge/Platform-Android%20%7C%20Linux%20%7C%20Windows-00C853?style=for-the-badge" alt="Platforms" />
|
||||||
<a href="https://github.com/RarDog/Lunaris/wiki"><img src="https://img.shields.io/badge/Wiki-Documentation-FF6F00?style=for-the-badge&logo=gitbook&logoColor=white" alt="Wiki" /></a>
|
<a href="https://github.com/RarDog/Lunaris/wiki"><img src="https://img.shields.io/badge/Wiki-Documentation-FF6F00?style=for-the-badge&logo=gitbook&logoColor=white" alt="Wiki" /></a>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
const appDisplayVersion = '3.1.0';
|
const appDisplayVersion = '3.1.2';
|
||||||
const appBuildNumber = 61;
|
const appBuildNumber = 63;
|
||||||
const appReleaseChannel = 'Stable';
|
const appReleaseChannel = 'Stable';
|
||||||
|
|||||||
@@ -1,4 +1,26 @@
|
|||||||
const lunarisChangelog = [
|
const lunarisChangelog = [
|
||||||
|
LunarisChange(
|
||||||
|
version: '3.1.2',
|
||||||
|
title: 'Оптимизация производительности: устранение лагов при скролле к тегам',
|
||||||
|
bullets: [
|
||||||
|
'Устранение лагов при прокрутке тегов: полностью ликвидирован тяжелый GPU-оверхед BackdropFilter на повторяющихся чипах тегов, вызывавший просадки FPS и микрофризы при скролле постов с десятками и сотнями тегов.',
|
||||||
|
'Высокопроизводительный стеклянный стиль чипов (TagChip): чипы переведены на эффективные аппаратные альфа-слои и зеркальные контуры без потери премиального неонового Liquid Glass вида и цветных индикаторов категорий.',
|
||||||
|
'Облегчение контейнеров блока тегов: на мобильных и десктоп экранах контейнеры тегов оптимизированы для мгновенного плавного 120 FPS скроллинга.',
|
||||||
|
'Интеллектуальный лимит начального отображения: оптимизировано первоначальное количество отображаемых тегов в огромных категориях с удобной кнопкой быстрого раскрытия.',
|
||||||
|
],
|
||||||
|
),
|
||||||
|
LunarisChange(
|
||||||
|
version: '3.1.1',
|
||||||
|
title: 'Деление тегов по стилю e621/Gelbooru/Rule34 и исправление поиска тегов со скобками',
|
||||||
|
bullets: [
|
||||||
|
'Цветное деление тегов по категориям (e621, Rule34, Gelbooru): теги авторов (Artist) подсвечиваются кораллово-красным, персонажи (Character) — мятно-зелёным, серии/копирайты (Copyright) — пурпурным, виды (Species) — янтарно-оранжевым, мета (Meta) — ледяным голубым, а общие теги (General) — нейтральным стилем.',
|
||||||
|
'Liquid Glass чипы тегов: компоненты TagChip получили полупрозрачный фон с BackdropFilter размытием, цветной светодиодный индикатор-точку со свечением и зеркальный контур.',
|
||||||
|
'Индикаторы в заголовках категорий: заголовки блоков тегов дополнены цветными точками категорий со свечением и стильными капсулами счётчиков.',
|
||||||
|
'Исправление поиска тегов со скобками: исправлена проблема, из-за которой теги с круглыми скобками (например, tyson_(password), touhou_(series)) очищались от скобок при поиске и не находили постов в ленте.',
|
||||||
|
'Поддержка скобок в подсказках и локальном кэше: автодополнение теперь корректно выдает теги со скобками, фильтруя только внешние скобки группировки and-веток.',
|
||||||
|
'Liquid Glass оформление блока тегов в детальном просмотре поста на мобильных и десктоп устройствах.',
|
||||||
|
],
|
||||||
|
),
|
||||||
LunarisChange(
|
LunarisChange(
|
||||||
version: '3.1.0',
|
version: '3.1.0',
|
||||||
title: 'iPhone Liquid Glass — Поиск, Избранное, История и исправление доступности',
|
title: 'iPhone Liquid Glass — Поиск, Избранное, История и исправление доступности',
|
||||||
|
|||||||
@@ -169,7 +169,16 @@ class ProviderManager {
|
|||||||
|
|
||||||
for (final raw in rawTags) {
|
for (final raw in rawTags) {
|
||||||
var token = raw.trim();
|
var token = raw.trim();
|
||||||
token = token.replaceAll(RegExp(r'^[\(\)]+|[\(\)]+$'), '').trim();
|
if (token.isEmpty) continue;
|
||||||
|
|
||||||
|
// Only strip parentheses if they are grouping delimiters (unbalanced in the token, e.g. '(cat' or 'dog)')
|
||||||
|
// but preserve tags that have internal paired parentheses like 'tyson_(password)'.
|
||||||
|
if (token.startsWith('(') && !token.contains(')')) {
|
||||||
|
token = token.substring(1).trim();
|
||||||
|
}
|
||||||
|
if (token.endsWith(')') && !token.contains('(')) {
|
||||||
|
token = token.substring(0, token.length - 1).trim();
|
||||||
|
}
|
||||||
if (token.isEmpty) continue;
|
if (token.isEmpty) continue;
|
||||||
|
|
||||||
if (token.toLowerCase() == 'and') {
|
if (token.toLowerCase() == 'and') {
|
||||||
|
|||||||
@@ -21,10 +21,7 @@ class SearchService {
|
|||||||
TagCacheService? get tagCacheService => _tagCacheService;
|
TagCacheService? get tagCacheService => _tagCacheService;
|
||||||
|
|
||||||
static String sanitizeToken(String raw) {
|
static String sanitizeToken(String raw) {
|
||||||
return raw
|
return raw.trim().toLowerCase();
|
||||||
.replaceAll(RegExp(r'^[\(\)]+|[\(\)]+$'), '')
|
|
||||||
.trim()
|
|
||||||
.toLowerCase();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> parseTags(String query) {
|
List<String> parseTags(String query) {
|
||||||
|
|||||||
@@ -66,10 +66,11 @@ class TagCacheService {
|
|||||||
int limit = 16,
|
int limit = 16,
|
||||||
Iterable<String>? priorityTags,
|
Iterable<String>? priorityTags,
|
||||||
}) {
|
}) {
|
||||||
final cleanPrefix = prefix
|
var cleanPrefix = prefix.trim().toLowerCase();
|
||||||
.replaceAll(RegExp(r'^[\(\)]+|[\(\)]+$'), '')
|
// If the prefix has an unbalanced opening parenthesis at the start (e.g. '(cat'), strip it
|
||||||
.trim()
|
if (cleanPrefix.startsWith('(') && !cleanPrefix.contains(')')) {
|
||||||
.toLowerCase();
|
cleanPrefix = cleanPrefix.substring(1).trim();
|
||||||
|
}
|
||||||
if (cleanPrefix.isEmpty) return const [];
|
if (cleanPrefix.isEmpty) return const [];
|
||||||
|
|
||||||
final prioritySet = priorityTags
|
final prioritySet = priorityTags
|
||||||
|
|||||||
@@ -316,14 +316,15 @@ class PostDetailsScreen extends ConsumerWidget {
|
|||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color:
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
Theme.of(context).colorScheme.surfaceContainerLow,
|
? Theme.of(context).colorScheme.surfaceContainerHigh.withValues(alpha: 0.70)
|
||||||
borderRadius: BorderRadius.circular(18),
|
: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
.colorScheme
|
? Colors.white.withValues(alpha: 0.12)
|
||||||
.outlineVariant
|
: Theme.of(context).colorScheme.outlineVariant.withValues(alpha: 0.40),
|
||||||
.withValues(alpha: 0.35),
|
width: 1.1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
@@ -493,13 +494,15 @@ class PostDetailsScreen extends ConsumerWidget {
|
|||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.surfaceContainerLow,
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
borderRadius: BorderRadius.circular(18),
|
? Theme.of(context).colorScheme.surfaceContainerHigh.withValues(alpha: 0.70)
|
||||||
|
: Theme.of(context).colorScheme.surfaceContainerLow,
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
.colorScheme
|
? Colors.white.withValues(alpha: 0.12)
|
||||||
.outlineVariant
|
: Theme.of(context).colorScheme.outlineVariant.withValues(alpha: 0.40),
|
||||||
.withValues(alpha: 0.35),
|
width: 1.1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ class _TagGroupBlock extends StatelessWidget {
|
|||||||
required this.onLongPress,
|
required this.onLongPress,
|
||||||
});
|
});
|
||||||
|
|
||||||
static const _collapsedLimit = 36;
|
static const _collapsedLimit = 28;
|
||||||
|
|
||||||
final String label;
|
final String label;
|
||||||
final String group;
|
final String group;
|
||||||
@@ -320,14 +320,52 @@ class _TagGroupBlock extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(label, style: Theme.of(context).textTheme.labelLarge),
|
Container(
|
||||||
const SizedBox(width: 8),
|
width: 8,
|
||||||
|
height: 8,
|
||||||
|
margin: const EdgeInsets.only(right: 8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: _headerDotColor(group, Theme.of(context)),
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: _headerDotColor(group, Theme.of(context))
|
||||||
|
.withValues(alpha: 0.55),
|
||||||
|
blurRadius: 5,
|
||||||
|
spreadRadius: 1,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
Text(
|
Text(
|
||||||
|
label,
|
||||||
|
style: Theme.of(context).textTheme.titleSmall?.copyWith(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
letterSpacing: -0.1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 1.5),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? Colors.white.withValues(alpha: 0.08)
|
||||||
|
: Colors.black.withValues(alpha: 0.05),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(
|
||||||
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
|
? Colors.white.withValues(alpha: 0.12)
|
||||||
|
: Colors.black.withValues(alpha: 0.08),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
'${tags.length}',
|
'${tags.length}',
|
||||||
style: Theme.of(context).textTheme.labelMedium?.copyWith(
|
style: Theme.of(context).textTheme.labelSmall?.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 7),
|
const SizedBox(height: 7),
|
||||||
@@ -338,6 +376,7 @@ class _TagGroupBlock extends StatelessWidget {
|
|||||||
for (final tag in visibleTags)
|
for (final tag in visibleTags)
|
||||||
TagChip(
|
TagChip(
|
||||||
tag: tag,
|
tag: tag,
|
||||||
|
group: group,
|
||||||
onTap: () => onTap(tag),
|
onTap: () => onTap(tag),
|
||||||
onLongPress: () => onLongPress(tag),
|
onLongPress: () => onLongPress(tag),
|
||||||
),
|
),
|
||||||
@@ -360,4 +399,17 @@ class _TagGroupBlock extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Color _headerDotColor(String group, ThemeData theme) {
|
||||||
|
return switch (group.toLowerCase()) {
|
||||||
|
'artist' => const Color(0xFFFF4757),
|
||||||
|
'character' => const Color(0xFF2ED573),
|
||||||
|
'copyright' => const Color(0xFFA55EEA),
|
||||||
|
'species' => const Color(0xFFFFA502),
|
||||||
|
'meta' => const Color(0xFF1E90FF),
|
||||||
|
_ => theme.colorScheme.primary,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -567,7 +567,7 @@ class _TagInputSearchBarState extends State<TagInputSearchBar> {
|
|||||||
final draft = _controller.text.trim().toLowerCase();
|
final draft = _controller.text.trim().toLowerCase();
|
||||||
if (draft.isEmpty) return '';
|
if (draft.isEmpty) return '';
|
||||||
final raw = draft.split(RegExp(r'\s+')).last;
|
final raw = draft.split(RegExp(r'\s+')).last;
|
||||||
return raw.replaceAll(RegExp(r'^[\(\)]+|[\(\)]+$'), '').trim();
|
return raw.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get _isEditing => _focusNode.hasFocus || _localDirty;
|
bool get _isEditing => _focusNode.hasFocus || _localDirty;
|
||||||
|
|||||||
@@ -1,36 +1,128 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../backend/models/tag_suggestion.dart';
|
||||||
|
|
||||||
class TagChip extends StatelessWidget {
|
class TagChip extends StatelessWidget {
|
||||||
const TagChip({
|
const TagChip({
|
||||||
required this.tag,
|
required this.tag,
|
||||||
|
this.category,
|
||||||
|
this.group,
|
||||||
this.onTap,
|
this.onTap,
|
||||||
this.onLongPress,
|
this.onLongPress,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String tag;
|
final String tag;
|
||||||
|
final TagCategory? category;
|
||||||
|
final String? group;
|
||||||
final VoidCallback? onTap;
|
final VoidCallback? onTap;
|
||||||
final VoidCallback? onLongPress;
|
final VoidCallback? onLongPress;
|
||||||
|
|
||||||
|
TagCategory get _resolvedCategory {
|
||||||
|
if (category != null) return category!;
|
||||||
|
final g = (group ?? '').toLowerCase();
|
||||||
|
return switch (g) {
|
||||||
|
'artist' => TagCategory.artist,
|
||||||
|
'character' => TagCategory.character,
|
||||||
|
'copyright' => TagCategory.copyright,
|
||||||
|
'species' => TagCategory.species,
|
||||||
|
'meta' => TagCategory.meta,
|
||||||
|
'general' => TagCategory.general,
|
||||||
|
_ => tagCategoryFromString(g),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final scheme = Theme.of(context).colorScheme;
|
final scheme = Theme.of(context).colorScheme;
|
||||||
final chip = ActionChip(
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
onPressed: onTap,
|
final cat = _resolvedCategory;
|
||||||
label: Text(tag),
|
|
||||||
labelStyle: TextStyle(
|
final (Color baseColor, Color textColor) = _colorsForCategory(cat, scheme, isDark);
|
||||||
color: scheme.onSecondaryContainer,
|
|
||||||
|
final chipWidget = Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: baseColor.withValues(alpha: isDark ? 0.16 : 0.10),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(
|
||||||
|
color: baseColor.withValues(alpha: isDark ? 0.40 : 0.28),
|
||||||
|
width: 1.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
onTap: onTap,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 6,
|
||||||
|
height: 6,
|
||||||
|
margin: const EdgeInsets.only(right: 6),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: baseColor,
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
tag,
|
||||||
|
style: TextStyle(
|
||||||
|
color: textColor,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
|
fontSize: 13,
|
||||||
|
letterSpacing: -0.1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
backgroundColor: scheme.secondaryContainer.withValues(alpha: 0.62),
|
|
||||||
side: BorderSide(color: scheme.outlineVariant.withValues(alpha: 0.65)),
|
|
||||||
visualDensity: VisualDensity.compact,
|
|
||||||
);
|
);
|
||||||
if (onLongPress == null) return chip;
|
|
||||||
|
if (onLongPress == null) return chipWidget;
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onLongPress: onLongPress,
|
onLongPress: onLongPress,
|
||||||
child: chip,
|
child: chipWidget,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static (Color, Color) _colorsForCategory(
|
||||||
|
TagCategory cat,
|
||||||
|
ColorScheme scheme,
|
||||||
|
bool isDark,
|
||||||
|
) {
|
||||||
|
return switch (cat) {
|
||||||
|
TagCategory.artist => (
|
||||||
|
const Color(0xFFFF4757), // e621 / Gelbooru red/coral
|
||||||
|
isDark ? const Color(0xFFFF6B81) : const Color(0xFFD63031),
|
||||||
|
),
|
||||||
|
TagCategory.character => (
|
||||||
|
const Color(0xFF2ED573), // Vibrant character green
|
||||||
|
isDark ? const Color(0xFF7BED9F) : const Color(0xFF10AC84),
|
||||||
|
),
|
||||||
|
TagCategory.copyright => (
|
||||||
|
const Color(0xFFA55EEA), // Classic anime series purple
|
||||||
|
isDark ? const Color(0xFFD980FA) : const Color(0xFF8854D0),
|
||||||
|
),
|
||||||
|
TagCategory.species => (
|
||||||
|
const Color(0xFFFFA502), // e621 species amber/orange
|
||||||
|
isDark ? const Color(0xFFFFC048) : const Color(0xFFE67E22),
|
||||||
|
),
|
||||||
|
TagCategory.meta => (
|
||||||
|
const Color(0xFF1E90FF), // Meta / format cyan / ice blue
|
||||||
|
isDark ? const Color(0xFF70A1FF) : const Color(0xFF0984E3),
|
||||||
|
),
|
||||||
|
TagCategory.general || TagCategory.unknown => (
|
||||||
|
isDark ? scheme.primary : scheme.primary,
|
||||||
|
isDark ? scheme.onSurface : scheme.onSurface,
|
||||||
|
),
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
name: gel_rule_app
|
name: gel_rule_app
|
||||||
description: Local backend/core layer for a Flutter booru browser app.
|
description: Local backend/core layer for a Flutter booru browser app.
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
version: 3.1.0+61
|
version: 3.1.2+63
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.3.0 <4.0.0"
|
sdk: ">=3.3.0 <4.0.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user