diff --git a/dapp/src/components/ProjectInfo.astro b/dapp/src/components/ProjectInfo.astro index eb7e3e9..a2c66ab 100644 --- a/dapp/src/components/ProjectInfo.astro +++ b/dapp/src/components/ProjectInfo.astro @@ -52,6 +52,12 @@ import ModalInput from "./utils/ModalInput.astro"; View Project Info +
+ + + + Jump to Latest Verified Commit +
@@ -311,6 +317,7 @@ import ModalInput from "./utils/ModalInput.astro"; } const viewCommitHistory = document.getElementById("view-commit-history"); + const jumpToLatestCommit = document.getElementById("jump-to-latest-commit"); const viewCommitText = document.getElementById("view-commit-text"); const commitHistoryContainer = document.getElementById("commit-history-container"); const commitIconUp = document.getElementById("commit-icon-up"); @@ -344,6 +351,19 @@ import ModalInput from "./utils/ModalInput.astro"; }); } + if (jumpToLatestCommit && commitHistoryContainer) { + jumpToLatestCommit.addEventListener("click", () => { + if (commitHistoryContainer.style.maxHeight !== "0px") { + setTimeout(() => { + const latestCommit = document.getElementById('latest-commit-record'); + if (latestCommit) { + latestCommit.scrollIntoView({ behavior: 'smooth', block: 'center' }); + } + }, 1000); + } + }) + } + window.addEventListener('walletConnected', (_event: Event) => { updateUpgradeConfigButtonVisibility(); });