From 7ec039d1b27e3a1c2ed55e3a57a7210fa97ac02a Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Sun, 28 Jun 2026 16:47:43 -0400 Subject: [PATCH 01/11] if app has requireFw, only upload if fw is greater than it --- js/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/index.js b/js/index.js index 42a3ff0..5bc602c 100644 --- a/js/index.js +++ b/js/index.js @@ -1045,6 +1045,12 @@ function uploadApp(app, options) { } return startOperation({name:"App Upload"}, () => getInstalledApps().then(()=>{ + if (app.requiredFw!==undefined){ + if(device.version < app.requiredFw) { + showToast(`App "${app.name}" requires firmware version ${app.requiredFw} or higher. You have version ${device.version}. To install this app, please update your firmware.`,"warning"); + return; + } + } if (device.appsInstalled.some(i => i.id === app.id)) { return updateApp(app, {noNewOperation:true /*in 'App Upload'*/}); } From f1a211f3a4902b44f510e9acf87dce6919def3e4 Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Sun, 28 Jun 2026 22:12:42 -0400 Subject: [PATCH 02/11] Add report issue button for each app in app info --- js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/index.js b/js/index.js index 5bc602c..37ae31c 100644 --- a/js/index.js +++ b/js/index.js @@ -330,7 +330,7 @@ function showAppInfo(appid, installedVersion) { const infoPart = infoTxt.length>0 ? marked(infoTxt.join("
")) : ""; const changelogPart = changelogText ? changelogText.replace(/\n/g, "
") : ""; const changeLogHeading = changelogPart ? "
ChangeLog:
" : ""; - showPrompt(app.name + " App Information", infoPart + changeLogHeading + changelogPart, {ok: true,}, false).catch(() => {}); + showPrompt(app.name + " App Information", infoPart + changeLogHeading + changelogPart, {ok: true,githubIssue:app}, false).catch(() => {}); }); } function getAppDescription(app) { From 684c8c0a8815ca3ce3211b4c1338d70635454e0c Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Sun, 28 Jun 2026 22:13:31 -0400 Subject: [PATCH 03/11] Add button to handle reporting issue in showPrompt --- js/ui.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/js/ui.js b/js/ui.js index e3c1e5e..5bcad41 100644 --- a/js/ui.js +++ b/js/ui.js @@ -115,11 +115,20 @@ function showPrompt(title, text, buttons, shouldEscapeHtml) { ${buttons.yes?'':''} ${buttons.no?'':''} ${buttons.ok?'':''} + ${buttons.githubIssue?``:''} ${buttons.footer?`${buttons.footer}`:""} `:``} `); + + if (buttons.githubIssue) { + const issueBtn = modal.querySelector("#githubIssue"); + if (issueBtn) { + issueBtn.app = buttons.githubIssue; + } + } + document.body.append(modal); modal.querySelector("a[href='#close']").addEventListener("click",event => { event.preventDefault(); @@ -131,9 +140,14 @@ function showPrompt(title, text, buttons, shouldEscapeHtml) { event.preventDefault(); let isYes = event.target.getAttribute("isyes")=="1"; if (isYes) resolve(); + else if (event.target.app) { + console.log("User data:",event.target.app); + window.open(`https://github.com/espruino/BangleApps/issues/new?template=bangle-bug-report-custom-form.yaml&title=[${event.target.app.name.replace(" ", "%20")}] Describe%20the%20issue...`, '_blank'); + + } else reject("User cancelled"); modal.remove(); - }); + }) }); }); } From 084dc9218c4f4777c04a9ae28aed2723c4eb9063 Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Mon, 29 Jun 2026 23:29:13 -0400 Subject: [PATCH 04/11] Use versionLess, and resolve url for issue in index.js --- js/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/index.js b/js/index.js index 37ae31c..bc1a4a9 100644 --- a/js/index.js +++ b/js/index.js @@ -330,7 +330,15 @@ function showAppInfo(appid, installedVersion) { const infoPart = infoTxt.length>0 ? marked(infoTxt.join("
")) : ""; const changelogPart = changelogText ? changelogText.replace(/\n/g, "
") : ""; const changeLogHeading = changelogPart ? "
ChangeLog:
" : ""; - showPrompt(app.name + " App Information", infoPart + changeLogHeading + changelogPart, {ok: true,githubIssue:app}, false).catch(() => {}); + showPrompt(app.name + " App Information", infoPart + changeLogHeading + changelogPart, {ok: true,githubIssue:app}, false).catch(() => {}).then((c)=>{ + if(c="githubIssue"){ + const encodedTitle = encodeURIComponent(`[${app.name}] Describe the issue...`); + const encodedReportText = encodeURIComponent(`Tagging @${app.author} as the app author.\n\n`); + window.open(`https://github.com/espruino/BangleApps/issues/new?template=bangle-bug-report-custom-form.yaml&title=${encodedTitle}&fwversion=${device.version?device.version:""}`,'_blank'); + } + } + + ); }); } function getAppDescription(app) { @@ -1046,7 +1054,7 @@ function uploadApp(app, options) { return startOperation({name:"App Upload"}, () => getInstalledApps().then(()=>{ if (app.requiredFw!==undefined){ - if(device.version < app.requiredFw) { + if(Utils.versionLess(app.requiredFw,device.version)) { showToast(`App "${app.name}" requires firmware version ${app.requiredFw} or higher. You have version ${device.version}. To install this app, please update your firmware.`,"warning"); return; } From f7458cb02a649c2b3ecc51d8a41d93d7f5551e57 Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Mon, 29 Jun 2026 23:29:51 -0400 Subject: [PATCH 05/11] remove url logic from ui.js --- js/ui.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/js/ui.js b/js/ui.js index 5bcad41..ff5082e 100644 --- a/js/ui.js +++ b/js/ui.js @@ -121,14 +121,6 @@ function showPrompt(title, text, buttons, shouldEscapeHtml) { `:``} `); - - if (buttons.githubIssue) { - const issueBtn = modal.querySelector("#githubIssue"); - if (issueBtn) { - issueBtn.app = buttons.githubIssue; - } - } - document.body.append(modal); modal.querySelector("a[href='#close']").addEventListener("click",event => { event.preventDefault(); @@ -140,11 +132,6 @@ function showPrompt(title, text, buttons, shouldEscapeHtml) { event.preventDefault(); let isYes = event.target.getAttribute("isyes")=="1"; if (isYes) resolve(); - else if (event.target.app) { - console.log("User data:",event.target.app); - window.open(`https://github.com/espruino/BangleApps/issues/new?template=bangle-bug-report-custom-form.yaml&title=[${event.target.app.name.replace(" ", "%20")}] Describe%20the%20issue...`, '_blank'); - - } else reject("User cancelled"); modal.remove(); }) From 1399c879aae73e2a16d372d260c00fa20b570fdd Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Mon, 29 Jun 2026 23:31:52 -0400 Subject: [PATCH 06/11] fix conditional error --- js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/index.js b/js/index.js index bc1a4a9..39e7d37 100644 --- a/js/index.js +++ b/js/index.js @@ -331,7 +331,7 @@ function showAppInfo(appid, installedVersion) { const changelogPart = changelogText ? changelogText.replace(/\n/g, "
") : ""; const changeLogHeading = changelogPart ? "
ChangeLog:
" : ""; showPrompt(app.name + " App Information", infoPart + changeLogHeading + changelogPart, {ok: true,githubIssue:app}, false).catch(() => {}).then((c)=>{ - if(c="githubIssue"){ + if(c=="githubIssue"){ const encodedTitle = encodeURIComponent(`[${app.name}] Describe the issue...`); const encodedReportText = encodeURIComponent(`Tagging @${app.author} as the app author.\n\n`); window.open(`https://github.com/espruino/BangleApps/issues/new?template=bangle-bug-report-custom-form.yaml&title=${encodedTitle}&fwversion=${device.version?device.version:""}`,'_blank'); From f7c97013beea0df897364790079617c28b278198 Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Mon, 29 Jun 2026 23:32:15 -0400 Subject: [PATCH 07/11] resolve githubIssue so index.js can handle it --- js/ui.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/ui.js b/js/ui.js index ff5082e..76d0499 100644 --- a/js/ui.js +++ b/js/ui.js @@ -132,6 +132,7 @@ function showPrompt(title, text, buttons, shouldEscapeHtml) { event.preventDefault(); let isYes = event.target.getAttribute("isyes")=="1"; if (isYes) resolve(); + else if (event.target.id=="githubIssue") resolve("githubIssue"); else reject("User cancelled"); modal.remove(); }) From 5d548e718e3c1fcf0948a0e52308cbe03c551005 Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Mon, 29 Jun 2026 23:32:53 -0400 Subject: [PATCH 08/11] Fix syntax error in promise resolution --- js/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui.js b/js/ui.js index 76d0499..b941e8c 100644 --- a/js/ui.js +++ b/js/ui.js @@ -135,7 +135,7 @@ function showPrompt(title, text, buttons, shouldEscapeHtml) { else if (event.target.id=="githubIssue") resolve("githubIssue"); else reject("User cancelled"); modal.remove(); - }) + }); }); }); } From 5bc2582214d168ec0520128728a0e9a59347220b Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Mon, 29 Jun 2026 23:33:31 -0400 Subject: [PATCH 09/11] Fix firmware version comparison logic --- js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/index.js b/js/index.js index 39e7d37..f9bb9e2 100644 --- a/js/index.js +++ b/js/index.js @@ -1054,7 +1054,7 @@ function uploadApp(app, options) { return startOperation({name:"App Upload"}, () => getInstalledApps().then(()=>{ if (app.requiredFw!==undefined){ - if(Utils.versionLess(app.requiredFw,device.version)) { + if(Utils.versionLess(device.version,app.requiredFw)) { showToast(`App "${app.name}" requires firmware version ${app.requiredFw} or higher. You have version ${device.version}. To install this app, please update your firmware.`,"warning"); return; } From 9e5005181cf7a0d8cb41c4a66b603e9e8c5532a7 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Tue, 30 Jun 2026 12:02:20 +0100 Subject: [PATCH 10/11] Just pass in `true`, not the app --- js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/index.js b/js/index.js index f9bb9e2..4ea009d 100644 --- a/js/index.js +++ b/js/index.js @@ -330,7 +330,7 @@ function showAppInfo(appid, installedVersion) { const infoPart = infoTxt.length>0 ? marked(infoTxt.join("
")) : ""; const changelogPart = changelogText ? changelogText.replace(/\n/g, "
") : ""; const changeLogHeading = changelogPart ? "
ChangeLog:
" : ""; - showPrompt(app.name + " App Information", infoPart + changeLogHeading + changelogPart, {ok: true,githubIssue:app}, false).catch(() => {}).then((c)=>{ + showPrompt(app.name + " App Information", infoPart + changeLogHeading + changelogPart, {ok: true, githubIssue: true}, false).catch(() => {}).then((c)=>{ if(c=="githubIssue"){ const encodedTitle = encodeURIComponent(`[${app.name}] Describe the issue...`); const encodedReportText = encodeURIComponent(`Tagging @${app.author} as the app author.\n\n`); From 71bd24e6797da19e68bfc8c0f9828caa78aa2f2d Mon Sep 17 00:00:00 2001 From: RKBoss6 Date: Tue, 30 Jun 2026 16:28:16 -0400 Subject: [PATCH 11/11] Update GitHub issue report URL to include author --- js/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/index.js b/js/index.js index 4ea009d..8d33cb2 100644 --- a/js/index.js +++ b/js/index.js @@ -333,8 +333,8 @@ function showAppInfo(appid, installedVersion) { showPrompt(app.name + " App Information", infoPart + changeLogHeading + changelogPart, {ok: true, githubIssue: true}, false).catch(() => {}).then((c)=>{ if(c=="githubIssue"){ const encodedTitle = encodeURIComponent(`[${app.name}] Describe the issue...`); - const encodedReportText = encodeURIComponent(`Tagging @${app.author} as the app author.\n\n`); - window.open(`https://github.com/espruino/BangleApps/issues/new?template=bangle-bug-report-custom-form.yaml&title=${encodedTitle}&fwversion=${device.version?device.version:""}`,'_blank'); + const authorText = app.author ? encodeURIComponent(`@${app.author}`):""; + window.open(`https://github.com/espruino/BangleApps/issues/new?template=bangle-bug-report-custom-form.yaml&title=${encodedTitle}&fwversion=${device.version?device.version:""}&author=${authorText}`,'_blank'); } }