-
Notifications
You must be signed in to change notification settings - Fork 4
🚸 Prevent context & annotation menu conflict #894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,26 @@ | ||
| const APP_USER_AGENT_PREFIX = '3ook-com-app' | ||
| // e.g. "3ook-com-app/1.1.0 (iOS 18.0) Build/42" | ||
| const APP_USER_AGENT_REGEX = /^3ook-com-app\/[\d.]+ \((iOS|Android) [\d.]+\)/ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need this to match old version like |
||
|
|
||
| export function useAppDetection() { | ||
| const getRouteQuery = useRouteQuery() | ||
|
|
||
| const isAppUserAgent = import.meta.server | ||
| ? useRequestHeaders(['user-agent'])['user-agent']?.startsWith(APP_USER_AGENT_PREFIX) || false | ||
| : navigator.userAgent?.startsWith(APP_USER_AGENT_PREFIX) || false | ||
| const userAgent = import.meta.server | ||
| ? useRequestHeaders(['user-agent'])['user-agent'] || '' | ||
| : navigator.userAgent || '' | ||
|
|
||
| const appUAMatches = userAgent.match(APP_USER_AGENT_REGEX) | ||
| const appOSName = appUAMatches?.[1] | ||
|
|
||
| const isApp = computed(() => { | ||
| return isAppUserAgent || getRouteQuery('app') === '1' | ||
| return !!appUAMatches || getRouteQuery('app') === '1' | ||
| }) | ||
|
Comment on lines
+1
to
16
|
||
|
|
||
| return { isApp } | ||
| const isIOS = computed(() => appOSName === 'iOS' || /iPhone|iPad/.test(userAgent)) | ||
| const isAndroid = computed(() => appOSName === 'Android' || /Android/.test(userAgent)) | ||
|
|
||
| return { | ||
| isApp, | ||
| isIOS, | ||
| isAndroid, | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldAppearFromBottomis now!isIOS || isInBottomHalfViewport, which makes it alwaystrueon non‑iOS devices (menu always positioned below the selection) and no longer depends on viewport position like before. If the intent was to change behavior only on iOS, this boolean is inverted; adjust the condition so non‑iOS retains the originalisInBottomHalfViewportlogic.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is intended