From a52cd877843c0003931bb6ff066f8d1cde863c51 Mon Sep 17 00:00:00 2001 From: kev1n77 Date: Fri, 30 Oct 2026 09:52:19 +0800 Subject: [PATCH] feat(web): add Feishu feedback form entry --- src/web-ui/.env.desktop | 3 ++ src/web-ui/.env.example | 3 ++ src/web-ui/.env.production | 3 ++ .../components/PersistentFooterActions.tsx | 30 +++++++++++ .../feedback/publicFeedbackForm.test.ts | 33 ++++++++++++ .../feedback/publicFeedbackForm.ts | 52 +++++++++++++++++++ src/web-ui/src/locales/en-US/common.json | 3 ++ src/web-ui/src/locales/zh-CN/common.json | 3 ++ src/web-ui/src/locales/zh-TW/common.json | 3 ++ 9 files changed, 133 insertions(+) create mode 100644 src/web-ui/.env.desktop create mode 100644 src/web-ui/.env.example create mode 100644 src/web-ui/.env.production create mode 100644 src/web-ui/src/infrastructure/feedback/publicFeedbackForm.test.ts create mode 100644 src/web-ui/src/infrastructure/feedback/publicFeedbackForm.ts diff --git a/src/web-ui/.env.desktop b/src/web-ui/.env.desktop new file mode 100644 index 0000000000..bfbecdc8f0 --- /dev/null +++ b/src/web-ui/.env.desktop @@ -0,0 +1,3 @@ +# Public Feishu Bitable form URL used by desktop release builds. +# This is intentionally public configuration; never put credentials here. +VITE_OPENBITFUN_FEEDBACK_FORM_URL=https://yix5lziu1kt.feishu.cn/share/base/shrcnX1PtqpZRWSFvy13DgO2JPe diff --git a/src/web-ui/.env.example b/src/web-ui/.env.example new file mode 100644 index 0000000000..47b30b7fe1 --- /dev/null +++ b/src/web-ui/.env.example @@ -0,0 +1,3 @@ +# Public Feishu Bitable form URL. This is public configuration; do not put an +# App Secret, access token, or other credential here. +VITE_OPENBITFUN_FEEDBACK_FORM_URL=https://yix5lziu1kt.feishu.cn/share/base/shrcnX1PtqpZRWSFvy13DgO2JPe diff --git a/src/web-ui/.env.production b/src/web-ui/.env.production new file mode 100644 index 0000000000..6ca447d2f6 --- /dev/null +++ b/src/web-ui/.env.production @@ -0,0 +1,3 @@ +# Public Feishu Bitable form URL used by production builds. +# This is intentionally public configuration; never put credentials here. +VITE_OPENBITFUN_FEEDBACK_FORM_URL=https://yix5lziu1kt.feishu.cn/share/base/shrcnX1PtqpZRWSFvy13DgO2JPe diff --git a/src/web-ui/src/app/components/NavPanel/components/PersistentFooterActions.tsx b/src/web-ui/src/app/components/NavPanel/components/PersistentFooterActions.tsx index a000cc59e5..7c35f3c5c5 100644 --- a/src/web-ui/src/app/components/NavPanel/components/PersistentFooterActions.tsx +++ b/src/web-ui/src/app/components/NavPanel/components/PersistentFooterActions.tsx @@ -40,6 +40,11 @@ import { useHasAppUpdate } from '@/infrastructure/update/useHasAppUpdate'; import { UpdateDownloadIndicator } from '@/infrastructure/update/UpdateDownloadIndicator'; import { UpdateMenuItems } from '@/infrastructure/update/UpdateMenuItems'; import { useUpdateInstallStore } from '@/infrastructure/update/updateInstallStore'; +import { useAccountIdentity } from '@/infrastructure/account-identity'; +import { buildPublicFeedbackFormUrl } from '@/infrastructure/feedback/publicFeedbackForm'; +import { systemAPI } from '@/infrastructure/api/service-api/SystemAPI'; +import { notificationService } from '@/shared/notification-system'; +import { getVersionInfo } from '@/shared/utils/version'; const RemoteConnectDialog = lazyWithRecovery(() => import('../../RemoteConnectDialog')); @@ -51,6 +56,7 @@ const PersistentFooterActions: React.FC = () => { ? t('nav.tooltips.ecosystemCompatibilityUnseen') : t('nav.tooltips.ecosystemCompatibility'); const { enableToolbarMode } = useToolbarModeContext(); + const accountIdentity = useAccountIdentity(); const [menuOpen, setMenuOpen] = useState(false); const [menuClosing, setMenuClosing] = useState(false); const [appearanceSubmenuOpen, setAppearanceSubmenuOpen] = useState(false); @@ -136,6 +142,23 @@ const PersistentFooterActions: React.FC = () => { window.dispatchEvent(new Event('nav:show-about')); }; + const handleOpenFeedback = useCallback(() => { + closeMenu(); + const account = accountIdentity.status === 'signed-in' ? accountIdentity.me?.user : undefined; + const url = buildPublicFeedbackFormUrl(import.meta.env.VITE_OPENBITFUN_FEEDBACK_FORM_URL, { + uid: account?.accountId ?? account?.githubId, + version: getVersionInfo().version, + deviceInfo: typeof navigator === 'undefined' ? undefined : navigator.userAgent, + }); + if (!url) { + notificationService.error(t('nav.settingsMenu.feedbackUnavailable')); + return; + } + void systemAPI.openExternal(url).catch(() => { + notificationService.error(t('nav.settingsMenu.feedbackOpenFailed')); + }); + }, [accountIdentity.me, accountIdentity.status, closeMenu, t]); + const handleFloatingMode = () => { closeMenu(); enableToolbarMode(); @@ -277,6 +300,13 @@ const PersistentFooterActions: React.FC = () => { +