Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/architecture/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<version>`), 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<version>`), 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.

Expand Down
3 changes: 1 addition & 2 deletions docs/architecture/issue-reports.md
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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.
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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<void>>(
async () => undefined
)
window.surfsense = {
...window.surfsense!,
openExternal,
Expand Down Expand Up @@ -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(
<>
<AboutSettings />
<IssueReportDialog />
</>
)

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()
Expand Down
14 changes: 2 additions & 12 deletions surfsense_local/frontend/src/features/about/about-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -104,16 +103,7 @@ export function AboutSettings() {
defaultMessage: "Community on Discord",
})}
</ExternalLink>
{details ? (
<ExternalLink
href={bugReportUrl(`\n\n---\n${systemInfo(details)}`)}
>
{intl.formatMessage({
id: "about_report_issue_link",
defaultMessage: "Report an issue",
})}
</ExternalLink>
) : null}
{details ? <ReportIssueButton /> : null}
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -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 (
<button
type="button"
onClick={() => openIssueReport()}
className="inline-flex w-fit cursor-pointer items-center gap-1.5 text-sm text-muted-foreground underline-offset-3 transition-colors hover:text-foreground hover:underline"
>
{intl.formatMessage({
id: "about_report_issue_button",
defaultMessage: "Report an issue",
})}
</button>
)
}
2 changes: 1 addition & 1 deletion surfsense_local/frontend/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion surfsense_local/frontend/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion surfsense_local/frontend/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion surfsense_local/frontend/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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é",
Expand Down
2 changes: 1 addition & 1 deletion surfsense_local/frontend/translations/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "कॉपी हो गया",
Expand Down
2 changes: 1 addition & 1 deletion surfsense_local/frontend/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "コピーしました",
Expand Down
2 changes: 1 addition & 1 deletion surfsense_local/frontend/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "복사됨",
Expand Down
2 changes: 1 addition & 1 deletion surfsense_local/frontend/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion surfsense_local/frontend/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "Скопировано",
Expand Down
2 changes: 1 addition & 1 deletion surfsense_local/frontend/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "已复制",
Expand Down