forked from akai/readest
fix(reader): gate route View Transitions on API support (READEST-9) (#4989)
* fix(reader): gate route View Transitions on the API, turns on groups (READEST-9) Reverts #4949, which opened books through the plain router to dodge the "Transition was aborted because of timeout in DOM update" TimeoutError (Sentry READEST-9). Rather than carve the transition out of one flow, gate it at the router: useAppRouter routes through the View Transition router only where the engine has the View Transitions API, and every into-reader path (including the reverted ones) goes back through useAppRouter. The base View Transitions API and nested view-transition groups reach very different browsers, so they become two separate appService capability flags, each backed by a probe in utils/viewTransition: * supportsViewTransitionsAPI (document.startViewTransition): the baseline a route crossfade needs, landing on Chrome 111+, Safari 18+, recent WebView. Gates the router. * supportsViewTransitionGroup (view-transition-group: nearest, Chrome/WebView 140+): the far narrower target the paginator's layered turns require. Gates the turn-style options and the captured-turn fallback. Both flags fold in the Linux WebKitGTK carve-out because it crashes on the snapshot, matching the supportsCanvasContext2DFilter precedent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(tts): enlarge the Now Playing bar and scale its controls responsively Grow the collapsed bar to h-14 with a 10x10 cover and symmetric px-2 padding, drive the play/pause and close icons through useResponsiveSize instead of fixed pixel sizes, and cut the bottom safe-area contribution to a third so the bar sits closer to the screen edge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,10 +12,7 @@ import { saveSysSettings, saveViewSettings } from '@/helpers/settings';
|
||||
import { PageTurnStyle } from '@/types/book';
|
||||
import { SettingsPanelPanelProp } from './SettingsDialog';
|
||||
import { annotationToolQuickActions } from '@/app/reader/components/annotator/AnnotationTools';
|
||||
import {
|
||||
applyPageTurnAttributes,
|
||||
supportsViewTransitionTurns,
|
||||
} from '@/app/reader/hooks/useCapturedTurn';
|
||||
import { applyPageTurnAttributes } from '@/app/reader/hooks/useCapturedTurn';
|
||||
import { isTauriAppPlatform } from '@/services/environment';
|
||||
import {
|
||||
BoxedList,
|
||||
@@ -84,7 +81,7 @@ const ControlPanel: React.FC<SettingsPanelPanelProp> = ({ bookKey, onRegisterRes
|
||||
// the VT turns, so on the web they only get Push (readest#555).
|
||||
const turnStyleOptions = [
|
||||
{ value: 'push', label: _('Push') },
|
||||
...(supportsViewTransitionTurns() || isTauriAppPlatform()
|
||||
...(appService?.supportsViewTransitionGroup || isTauriAppPlatform()
|
||||
? [
|
||||
{ value: 'slide', label: _('Slide') },
|
||||
{ value: 'curl', label: _('Page Curl') },
|
||||
|
||||
Reference in New Issue
Block a user