chore(client): fix tooltip provider lookup and desktop middle-tap

Both failures broke Tests (Client) on main. reka-ui tooltip parts inject a provider
context that only App.vue supplies, so any spec mounting a subtree threw; the tooltip
primitive now stands in its own provider when none is in scope. The foliate click
handler's final else had no isMobile guard, letting a desktop middle-zone tap toggle
the reader chrome. Also record the v3.0.0 server floor beside the App Store badge.
This commit is contained in:
neon
2026-09-21 03:15:58 +00:00
parent 2759893bf6
commit 6e1cbbf3e0
3 changed files with 18 additions and 4 deletions
+14 -2
View File
@@ -1,15 +1,27 @@
<script setup lang="ts">
import type { TooltipRootEmits, TooltipRootProps } from 'reka-ui'
import { TooltipRoot, useForwardPropsEmits } from 'reka-ui'
import { injectTooltipProviderContext, TooltipRoot, useForwardPropsEmits } from 'reka-ui'
import TooltipProvider from './TooltipProvider.vue'
const props = defineProps<TooltipRootProps>()
const emits = defineEmits<TooltipRootEmits>()
const forwarded = useForwardPropsEmits(props, emits)
// Every reka-ui tooltip part injects the provider context and throws when it is missing. App.vue
// wraps the whole application in one, so the only callers that land here are trees mounted outside
// it, which is what a component test does. Standing in a provider keeps those trees rendering
// instead of failing, and the app's own provider still wins wherever it is in scope.
const providerInScope = injectTooltipProviderContext(null) !== null
</script>
<template>
<TooltipRoot v-slot="slotProps" data-slot="tooltip" v-bind="forwarded">
<TooltipRoot v-if="providerInScope" v-slot="slotProps" data-slot="tooltip" v-bind="forwarded">
<slot v-bind="slotProps" />
</TooltipRoot>
<TooltipProvider v-else>
<TooltipRoot v-slot="slotProps" data-slot="tooltip" v-bind="forwarded">
<slot v-bind="slotProps" />
</TooltipRoot>
</TooltipProvider>
</template>
@@ -276,7 +276,9 @@ export function useFoliateInput(
isNavigating = true
navigateRight()
setTimeout(() => (isNavigating = false), 300)
} else {
} else if (isMobile) {
// Touch has no page zones: any tap that is not a double tap toggles the chrome. On a
// pointer device the middle zone is deliberately inert, so it must not fall through here.
onMiddleTap?.()
}
}, DOUBLE_CLICK_MS)