From 9728ea263dd180eddc8cf20740a2810d28bf1e4d Mon Sep 17 00:00:00 2001 From: Parman Mohammadalizadeh Date: Tue, 29 Sep 2026 09:19:49 +0200 Subject: [PATCH] fix(local): open the issue dialog from About's Report an issue About was the one entry point that linked straight to the bare GitHub form, so its reports arrived without the session log. It is now a button that calls openIssueReport(), like the sidebar, toasts and Help menu. The dialog already adds the system details to the report. Fixes #1940 --- docs/architecture/about.md | 2 +- docs/architecture/issue-reports.md | 3 +- .../features/about/about-settings.test.tsx | 36 +++++++++++++++++-- .../src/features/about/about-settings.tsx | 14 ++------ .../features/about/report-issue-button.tsx | 19 ++++++++++ surfsense_local/frontend/translations/de.json | 2 +- surfsense_local/frontend/translations/en.json | 2 +- surfsense_local/frontend/translations/es.json | 2 +- surfsense_local/frontend/translations/fr.json | 2 +- surfsense_local/frontend/translations/hi.json | 2 +- surfsense_local/frontend/translations/ja.json | 2 +- surfsense_local/frontend/translations/ko.json | 2 +- .../frontend/translations/pt-BR.json | 2 +- surfsense_local/frontend/translations/ru.json | 2 +- .../frontend/translations/zh-CN.json | 2 +- 15 files changed, 67 insertions(+), 27 deletions(-) create mode 100644 surfsense_local/frontend/src/features/about/report-issue-button.tsx diff --git a/docs/architecture/about.md b/docs/architecture/about.md index a8c7deaed6..15be930966 100644 --- a/docs/architecture/about.md +++ b/docs/architecture/about.md @@ -8,7 +8,7 @@ Settings › About, in the dialog's App group, shows which build is running and - The version, from `app.getVersion()` in the main process, read through `window.surfsense.about.details()`. The same call returns the OS, architecture, and the Electron, Chromium and Node versions. - The update controls ([updates](updates.md)), which moved here from General. -- Links: release notes for the running version (`/releases/tag/v`), the docs on `surfsense.com`, the GitHub repository, the Discord invite, and a new bug report on the `bug.yml` form with the system details prefilled in its `what` field. +- Links: release notes for the running version (`/releases/tag/v`), the docs on `surfsense.com`, the GitHub repository, the Discord invite, and Report an issue, which opens the issue report dialog with the system details added to the report ([issue reports](issue-reports.md)). - The license line, Apache 2.0, linking to `LICENSE` on GitHub. - Troubleshooting: Copy system info puts the version, OS and runtime versions on the clipboard, in English whatever the interface language, since it is pasted into issues. diff --git a/docs/architecture/issue-reports.md b/docs/architecture/issue-reports.md index 49b7e300c8..493531111b 100644 --- a/docs/architecture/issue-reports.md +++ b/docs/architecture/issue-reports.md @@ -1,6 +1,6 @@ # Issue reports -Report issue, below Plugins in the sidebar, on every error toast and under Help › Report Issue… in the macOS menu bar (Windows and Linux draw no menu bar), shows what this run of the app has logged and turns the user's description into a GitHub bug report. +Report issue, below Plugins in the sidebar, under Links in Settings › About, on every error toast and under Help › Report Issue… in the macOS menu bar (Windows and Linux draw no menu bar), shows what this run of the app has logged and turns the user's description into a GitHub bug report. **Code:** [`surfsense_local/frontend/src/features/feedback/`](../../surfsense_local/frontend/src/features/feedback/), [`surfsense_local/electron/src/main/session-log/`](../../surfsense_local/electron/src/main/session-log/), [`surfsense_local/electron/src/main/menu/`](../../surfsense_local/electron/src/main/menu/), [`.github/ISSUE_TEMPLATE/bug.yml`](../../.github/ISSUE_TEMPLATE/bug.yml) @@ -22,6 +22,5 @@ Report issue, below Plugins in the sidebar, on every error toast and under Help ## Known gaps -- About's Report an issue link still opens the bare form, without the log. - A sidecar crash reaches the log, but no screen shows it: main sends `sidecar:crashed` and nothing in the renderer listens, so no toast offers Report issue. - The main process's own warnings, such as a preference file it could not read, still go to the terminal only. diff --git a/surfsense_local/frontend/src/features/about/about-settings.test.tsx b/surfsense_local/frontend/src/features/about/about-settings.test.tsx index dffefdc1bc..2b06a9c45e 100644 --- a/surfsense_local/frontend/src/features/about/about-settings.test.tsx +++ b/surfsense_local/frontend/src/features/about/about-settings.test.tsx @@ -1,7 +1,8 @@ import { afterEach, describe, expect, it, vi } from "vitest" -import { cleanup, screen } from "@testing-library/react" +import { cleanup, screen, waitFor } from "@testing-library/react" import userEvent from "@testing-library/user-event" +import { IssueReportDialog } from "@/features/feedback/issue-report-dialog" import { stubUpdateBridge } from "@/features/updates/stub-bridge" import { render } from "@/test-utils" @@ -18,7 +19,9 @@ const DETAILS = { function stubAboutBridge() { stubUpdateBridge({ automatic: true, state: { status: "idle" } }) - const openExternal = vi.fn(async () => undefined) + const openExternal = vi.fn<(url: string) => Promise>( + async () => undefined + ) window.surfsense = { ...window.surfsense!, openExternal, @@ -82,6 +85,35 @@ describe("AboutSettings", () => { expect(await screen.findByRole("button", { name: "Copied" })).toBeTruthy() }) + it("reports an issue through the dialog, with the system details", async () => { + const bridge = stubAboutBridge() + const user = userEvent.setup() + render( + <> + + + + ) + + await user.click( + await screen.findByRole("button", { name: "Report an issue" }) + ) + expect(bridge.openExternal).not.toHaveBeenCalled() + await user.type( + await screen.findByRole("textbox", { name: "What went wrong?" }), + "Settings freezes" + ) + await user.click(screen.getByRole("button", { name: "Continue on GitHub" })) + + await waitFor(() => expect(bridge.openExternal).toHaveBeenCalledOnce()) + const what = + new URL(bridge.openExternal.mock.calls[0][0]).searchParams.get("what") ?? + "" + expect(what).toContain("Settings freezes") + expect(what).toContain("SurfSense 2.0.2") + expect(what).toContain("macOS 15.4 (arm64)") + }) + it("copies the bare version from beside it", async () => { stubAboutBridge() const user = userEvent.setup() diff --git a/surfsense_local/frontend/src/features/about/about-settings.tsx b/surfsense_local/frontend/src/features/about/about-settings.tsx index 864d4baa33..e13b3a642c 100644 --- a/surfsense_local/frontend/src/features/about/about-settings.tsx +++ b/surfsense_local/frontend/src/features/about/about-settings.tsx @@ -8,12 +8,11 @@ import { DOCS_URL, GITHUB_URL, LICENSE_URL, - bugReportUrl, releaseNotesUrl, } from "./about-links" import { CopyVersionButton } from "./copy-version-button" import { ExternalLink } from "./external-link" -import { systemInfo } from "./system-info" +import { ReportIssueButton } from "./report-issue-button" import { Troubleshooting } from "./troubleshooting" import { useAppDetails } from "./use-app-details" @@ -104,16 +103,7 @@ export function AboutSettings() { defaultMessage: "Community on Discord", })} - {details ? ( - - {intl.formatMessage({ - id: "about_report_issue_link", - defaultMessage: "Report an issue", - })} - - ) : null} + {details ? : null} diff --git a/surfsense_local/frontend/src/features/about/report-issue-button.tsx b/surfsense_local/frontend/src/features/about/report-issue-button.tsx new file mode 100644 index 0000000000..7315d41a19 --- /dev/null +++ b/surfsense_local/frontend/src/features/about/report-issue-button.tsx @@ -0,0 +1,19 @@ +import { openIssueReport } from "@/features/feedback/issue-report-state" +import { intl } from "@/i18n/intl" + +// Styled as the links beside it, but opens the dialog, which carries the session +// log and the system details. +export function ReportIssueButton() { + return ( + + ) +} diff --git a/surfsense_local/frontend/translations/de.json b/surfsense_local/frontend/translations/de.json index cf811a5ed0..b137f0aef0 100644 --- a/surfsense_local/frontend/translations/de.json +++ b/surfsense_local/frontend/translations/de.json @@ -10,7 +10,7 @@ "about_license_title": "Lizenz", "about_links_title": "Links", "about_release_notes_link": "Versionshinweise", - "about_report_issue_link": "Problem melden", + "about_report_issue_button": "Problem melden", "about_settings_body": "Sieh nach, welche Version du hast, hol dir Updates und finde Hilfe.", "about_settings_title": "Über", "about_system_info_copied_button": "Kopiert", diff --git a/surfsense_local/frontend/translations/en.json b/surfsense_local/frontend/translations/en.json index 46af11fe29..a833e51290 100644 --- a/surfsense_local/frontend/translations/en.json +++ b/surfsense_local/frontend/translations/en.json @@ -10,7 +10,7 @@ "about_license_title": "License", "about_links_title": "Links", "about_release_notes_link": "Release notes", - "about_report_issue_link": "Report an issue", + "about_report_issue_button": "Report an issue", "about_settings_body": "See which version you have, get updates, and find help.", "about_settings_title": "About", "about_system_info_copied_button": "Copied", diff --git a/surfsense_local/frontend/translations/es.json b/surfsense_local/frontend/translations/es.json index 88b70929b1..96488a15a3 100644 --- a/surfsense_local/frontend/translations/es.json +++ b/surfsense_local/frontend/translations/es.json @@ -10,7 +10,7 @@ "about_license_title": "Licencia", "about_links_title": "Enlaces", "about_release_notes_link": "Notas de la versión", - "about_report_issue_link": "Informar de un problema", + "about_report_issue_button": "Informar de un problema", "about_settings_body": "Consulta qué versión tienes, obtén actualizaciones y encuentra ayuda.", "about_settings_title": "Acerca de", "about_system_info_copied_button": "Copiado", diff --git a/surfsense_local/frontend/translations/fr.json b/surfsense_local/frontend/translations/fr.json index c25a6b136b..66edece3e7 100644 --- a/surfsense_local/frontend/translations/fr.json +++ b/surfsense_local/frontend/translations/fr.json @@ -10,7 +10,7 @@ "about_license_title": "Licence", "about_links_title": "Liens", "about_release_notes_link": "Notes de version", - "about_report_issue_link": "Signaler un problème", + "about_report_issue_button": "Signaler un problème", "about_settings_body": "Voyez quelle version vous utilisez, obtenez les mises à jour et trouvez de l’aide.", "about_settings_title": "À propos", "about_system_info_copied_button": "Copié", diff --git a/surfsense_local/frontend/translations/hi.json b/surfsense_local/frontend/translations/hi.json index 0679aadccb..6e4f36905b 100644 --- a/surfsense_local/frontend/translations/hi.json +++ b/surfsense_local/frontend/translations/hi.json @@ -10,7 +10,7 @@ "about_license_title": "लाइसेंस", "about_links_title": "लिंक", "about_release_notes_link": "रिलीज़ नोट्स", - "about_report_issue_link": "समस्या रिपोर्ट करें", + "about_report_issue_button": "समस्या रिपोर्ट करें", "about_settings_body": "देखें कि आपके पास कौन-सा वर्शन है, अपडेट पाएं और मदद लें।", "about_settings_title": "जानकारी", "about_system_info_copied_button": "कॉपी हो गया", diff --git a/surfsense_local/frontend/translations/ja.json b/surfsense_local/frontend/translations/ja.json index b096737aed..4634c1cbd4 100644 --- a/surfsense_local/frontend/translations/ja.json +++ b/surfsense_local/frontend/translations/ja.json @@ -10,7 +10,7 @@ "about_license_title": "ライセンス", "about_links_title": "リンク", "about_release_notes_link": "リリースノート", - "about_report_issue_link": "問題を報告", + "about_report_issue_button": "問題を報告", "about_settings_body": "バージョンの確認、アップデートの入手、ヘルプの参照ができます。", "about_settings_title": "このアプリについて", "about_system_info_copied_button": "コピーしました", diff --git a/surfsense_local/frontend/translations/ko.json b/surfsense_local/frontend/translations/ko.json index e7d30a6b52..59fd9df217 100644 --- a/surfsense_local/frontend/translations/ko.json +++ b/surfsense_local/frontend/translations/ko.json @@ -10,7 +10,7 @@ "about_license_title": "라이선스", "about_links_title": "링크", "about_release_notes_link": "릴리스 노트", - "about_report_issue_link": "문제 신고", + "about_report_issue_button": "문제 신고", "about_settings_body": "사용 중인 버전을 확인하고, 업데이트를 받고, 도움말을 찾아보세요.", "about_settings_title": "정보", "about_system_info_copied_button": "복사됨", diff --git a/surfsense_local/frontend/translations/pt-BR.json b/surfsense_local/frontend/translations/pt-BR.json index 7ef3b1e445..665b4b5ca7 100644 --- a/surfsense_local/frontend/translations/pt-BR.json +++ b/surfsense_local/frontend/translations/pt-BR.json @@ -10,7 +10,7 @@ "about_license_title": "Licença", "about_links_title": "Links", "about_release_notes_link": "Notas da versão", - "about_report_issue_link": "Relatar um problema", + "about_report_issue_button": "Relatar um problema", "about_settings_body": "Veja qual versão você tem, receba atualizações e encontre ajuda.", "about_settings_title": "Sobre", "about_system_info_copied_button": "Copiado", diff --git a/surfsense_local/frontend/translations/ru.json b/surfsense_local/frontend/translations/ru.json index f2299aa572..bc4be37671 100644 --- a/surfsense_local/frontend/translations/ru.json +++ b/surfsense_local/frontend/translations/ru.json @@ -10,7 +10,7 @@ "about_license_title": "Лицензия", "about_links_title": "Ссылки", "about_release_notes_link": "Примечания к выпуску", - "about_report_issue_link": "Сообщить о проблеме", + "about_report_issue_button": "Сообщить о проблеме", "about_settings_body": "Узнайте, какая у вас версия, получите обновления и найдите помощь.", "about_settings_title": "О приложении", "about_system_info_copied_button": "Скопировано", diff --git a/surfsense_local/frontend/translations/zh-CN.json b/surfsense_local/frontend/translations/zh-CN.json index ee52d60676..9c48a4b036 100644 --- a/surfsense_local/frontend/translations/zh-CN.json +++ b/surfsense_local/frontend/translations/zh-CN.json @@ -10,7 +10,7 @@ "about_license_title": "许可证", "about_links_title": "链接", "about_release_notes_link": "发行说明", - "about_report_issue_link": "报告问题", + "about_report_issue_button": "报告问题", "about_settings_body": "查看你的版本、获取更新并寻求帮助。", "about_settings_title": "关于", "about_system_info_copied_button": "已复制",