From 703bd7de093351a7280303e7d80f10341b47ee24 Mon Sep 17 00:00:00 2001 From: Rob B Date: Sun, 1 Sep 2024 16:47:22 -0400 Subject: [PATCH 01/12] Log when saving debug fails due to empty reported filename --- backend/app/debug_info.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/app/debug_info.go b/backend/app/debug_info.go index bef87e94..fb5a8cfa 100644 --- a/backend/app/debug_info.go +++ b/backend/app/debug_info.go @@ -220,6 +220,7 @@ func (a *app) GenerateDebugInfo() bool { return false } if filename == "" { + slog.Error("failed to save, filename was empty, the user might have cancelled the dialog") return false } From 88b904a7b19834443f0b9b1e0782ceba193ea794 Mon Sep 17 00:00:00 2001 From: Rob B Date: Sun, 1 Sep 2024 17:05:23 -0400 Subject: [PATCH 02/12] Require the user to generate debug before opening the discord. Catch situations where generating debug logs fails. --- .../lib/components/modals/ErrorModal.svelte | 73 +++++++++++++++---- 1 file changed, 57 insertions(+), 16 deletions(-) diff --git a/frontend/src/lib/components/modals/ErrorModal.svelte b/frontend/src/lib/components/modals/ErrorModal.svelte index c0776f19..9e95d0f7 100644 --- a/frontend/src/lib/components/modals/ErrorModal.svelte +++ b/frontend/src/lib/components/modals/ErrorModal.svelte @@ -1,13 +1,45 @@ -
+
@@ -16,25 +48,34 @@
-
+
+
+
+
From 9dacc1a20dbc7f7d1ae74e67ecbaea3d9542696c Mon Sep 17 00:00:00 2001 From: Rob B Date: Sun, 1 Sep 2024 17:05:32 -0400 Subject: [PATCH 03/12] Switch to new https://discord.ficsit.app/ link --- frontend/src/App.svelte | 2 +- frontend/src/lib/components/left-bar/LeftBar.svelte | 2 +- frontend/src/lib/components/modals/ErrorModal.svelte | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index a4879080..cfafe788 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -249,7 +249,7 @@ keyName="error.help" parts={[ translationElementPart('a', { - href: 'https://discord.gg/xkVJ73E', + href: 'https://discord.ficsit.app/', class: 'text-primary-600 underline', }), ]} diff --git a/frontend/src/lib/components/left-bar/LeftBar.svelte b/frontend/src/lib/components/left-bar/LeftBar.svelte index fd15d804..c46efd46 100644 --- a/frontend/src/lib/components/left-bar/LeftBar.svelte +++ b/frontend/src/lib/components/left-bar/LeftBar.svelte @@ -378,7 +378,7 @@ -
+
diff --git a/frontend/src/lib/components/modals/ErrorDetails.svelte b/frontend/src/lib/components/modals/ErrorDetails.svelte new file mode 100644 index 00000000..339c417c --- /dev/null +++ b/frontend/src/lib/components/modals/ErrorDetails.svelte @@ -0,0 +1,87 @@ + + + +
+ + +
+
+

{error}

+
+
+

+ +

+
+
+

+ + +

