修复一下

This commit is contained in:
rang 2025-10-25 17:22:39 +08:00
parent 41ade02ace
commit debba61cad
4 changed files with 16 additions and 27 deletions

View file

@ -195,7 +195,7 @@ jobs:
dist/*/*.zip dist/*/*.zip
build_ios_macos: build_ios_macos:
# needs: test needs: test
runs-on: macos-latest runs-on: macos-latest
permissions: permissions:
contents: write contents: write

View file

@ -5,6 +5,7 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
bump_type: bump_type:
# 版本碰撞类型(补丁、次要、主要)
description: "Type of version bump (patch, minor, major)" description: "Type of version bump (patch, minor, major)"
required: true required: true
type: choice type: choice

View file

@ -62,8 +62,8 @@ class MySearchBar extends HookConsumerWidget {
currentQuery = query; currentQuery = query;
// In a real application, there should be some error handling here. // In a real application, there should be some error handling here.
final options = await api.libraries final options =
.search(libraryId: settings.activeLibraryId!, query: query, limit: 3); await api.libraries.search(libraryId: settings.activeLibraryId!, query: query, limit: 3);
// If another search happened after this one, throw away these options. // If another search happened after this one, throw away these options.
if (currentQuery != query) { if (currentQuery != query) {
@ -82,6 +82,7 @@ class MySearchBar extends HookConsumerWidget {
dividerColor: Colors.transparent, dividerColor: Colors.transparent,
builder: (context, controller) { builder: (context, controller) {
return SearchBar( return SearchBar(
constraints: const BoxConstraints(minWidth: 360.0, maxWidth: 1050.0, minHeight: 56.0),
controller: controller, controller: controller,
focusNode: searchBarFocusNode, focusNode: searchBarFocusNode,
// "What's your next page-turner?" // "What's your next page-turner?"
@ -98,10 +99,7 @@ class MySearchBar extends HookConsumerWidget {
// opacity: 0.5 for the hint text // opacity: 0.5 for the hint text
hintStyle: WidgetStatePropertyAll( hintStyle: WidgetStatePropertyAll(
Theme.of(context).textTheme.bodyMedium!.copyWith( Theme.of(context).textTheme.bodyMedium!.copyWith(
color: Theme.of(context) color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.5),
.colorScheme
.onSurface
.withValues(alpha: 0.5),
), ),
), ),
textInputAction: TextInputAction.search, textInputAction: TextInputAction.search,
@ -234,9 +232,8 @@ class BookSearchResultMini extends HookConsumerWidget {
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final item = ref.watch(libraryItemProvider(book.libraryItemId)).valueOrNull; final item = ref.watch(libraryItemProvider(book.libraryItemId)).valueOrNull;
final image = item == null final image =
? const AsyncValue.loading() item == null ? const AsyncValue.loading() : ref.watch(coverImageProvider(item.id));
: ref.watch(coverImageProvider(item.id));
return ListTile( return ListTile(
leading: SizedBox( leading: SizedBox(
width: 50, width: 50,

View file

@ -116,8 +116,7 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
// extended: false, // extended: false,
destinations: _navigationItems(context).map((item) { destinations: _navigationItems(context).map((item) {
final isDestinationLibrary = item.name == S.of(context).library; final isDestinationLibrary = item.name == S.of(context).library;
var currentLibrary = var currentLibrary = ref.watch(currentLibraryProvider).valueOrNull;
ref.watch(currentLibraryProvider).valueOrNull;
final libraryIcon = AbsIcons.getIconByName( final libraryIcon = AbsIcons.getIconByName(
currentLibrary?.icon, currentLibrary?.icon,
); );
@ -126,13 +125,9 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
isDestinationLibrary ? libraryIcon ?? item.icon : item.icon, isDestinationLibrary ? libraryIcon ?? item.icon : item.icon,
), ),
selectedIcon: Icon( selectedIcon: Icon(
isDestinationLibrary isDestinationLibrary ? libraryIcon ?? item.activeIcon : item.activeIcon,
? libraryIcon ?? item.activeIcon
: item.activeIcon,
), ),
label: Text(isDestinationLibrary label: Text(isDestinationLibrary ? currentLibrary?.name ?? item.name : item.name),
? currentLibrary?.name ?? item.name
: item.name),
// tooltip: item.tooltip, // tooltip: item.tooltip,
); );
// if (isDestinationLibrary) { // if (isDestinationLibrary) {
@ -171,8 +166,8 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
// useValueListenable(ref.watch(playerExpandProgressNotifierProvider)); // useValueListenable(ref.watch(playerExpandProgressNotifierProvider));
final playerProgress = ref.watch(playerHeightProvider); final playerProgress = ref.watch(playerHeightProvider);
final playerMaxHeight = MediaQuery.of(context).size.height; final playerMaxHeight = MediaQuery.of(context).size.height;
var percentExpandedMiniPlayer = (playerProgress - playerMinHeight) / var percentExpandedMiniPlayer =
(playerMaxHeight - playerMinHeight); (playerProgress - playerMinHeight) / (playerMaxHeight - playerMinHeight);
// Clamp the value between 0 and 1 // Clamp the value between 0 and 1
percentExpandedMiniPlayer = percentExpandedMiniPlayer.clamp(0.0, 1.0); percentExpandedMiniPlayer = percentExpandedMiniPlayer.clamp(0.0, 1.0);
return Opacity( return Opacity(
@ -198,13 +193,9 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
isDestinationLibrary ? libraryIcon ?? item.icon : item.icon, isDestinationLibrary ? libraryIcon ?? item.icon : item.icon,
), ),
selectedIcon: Icon( selectedIcon: Icon(
isDestinationLibrary isDestinationLibrary ? libraryIcon ?? item.activeIcon : item.activeIcon,
? libraryIcon ?? item.activeIcon
: item.activeIcon,
), ),
label: isDestinationLibrary label: isDestinationLibrary ? currentLibrary?.name ?? item.name : item.name,
? currentLibrary?.name ?? item.name
: item.name,
tooltip: item.tooltip, tooltip: item.tooltip,
); );
if (isDestinationLibrary) { if (isDestinationLibrary) {
@ -239,7 +230,7 @@ class ScaffoldWithNavBar extends HookConsumerWidget {
icon: Icons.book_outlined, icon: Icons.book_outlined,
activeIcon: Icons.book, activeIcon: Icons.book,
// tooltip: 'Browse your library', // tooltip: 'Browse your library',
tooltip: S.of(context).exploreTooltip, tooltip: S.of(context).libraryTooltip,
), ),
_NavigationItem( _NavigationItem(
// name: 'Explore', // name: 'Explore',