From 74ad0cd34aad65c28d6cb0aa4915c11df2fa979d Mon Sep 17 00:00:00 2001 From: Keyrxng <106303466+Keyrxng@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:16:22 +0000 Subject: [PATCH] chore: redirect to plugin select after push --- static/manifest-gui.css | 2 ++ static/scripts/rendering/navigation.ts | 2 +- static/scripts/rendering/write-add-remove.ts | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/static/manifest-gui.css b/static/manifest-gui.css index 02a89b1..b6cc57c 100644 --- a/static/manifest-gui.css +++ b/static/manifest-gui.css @@ -90,6 +90,8 @@ header #uos-logo path { max-height: calc(100vh - 192px); scrollbar-width: thin; scrollbar-color: #303030 #101010; + opacity: 1; + transition: opacity 0.5s ease; } .readme-container p { diff --git a/static/scripts/rendering/navigation.ts b/static/scripts/rendering/navigation.ts index d57b96a..609745e 100644 --- a/static/scripts/rendering/navigation.ts +++ b/static/scripts/rendering/navigation.ts @@ -15,7 +15,7 @@ export function createBackButton(renderer: ManifestRenderer): HTMLButtonElement return backButton; } -function handleBackButtonClick(renderer: ManifestRenderer): void { +export function handleBackButtonClick(renderer: ManifestRenderer): void { renderer.manifestGui?.classList.remove("plugin-editor"); const readmeContainer = document.querySelector(".readme-container"); if (readmeContainer) { diff --git a/static/scripts/rendering/write-add-remove.ts b/static/scripts/rendering/write-add-remove.ts index f069d30..3f40c12 100644 --- a/static/scripts/rendering/write-add-remove.ts +++ b/static/scripts/rendering/write-add-remove.ts @@ -5,6 +5,8 @@ import { parseConfigInputs } from "./input-parsing"; import { getOfficialPluginConfig } from "../../utils/storage"; import { renderConfigEditor } from "./config-editor"; import { normalizePluginName } from "./utils"; +import { renderPluginSelector } from "./plugin-select"; +import { handleBackButtonClick } from "./navigation"; /** * Writes the new configuration to the config file. This does not push the config to GitHub @@ -122,6 +124,22 @@ async function notificationConfigPush(renderer: ManifestRenderer) { type: "success", shouldAutoDismiss: true, }); + + const container = document.querySelector("#manifest-gui") as HTMLElement | null; + const readmeContainer = document.querySelector(".readme-container") as HTMLElement | null; + if (container && readmeContainer) { + container.style.transition = 'opacity 0.5s ease'; + container.style.opacity = '0'; + readmeContainer.style.transition = 'opacity 0.5s ease'; + readmeContainer.style.opacity = '0'; + setTimeout(() => { + handleBackButtonClick(renderer); + container.style.opacity = '1'; + }, 500); + + } else { + handleBackButtonClick(renderer); + } } export function handleResetToDefault(renderer: ManifestRenderer, pluginManifest: Manifest | null) {