+
+{#if !fullPageMode} +
+ +
+{/if} diff --git a/frontend/src/lib/components/modals/ErrorModal.svelte b/frontend/src/lib/components/modals/ErrorModal.svelte index 42bf1fe7..78d10df5 100644 --- a/frontend/src/lib/components/modals/ErrorModal.svelte +++ b/frontend/src/lib/components/modals/ErrorModal.svelte @@ -1,38 +1,9 @@ @@ -40,43 +11,7 @@ style="max-height: calc(100vh - 3rem); max-width: calc(100vw - 3rem);" class="w-[48rem] card flex flex-col gap-6" > -
- -
-
-

{error}

-
-
- -
-
- - -
-
- -
+ + + From f85a4005ff7e1507ce7c1c34c94c2a2efa4d7ff4 Mon Sep 17 00:00:00 2001 From: Rob B Date: Sun, 1 Sep 2024 18:28:42 -0400 Subject: [PATCH 05/12] Fix typo --- frontend/src/lib/components/mods-list/ModsListItem.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/lib/components/mods-list/ModsListItem.svelte b/frontend/src/lib/components/mods-list/ModsListItem.svelte index 7a385ca5..b81b5efb 100644 --- a/frontend/src/lib/components/mods-list/ModsListItem.svelte +++ b/frontend/src/lib/components/mods-list/ModsListItem.svelte @@ -74,7 +74,7 @@ return { icon: mdiLinkLock, iconHover: mdiLinkLock, - tooltip: $t('mod-list-item.dependency', 'This mod is installed a dependency of another mod. It cannot be installed or removed on its own.'), + tooltip: $t('mod-list-item.dependency', 'This mod is installed as a dependency of another mod. It cannot be installed or removed on its own.'), }; } if (queuedInstall) { From df105dccce221143a8e9aa7e06efd07a70364ad9 Mon Sep 17 00:00:00 2001 From: Rob B Date: Sun, 1 Sep 2024 20:15:44 -0400 Subject: [PATCH 06/12] Run frontend formatter (seems this isn't run automatically?) --- README.md | 6 +++++ frontend/src/App.svelte | 15 +++++------ .../lib/components/modals/ErrorDetails.svelte | 25 ++++++++++--------- .../lib/components/modals/ErrorModal.svelte | 5 ++-- 4 files changed, 30 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 255ba486..74b48d7b 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,12 @@ Then, to run it, use: golangci-lint run --fix ``` +You may also need to manually run the frontend linter. First, navigate to the `frontend` directory, then run: + +```bash +pnpm run format +``` + ### Localization If you'd like to help translate and localize SMM to different languages, join our [discord server](https://discord.ficsit.app/). diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index 17d64bdc..a437ff99 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -10,6 +10,7 @@ import TitleBar from '$lib/components/TitleBar.svelte'; import LeftBar from '$lib/components/left-bar/LeftBar.svelte'; import ModDetails from '$lib/components/mod-details/ModDetails.svelte'; + import ErrorDetails from '$lib/components/modals/ErrorDetails.svelte'; import ErrorModal from '$lib/components/modals/ErrorModal.svelte'; import ExternalInstallMod from '$lib/components/modals/ExternalInstallMod.svelte'; import { supportedProgressTypes } from '$lib/components/modals/ProgressModal.svelte'; @@ -26,7 +27,6 @@ import { smmUpdate, smmUpdateReady } from '$lib/store/smmUpdateStore'; import { ExpandMod, UnexpandMod } from '$wailsjs/go/app/app'; import { Environment, EventsOn } from '$wailsjs/runtime'; - import ErrorDetails from '$lib/components/modals/ErrorDetails.svelte'; initializeStores(); initializeModalStore(); @@ -237,16 +237,17 @@ }}>
{}}} + error={''} fullPageMode={true} + parent={{ onClose: () => {} }} > - + />
diff --git a/frontend/src/lib/components/modals/ErrorDetails.svelte b/frontend/src/lib/components/modals/ErrorDetails.svelte index 339c417c..f24736fc 100644 --- a/frontend/src/lib/components/modals/ErrorDetails.svelte +++ b/frontend/src/lib/components/modals/ErrorDetails.svelte @@ -1,20 +1,21 @@ @@ -47,7 +48,7 @@

{error}

-

+

+ + {openDiscordTooltipText} +

+{#if debugFileGenerationError} +
+

+ +

+
+
+ +
+{/if} {#if !fullPageMode}
-
diff --git a/frontend/src/lib/components/modals/ErrorModal.svelte b/frontend/src/lib/components/modals/ErrorModal.svelte index 44b51128..bf5888c5 100644 --- a/frontend/src/lib/components/modals/ErrorModal.svelte +++ b/frontend/src/lib/components/modals/ErrorModal.svelte @@ -12,7 +12,7 @@ style="max-height: calc(100vh - 3rem); max-width: calc(100vw - 3rem);" class="w-[48rem] card flex flex-col gap-6" > - + From b484885d8d0886db165017c3d26bd39108eaa9c2 Mon Sep 17 00:00:00 2001 From: Rob B Date: Tue, 3 Sep 2024 15:59:34 -0400 Subject: [PATCH 11/12] Left align buttons in modal mode, center in fullpageh --- frontend/src/lib/components/modals/ErrorDetails.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/modals/ErrorDetails.svelte b/frontend/src/lib/components/modals/ErrorDetails.svelte index f5d9facc..c76097d7 100644 --- a/frontend/src/lib/components/modals/ErrorDetails.svelte +++ b/frontend/src/lib/components/modals/ErrorDetails.svelte @@ -72,7 +72,7 @@

-

+

{#if debugFileGenerationError} -
+

-
+