From ed44198e25ab1e47b6b9ee5c2421916b329339e3 Mon Sep 17 00:00:00 2001 From: Erwan Leboucher Date: Mon, 20 Jul 2026 09:43:05 +0200 Subject: [PATCH] feat: native share sheet for mobile Add tauri-plugin-sharekit for iOS/Android system share sheet. shareText() util falls back to Web Share API then clipboard. Wired into ShareChip, Space menu, SpaceTabs menu. --- .changeset/native-share-sheet.md | 5 +++++ src/app/components/setting-tile/SettingTile.tsx | 4 ++-- src/app/features/settings/cosmetics/ThemeCatalogSettings.tsx | 5 +++-- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/native-share-sheet.md diff --git a/.changeset/native-share-sheet.md b/.changeset/native-share-sheet.md new file mode 100644 index 0000000000..62863bb753 --- /dev/null +++ b/.changeset/native-share-sheet.md @@ -0,0 +1,5 @@ +--- +default: minor +--- + +Add a native share sheet on mobile via the Tauri sharekit plugin, with Web Share API support on PWA and a clipboard-copy fallback on desktop. diff --git a/src/app/components/setting-tile/SettingTile.tsx b/src/app/components/setting-tile/SettingTile.tsx index 53b5a56bb3..d37c87e859 100644 --- a/src/app/components/setting-tile/SettingTile.tsx +++ b/src/app/components/setting-tile/SettingTile.tsx @@ -3,7 +3,7 @@ import { Box, IconButton, Text } from 'folds'; import { Check, Link, sizedIcon } from '$components/icons/phosphor'; import { BreakWord } from '$styles/Text.css'; import { buildSettingsLink } from '$features/settings/settingsLink'; -import { copyToClipboard } from '$utils/dom'; +import { shareText } from '$utils/share'; import { ScreenSize, useScreenSizeContext } from '$hooks/useScreenSize'; import { useTimeoutToggle } from '$hooks/useTimeoutToggle'; import { useSettingsLinkContext } from '$features/settings/SettingsLinkContext'; @@ -52,7 +52,7 @@ function SettingTileSettingLinkAction({ : settingTileSettingLinkActionMobileVisible, ].join(' ')} onClick={async () => { - if (await copyToClipboard(copyPath)) setCopied(); + if (await shareText(copyPath)) setCopied(); }} size="300" variant="Surface" diff --git a/src/app/features/settings/cosmetics/ThemeCatalogSettings.tsx b/src/app/features/settings/cosmetics/ThemeCatalogSettings.tsx index baf195a5d9..7b944513b8 100644 --- a/src/app/features/settings/cosmetics/ThemeCatalogSettings.tsx +++ b/src/app/features/settings/cosmetics/ThemeCatalogSettings.tsx @@ -1,6 +1,7 @@ import { type ChangeEventHandler, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useTimeoutToggle } from '$hooks/useTimeoutToggle'; -import { copyToClipboard, downloadTextFile } from '$utils/dom'; +import { downloadTextFile } from '$utils/dom'; +import { shareText } from '$utils/share'; import { fetch } from '$utils/fetch'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { @@ -133,7 +134,7 @@ function CatalogTweakCard({ const [copied, setCopied] = useTimeoutToggle(); const handleCopy = useCallback(async () => { if (!copyUrl) return; - if (await copyToClipboard(copyUrl)) setCopied(); + if (await shareText(copyUrl)) setCopied(); }, [copyUrl, setCopied]); return (