diff --git a/starpilot/system/the_galaxy/assets/mobile/js/views/SystemTools.js b/starpilot/system/the_galaxy/assets/mobile/js/views/SystemTools.js index 83d33dc3a2..ee0e732b79 100644 --- a/starpilot/system/the_galaxy/assets/mobile/js/views/SystemTools.js +++ b/starpilot/system/the_galaxy/assets/mobile/js/views/SystemTools.js @@ -37,6 +37,29 @@ function githubCommitUrl(remote, commitsUrl, commit) { return base ? `${base}/commit/${sha}` : "" } +function githubCommitsUrl(remote, commitsUrl, branch) { + const suppliedUrl = String(commitsUrl || "").trim() + if (suppliedUrl) { + try { + const parsed = new URL(suppliedUrl) + if (parsed.protocol === "https:" && parsed.hostname === "github.com" && parsed.pathname.includes("/commits/")) { + return parsed.href + } + } catch (e) { + } + } + + const base = githubRemoteUrl(remote, commitsUrl) + const normalizedBranch = String(branch || "").trim() + if (!base || !normalizedBranch) return "" + try { + if (new URL(base).hostname !== "github.com") return "" + } catch (e) { + return "" + } + return `${base}/commits/${encodeURIComponent(normalizedBranch)}/` +} + const CORE_UPDATE_BRANCHES = ["StarPilot", "Dom"] const REBOOT_PENDING_STORAGE_KEY = "galaxy-update-reboot-pending" const LOCAL_DEVICE_SCOPE = "local" @@ -176,6 +199,7 @@ export const SystemTools = { }, updateAvailable() { return this.checkedForUpdates && !!this.fastStatus?.updateAvailable && !this.updateInProgress }, remoteCommitUrl() { return githubCommitUrl(this.fastStatus?.originRemote, this.fastStatus?.commitsUrl, this.fastStatus?.remoteCommit) }, + recentCommitsUrl() { return githubCommitsUrl(this.fastStatus?.originRemote, this.fastStatus?.commitsUrl, this.fastStatus?.branch || this.currentBranch) }, factoryResetStatus() { const s = this.fastStatus if (!s || String(s?.lastMode || "").trim() !== "factory-reset") return null @@ -642,6 +666,7 @@ export const SystemTools = {