From 2bf5e58f88082756954e8ea939350e008c6ecad7 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Thu, 14 Sep 2023 23:34:08 +0200 Subject: [PATCH 01/26] DownloadButton: Fix formatting Windows and Apple It looks off compared to the Linux side that looks cleaner when you download releases on pcsx2.net --- src/components/ReleaseDownloadButton/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 680a585a..9a4bfe31 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -60,6 +60,16 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { } } + // This will append "App" to the release for cleaner looking formatting for the downloads dropdown on pcsx2.net frontpage and downloads page + if (os === "macos") { + displayName = `App - ${displayName}`; + } + + // This will append "Exe" to the release for cleaner looking formatting for the downloads dropdown on pcsx2.net frontpage and downloads page + if (os === "windows") { + displayName = `Exe - ${displayName}`; + } + items.push( Date: Fri, 15 Sep 2023 00:09:38 +0200 Subject: [PATCH 02/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 9a4bfe31..5cca34a2 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -6,6 +6,7 @@ import { IoIosCloudyNight } from "react-icons/io"; import { GiBrickWall } from "react-icons/gi"; import { useMediaQuery } from "../../utils/mediaQuery"; +// Function to get the latest release for a specific platform export function getLatestRelease(releases, platform) { for (const release of releases) { if (platform in release.assets && release.assets[platform].length > 0) { @@ -15,12 +16,14 @@ export function getLatestRelease(releases, platform) { return undefined; } +// Function to convert text to proper case function toProperCase(str) { return str.replace(/\w\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); }); } +// Function to get the OS icon based on the platform function getOSIcon(os, fillColor) { if (os === "windows") { return ; @@ -33,6 +36,7 @@ function getOSIcon(os, fillColor) { } } +// Function to generate dropdown items based on release assets function generateDropdownItems(release, os, assets, textRemovals, isNightly) { if (!assets) { return []; @@ -60,14 +64,17 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { } } - // This will append "App" to the release for cleaner looking formatting for the downloads dropdown on pcsx2.net frontpage and downloads page - if (os === "macos") { - displayName = `App - ${displayName}`; - } - - // This will append "Exe" to the release for cleaner looking formatting for the downloads dropdown on pcsx2.net frontpage and downloads page + // Generate a more dynamic displayName based on asset properties if (os === "windows") { - displayName = `Exe - ${displayName}`; + displayName = `Exe - ${os} - ${displayName}`; + } else if (os === "linux") { + if (asset.additionalTags.includes("appimage")) { + displayName = `AppImage - ${os} - ${displayName}`; + } else if (asset.additionalTags.includes("flatpak")) { + displayName = `Flatpak - ${os} - ${displayName}`; + } + } else if (os === "macos") { + displayName = `App.tar - ${os} - ${displayName}`; } items.push( @@ -84,13 +91,7 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { return items; } -function openAssetLink(href) { - Object.assign(document.createElement("a"), { - rel: "noopener noreferrer", - href: href, - }).click(); -} - +// Component for the Release Download Button export function ReleaseDownloadButton({ release, buttonText, @@ -99,6 +100,7 @@ export function ReleaseDownloadButton({ isNightly, placement, }) { + // Styling for the button const buttonStyling = { minWidth: "200px", }; @@ -107,10 +109,12 @@ export function ReleaseDownloadButton({ buttonStyling.bgColor = "var(--nightly-button-background)"; } + // States to hold dropdown items for each platform const [windowsItems, setWindowsItems] = useState([]); const [linuxItems, setLinuxItems] = useState([]); const [macosItems, setMacosItems] = useState([]); + // Effect to generate dropdown items when the release or other inputs change useEffect(() => { if ("windows" in release) { setWindowsItems( @@ -175,8 +179,9 @@ export function ReleaseDownloadButton({ ) ); } - }, [release]); + }, [release, isNightly]); + // Render the dropdown button and menu return ( - {isNightly ? : } + {isNightly ? : null}   {buttonText} @@ -197,7 +202,7 @@ export function ReleaseDownloadButton({ color={isNightly ? "warning" : "primary"} aria-label="Actions" css={{ $$dropdownMenuWidth: "100%" }} - onAction={(assetUrl) => openAssetLink(assetUrl)} + // Removed onAction handler to avoid extra clickable modifications > Date: Fri, 15 Sep 2023 00:27:41 +0200 Subject: [PATCH 03/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 5cca34a2..77b863ce 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -66,15 +66,15 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { // Generate a more dynamic displayName based on asset properties if (os === "windows") { - displayName = `Exe - ${os} - ${displayName}`; + displayName = `Exe - ${displayName}`; } else if (os === "linux") { if (asset.additionalTags.includes("appimage")) { - displayName = `AppImage - ${os} - ${displayName}`; + displayName = `AppImage - ${displayName}`; } else if (asset.additionalTags.includes("flatpak")) { - displayName = `Flatpak - ${os} - ${displayName}`; + displayName = `Flatpak - ${displayName}`; } } else if (os === "macos") { - displayName = `App.tar - ${os} - ${displayName}`; + displayName = `App - ${displayName}`; } items.push( From 1ca1fc9ec064311fe7b6ebacdc4be26bb1408f07 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 00:54:50 +0200 Subject: [PATCH 04/26] x64 to lowercase --- src/components/ReleaseDownloadButton/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 77b863ce..7685bc76 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -16,10 +16,14 @@ export function getLatestRelease(releases, platform) { return undefined; } -// Function to convert text to proper case +// Function to convert text to proper case, skipping capitalizing "x64" function toProperCase(str) { return str.replace(/\w\S*/g, function (txt) { - return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); + if (txt.toLowerCase() === "x64") { + return txt.toLowerCase(); + } else { + return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); + } }); } @@ -36,7 +40,7 @@ function getOSIcon(os, fillColor) { } } -// Function to generate dropdown items based on release assets + // Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) function generateDropdownItems(release, os, assets, textRemovals, isNightly) { if (!assets) { return []; From ea3b48b580607c15fcf2941a41b1e02633ecda97 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 01:13:36 +0200 Subject: [PATCH 05/26] Fix clicking and removed code --- src/components/ReleaseDownloadButton/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 7685bc76..75061758 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -96,6 +96,13 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { } // Component for the Release Download Button +function openAssetLink(href) { + Object.assign(document.createElement("a"), { + rel: "noopener noreferrer", + href: href, + }).click(); +} + export function ReleaseDownloadButton({ release, buttonText, @@ -198,7 +205,7 @@ export function ReleaseDownloadButton({ css={buttonStyling} bordered={bordered} > - {isNightly ? : null} + {isNightly ? : }   {buttonText} @@ -206,7 +213,7 @@ export function ReleaseDownloadButton({ color={isNightly ? "warning" : "primary"} aria-label="Actions" css={{ $$dropdownMenuWidth: "100%" }} - // Removed onAction handler to avoid extra clickable modifications + onAction={(assetUrl) => openAssetLink(assetUrl)} > Date: Fri, 15 Sep 2023 01:13:50 +0200 Subject: [PATCH 06/26] Fix format --- src/components/ReleaseDownloadButton/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 75061758..0ba94f6c 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -40,7 +40,7 @@ function getOSIcon(os, fillColor) { } } - // Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) +// Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) function generateDropdownItems(release, os, assets, textRemovals, isNightly) { if (!assets) { return []; From e9ca76022e4f64d10730eb139c8d6a3ffee7cee1 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 01:14:42 +0200 Subject: [PATCH 07/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 0ba94f6c..be21c665 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -190,7 +190,7 @@ export function ReleaseDownloadButton({ ) ); } - }, [release, isNightly]); + }, [release]); // Render the dropdown button and menu return ( From 8955f0dc137e7ed7951b77919b880492b1b37a8b Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 01:15:31 +0200 Subject: [PATCH 08/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index be21c665..9a7eeda1 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -40,7 +40,6 @@ function getOSIcon(os, fillColor) { } } -// Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) function generateDropdownItems(release, os, assets, textRemovals, isNightly) { if (!assets) { return []; @@ -68,7 +67,7 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { } } - // Generate a more dynamic displayName based on asset properties +// Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) if (os === "windows") { displayName = `Exe - ${displayName}`; } else if (os === "linux") { From 163ca13a15287af2339d41e4eb9aa598bbd6674e Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 01:21:05 +0200 Subject: [PATCH 09/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 9a7eeda1..d6777e87 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -67,7 +67,7 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { } } -// Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) + // Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) if (os === "windows") { displayName = `Exe - ${displayName}`; } else if (os === "linux") { From df768583412982a0eb47fe79172ed83cee54fe11 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 01:48:16 +0200 Subject: [PATCH 10/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index d6777e87..137f699c 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -69,15 +69,19 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { // Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) if (os === "windows") { - displayName = `Exe - ${displayName}`; + displayName = `Exe - x64 - Qt`; } else if (os === "linux") { - if (asset.additionalTags.includes("appimage")) { - displayName = `AppImage - ${displayName}`; - } else if (asset.additionalTags.includes("flatpak")) { - displayName = `Flatpak - ${displayName}`; + if (asset.additionalTags.includes("flatpak")) { + displayName = `Flatpak - x64 - Qt`; + } else if (asset.additionalTags.includes("appimage")) { + displayName = `AppImage - x64 - Qt`; + } else { + displayName = `Linux - x64 - Qt`; } } else if (os === "macos") { - displayName = `App - ${displayName}`; + displayName = `App - x64 - Qt`; + } else { + displayName = `Unknown - x64 - Qt`; // Fallback for other OS } items.push( From 9df255a7f35f96b31f9a706c5468f9ba5dd60613 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 01:52:54 +0200 Subject: [PATCH 11/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 137f699c..85212517 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -75,8 +75,6 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { displayName = `Flatpak - x64 - Qt`; } else if (asset.additionalTags.includes("appimage")) { displayName = `AppImage - x64 - Qt`; - } else { - displayName = `Linux - x64 - Qt`; } } else if (os === "macos") { displayName = `App - x64 - Qt`; From 32898b3d04c14b4072e8b1c51310bdc50a87c78f Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 02:19:34 +0200 Subject: [PATCH 12/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 85212517..48a6362c 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -69,17 +69,19 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { // Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) if (os === "windows") { - displayName = `Exe - x64 - Qt`; + displayName = `7z Archived Exe - x64 - Qt`; } else if (os === "linux") { if (asset.additionalTags.includes("flatpak")) { displayName = `Flatpak - x64 - Qt`; } else if (asset.additionalTags.includes("appimage")) { displayName = `AppImage - x64 - Qt`; + } else { + displayName = `x64 - Qt`; } } else if (os === "macos") { - displayName = `App - x64 - Qt`; + displayName = `xz Archived App - x64 - Qt`; } else { - displayName = `Unknown - x64 - Qt`; // Fallback for other OS + displayName = `${os.charAt(0).toUpperCase() + os.slice(1)} - x64 - Qt`; } items.push( From 77212b02df8a21592bc64fca8fcb61d6719478e6 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 02:26:36 +0200 Subject: [PATCH 13/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 48a6362c..7bd04d14 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -69,17 +69,15 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { // Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) if (os === "windows") { - displayName = `7z Archived Exe - x64 - Qt`; + displayName = `7z Archived Exe`; } else if (os === "linux") { if (asset.additionalTags.includes("flatpak")) { - displayName = `Flatpak - x64 - Qt`; + displayName = `Flatpak`; } else if (asset.additionalTags.includes("appimage")) { - displayName = `AppImage - x64 - Qt`; - } else { - displayName = `x64 - Qt`; + displayName = `AppImage`; } } else if (os === "macos") { - displayName = `xz Archived App - x64 - Qt`; + displayName = `xz Archived App`; } else { displayName = `${os.charAt(0).toUpperCase() + os.slice(1)} - x64 - Qt`; } From a2249640d31a8bef9501010b0195a1c9fac1bf76 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 02:38:31 +0200 Subject: [PATCH 14/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 7bd04d14..6c5523f5 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -69,7 +69,7 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { // Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) if (os === "windows") { - displayName = `7z Archived Exe`; + displayName = `7z Archive`; } else if (os === "linux") { if (asset.additionalTags.includes("flatpak")) { displayName = `Flatpak`; @@ -77,7 +77,7 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { displayName = `AppImage`; } } else if (os === "macos") { - displayName = `xz Archived App`; + displayName = `tar.xz Archive`; } else { displayName = `${os.charAt(0).toUpperCase() + os.slice(1)} - x64 - Qt`; } From 16bec0101e165c1faa8742f75e0f43e83e96d2f1 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 02:54:28 +0200 Subject: [PATCH 15/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 6c5523f5..bd93503f 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -67,9 +67,9 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { } } - // Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) + // Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) as a fallback if (os === "windows") { - displayName = `7z Archive`; + displayName = `Archive`; } else if (os === "linux") { if (asset.additionalTags.includes("flatpak")) { displayName = `Flatpak`; @@ -77,9 +77,9 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { displayName = `AppImage`; } } else if (os === "macos") { - displayName = `tar.xz Archive`; + displayName = `Archive`; } else { - displayName = `${os.charAt(0).toUpperCase() + os.slice(1)} - x64 - Qt`; + displayName = `${displayName}`; // Keep the original display name } items.push( From 687eb7983e597958e0399d663f5115a261e536f0 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 03:00:00 +0200 Subject: [PATCH 16/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index bd93503f..6ab7d587 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -78,8 +78,6 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { } } else if (os === "macos") { displayName = `Archive`; - } else { - displayName = `${displayName}`; // Keep the original display name } items.push( From 5729e5c12ab4c72272f034440a1e35b7c5c2d15d Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 03:16:53 +0200 Subject: [PATCH 17/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 6ab7d587..50701d04 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -69,7 +69,7 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { // Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) as a fallback if (os === "windows") { - displayName = `Archive`; + displayName = `Download`; } else if (os === "linux") { if (asset.additionalTags.includes("flatpak")) { displayName = `Flatpak`; @@ -77,7 +77,7 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { displayName = `AppImage`; } } else if (os === "macos") { - displayName = `Archive`; + displayName = `Download`; } items.push( From 21226268581c53423fb42a28dd13059345dbbedd Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 03:30:30 +0200 Subject: [PATCH 18/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 50701d04..7a1edb94 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -67,17 +67,18 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { } } - // Generate a more dynamic displayName based on asset properties, following the format of package type - Bits(64) - GUI Widget (Qt) as a fallback + // Generate a more dynamic displayName based on asset properties, old way was following the format of package type - Bits(64) - GUI Widget (Qt) if (os === "windows") { - displayName = `Download`; + displayName = "Download"; } else if (os === "linux") { + // Check for Flatpak or AppImage tags if (asset.additionalTags.includes("flatpak")) { - displayName = `Flatpak`; + displayName = "Flatpak"; } else if (asset.additionalTags.includes("appimage")) { - displayName = `AppImage`; + displayName = "AppImage"; } } else if (os === "macos") { - displayName = `Download`; + displayName = "Download"; } items.push( From cfe783c02dfd074f197dad2d4efa6ee40986e0ea Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 03:54:30 +0200 Subject: [PATCH 19/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 7a1edb94..3472e158 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -72,14 +72,21 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { displayName = "Download"; } else if (os === "linux") { // Check for Flatpak or AppImage tags - if (asset.additionalTags.includes("flatpak")) { - displayName = "Flatpak"; - } else if (asset.additionalTags.includes("appimage")) { + if (asset.additionalTags.includes("appimage")) { displayName = "AppImage"; + } else if (asset.additionalTags.includes("flatpak")) { + displayName = "Flatpak"; + } else { + displayName = "Linux"; // Default to "Linux" if no recognized tags } } else if (os === "macos") { displayName = "Download"; } + + // Strip the "- x64 Qt" for Linux + if (os === "linux") { + displayName = displayName.replace(/- x64 Qt$/, ""); + } items.push( Date: Fri, 15 Sep 2023 03:56:02 +0200 Subject: [PATCH 20/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 3472e158..f4784d2d 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -82,7 +82,7 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { } else if (os === "macos") { displayName = "Download"; } - + // Strip the "- x64 Qt" for Linux if (os === "linux") { displayName = displayName.replace(/- x64 Qt$/, ""); From 68980142fb151f82887e73ac300b26b343338be0 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 04:04:02 +0200 Subject: [PATCH 21/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index f4784d2d..2980b985 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -76,8 +76,6 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { displayName = "AppImage"; } else if (asset.additionalTags.includes("flatpak")) { displayName = "Flatpak"; - } else { - displayName = "Linux"; // Default to "Linux" if no recognized tags } } else if (os === "macos") { displayName = "Download"; From 04520410f14eaa04407b8ef562c9a2f5805dec89 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 04:15:01 +0200 Subject: [PATCH 22/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 2980b985..1306a6cc 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -71,9 +71,10 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { if (os === "windows") { displayName = "Download"; } else if (os === "linux") { - // Check for Flatpak or AppImage tags + // Check for Flatpak or AppImage tags which will make Appimage - x64 Qt and Flatpak - x64 Qt and no way to seemingly fix the regular way if (asset.additionalTags.includes("appimage")) { - displayName = "AppImage"; + displayName = + "App" + displayName.charAt(3).toUpperCase() + displayName.slice(4); // Convert "Appimage" to "AppImage" because tags failing to uppercase it } else if (asset.additionalTags.includes("flatpak")) { displayName = "Flatpak"; } @@ -81,7 +82,7 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { displayName = "Download"; } - // Strip the "- x64 Qt" for Linux + // Strip the "- x64 Qt" for Linux because it's being annoying with the tags and who cares about how good the code looks for now it's a bit of jank. if (os === "linux") { displayName = displayName.replace(/- x64 Qt$/, ""); } From 4694191dadf3456fd91c7fbce407c555185b3987 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 04:27:20 +0200 Subject: [PATCH 23/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 1306a6cc..a86c4e7d 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -73,8 +73,7 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { } else if (os === "linux") { // Check for Flatpak or AppImage tags which will make Appimage - x64 Qt and Flatpak - x64 Qt and no way to seemingly fix the regular way if (asset.additionalTags.includes("appimage")) { - displayName = - "App" + displayName.charAt(3).toUpperCase() + displayName.slice(4); // Convert "Appimage" to "AppImage" because tags failing to uppercase it + displayName = "App" + displayName.charAt(3).toUpperCase() + displayName.slice(4); // Convert "Appimage" to "AppImage" because tags failing to uppercase it } else if (asset.additionalTags.includes("flatpak")) { displayName = "Flatpak"; } From e28ae997b939967a52318fd1b9a4630ffa782406 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 04:41:31 +0200 Subject: [PATCH 24/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index a86c4e7d..4f2838b2 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -71,9 +71,13 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { if (os === "windows") { displayName = "Download"; } else if (os === "linux") { - // Check for Flatpak or AppImage tags which will make Appimage - x64 Qt and Flatpak - x64 Qt and no way to seemingly fix the regular way + // Check for Flatpak or AppImage tags if (asset.additionalTags.includes("appimage")) { - displayName = "App" + displayName.charAt(3).toUpperCase() + displayName.slice(4); // Convert "Appimage" to "AppImage" because tags failing to uppercase it + // Appimage gets shown instead due to problems with the tags, so strip it and append it + displayName = + "App" + displayName.charAt(3).toUpperCase() + displayName.slice(4); // Convert "Appimage" to "AppImage" + displayName = displayName.replace("image", ""); // Strip "image" + displayName = displayName + "Image"; // Append "Image" } else if (asset.additionalTags.includes("flatpak")) { displayName = "Flatpak"; } From b325bcbf6f310d937560d9d8a5746d20c1963596 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 04:50:00 +0200 Subject: [PATCH 25/26] Revert "Update index.js" This reverts commit e28ae997b939967a52318fd1b9a4630ffa782406. --- src/components/ReleaseDownloadButton/index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index 4f2838b2..a86c4e7d 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -71,13 +71,9 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { if (os === "windows") { displayName = "Download"; } else if (os === "linux") { - // Check for Flatpak or AppImage tags + // Check for Flatpak or AppImage tags which will make Appimage - x64 Qt and Flatpak - x64 Qt and no way to seemingly fix the regular way if (asset.additionalTags.includes("appimage")) { - // Appimage gets shown instead due to problems with the tags, so strip it and append it - displayName = - "App" + displayName.charAt(3).toUpperCase() + displayName.slice(4); // Convert "Appimage" to "AppImage" - displayName = displayName.replace("image", ""); // Strip "image" - displayName = displayName + "Image"; // Append "Image" + displayName = "App" + displayName.charAt(3).toUpperCase() + displayName.slice(4); // Convert "Appimage" to "AppImage" because tags failing to uppercase it } else if (asset.additionalTags.includes("flatpak")) { displayName = "Flatpak"; } From 076d15dabc31493c4730d9e413521520e77e1414 Mon Sep 17 00:00:00 2001 From: RedDevilus Date: Fri, 15 Sep 2023 04:59:24 +0200 Subject: [PATCH 26/26] Update index.js --- src/components/ReleaseDownloadButton/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/ReleaseDownloadButton/index.js b/src/components/ReleaseDownloadButton/index.js index a86c4e7d..b9025547 100644 --- a/src/components/ReleaseDownloadButton/index.js +++ b/src/components/ReleaseDownloadButton/index.js @@ -73,7 +73,7 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { } else if (os === "linux") { // Check for Flatpak or AppImage tags which will make Appimage - x64 Qt and Flatpak - x64 Qt and no way to seemingly fix the regular way if (asset.additionalTags.includes("appimage")) { - displayName = "App" + displayName.charAt(3).toUpperCase() + displayName.slice(4); // Convert "Appimage" to "AppImage" because tags failing to uppercase it + displayName = "AppImage"; } else if (asset.additionalTags.includes("flatpak")) { displayName = "Flatpak"; } @@ -82,8 +82,11 @@ function generateDropdownItems(release, os, assets, textRemovals, isNightly) { } // Strip the "- x64 Qt" for Linux because it's being annoying with the tags and who cares about how good the code looks for now it's a bit of jank. + // Replace "Appimage" with "AppImage" as the tags don't seem to work properly, so just replace the whole thing if (os === "linux") { - displayName = displayName.replace(/- x64 Qt$/, ""); + displayName = displayName + .replace(/- x64 Qt$/, "") + .replace("Appimage", "AppImage"); } items.push(