From b259acbf12153b65659ed8e99e1a6dc41dccd4e5 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 20 Dec 2025 19:33:22 +0100 Subject: [PATCH 01/21] apphist: copy fastload utils as base for new app The app will break out the app history feature of the fastload utils app. --- apps/apphist/ChangeLog | 6 +++ apps/apphist/README.md | 48 ++++++++++++++++++ apps/apphist/boot.js | 99 +++++++++++++++++++++++++++++++++++++ apps/apphist/icon.png | Bin 0 -> 1076 bytes apps/apphist/metadata.json | 16 ++++++ apps/apphist/settings.js | 73 +++++++++++++++++++++++++++ 6 files changed, 242 insertions(+) create mode 100644 apps/apphist/ChangeLog create mode 100644 apps/apphist/README.md create mode 100644 apps/apphist/boot.js create mode 100644 apps/apphist/icon.png create mode 100644 apps/apphist/metadata.json create mode 100644 apps/apphist/settings.js diff --git a/apps/apphist/ChangeLog b/apps/apphist/ChangeLog new file mode 100644 index 0000000000..6581e51889 --- /dev/null +++ b/apps/apphist/ChangeLog @@ -0,0 +1,6 @@ +0.01: New App! +0.02: Allow redirection of loads to the launcher +0.03: Allow hiding the fastloading info screen +0.04: (WIP) Allow use of app history when going back (`load()` or `Bangle.load()` calls without specified app). +0.05: Check for changes in setting.js and force real reload if needed +0.06: Fix caching whether an app is fastloadable diff --git a/apps/apphist/README.md b/apps/apphist/README.md new file mode 100644 index 0000000000..e32ec50825 --- /dev/null +++ b/apps/apphist/README.md @@ -0,0 +1,48 @@ +#### ⚠️EXPERIMENTAL⚠️ + +# Fastload Utils + +**Use this with caution.** When you find something misbehaving please check if the problem actually persists without Fastload Utils +before filing an issue. + +This allows fast loading of all apps with two conditions: +* Loaded app contains `Bangle.loadWidgets`. This is needed to prevent problems with apps not expecting widgets to be already loaded. +* Current app can be removed completely from RAM. + +**Fastload has no way of knowing whether an app can be removed completely from RAM, so if it can't your +Bangle will just end up with a memory leak or undefined behaviour** + +#### ⚠️ KNOWN ISSUES ⚠️ + +* Fastload currently does not play nice with the automatic reload option of the apploader. App installs and upgrades are unreliable since the fastload causes code to run after reset and interfere with the upload process. + +## Settings + +* Activate app history and navigate back through recent apps instead of immediately loading the clock face +* If Quick Launch is installed it can be excluded from app history +* Allows to redirect all loads usually loading the clock to the launcher instead +* The "Fastloading..." screen can be switched off +* Enable checking `setting.json` and force a complete load on changes + +## App history + +* Long press of hardware button clears the app history and loads the clock face +* Installing the 'Fast Reset' app allows doing fastloads directly to the clock face by pressing the hardware button just a little longer than a click. Useful if there are many apps in the history and the user want to access the clock quickly. + +## Technical Notes + +Fastload uses the same mechanism as `.bootcde` does to check the app to be loaded for widget use and stores the result of that and a hash of the js in a cache. + +Fastload calls `Bangle.load` to fast load an app, and this checks if `Bangle.uiRemove` exists and if so calls it to upload the app, and loads a new app using `eval`. `Bangle.uiRemove` is set when +UI elements (`layout`, `Bangle.setUI`, scrollers, etc) are supplied with a `remove` callback - and so it's assumed that the remove callback will remove *everything* related to the app from RAM. + +The problem is that apart from clocks, very few apps do actually completely remove themselves from RAM when the `remove` callback is called, so the possibility of memory leaks is very high. + + +# Creator + +[halemmerich](https://github.com/halemmerich) + +# Contributors + +[thyttan](https://github.com/thyttan) diff --git a/apps/apphist/boot.js b/apps/apphist/boot.js new file mode 100644 index 0000000000..57bc8ea949 --- /dev/null +++ b/apps/apphist/boot.js @@ -0,0 +1,99 @@ +{ +const s = require("Storage"); +const SETTINGS = s.readJSON("fastload.json") || {}; + +let loadingScreen = function(){ + g.reset(); + + let x = g.getWidth()/2; + let y = g.getHeight()/2; + g.setColor(g.theme.bg); + g.fillRect(x-49, y-19, x+49, y+19); + g.setColor(g.theme.fg); + g.drawRect(x-50, y-20, x+50, y+20); + g.setFont("6x8"); + g.setFontAlign(0,0); + g.drawString("Fastloading...", x, y); + g.flip(true); +}; + +let cache = s.readJSON("fastload.cache") || {}; + +const SYS_SETTINGS="setting.json"; + +let appFastloadPossible = function(n){ + if(SETTINGS.detectSettingsChange && (!cache[SYS_SETTINGS] || s.hash(SYS_SETTINGS) != cache[SYS_SETTINGS])){ + cache[SYS_SETTINGS] = s.hash(SYS_SETTINGS); + s.writeJSON("fastload.cache", cache); + return false; + } + + // no widgets, no problem + if (!global.WIDGETS) return true; + let hash = s.hash(n); + if (cache[n] && hash == cache[n].hash) + return cache[n].fast; + let app = s.read(n); + cache[n] = {}; + cache[n].fast = app.includes("Bangle.loadWidgets"); + cache[n].hash = hash; + s.writeJSON("fastload.cache", cache); + return cache[n].fast; +}; + +global._load = load; + +let slowload = function(n){ + global._load(n); +}; + +let fastload = function(n){ + if (!n || appFastloadPossible(n)){ + // Bangle.load can call load, to prevent recursion this must be the system load + global.load = slowload; + Bangle.load(n); + // if fastloading worked, we need to set load back to this method + global.load = fastload; + } + else + slowload(n); +}; +global.load = fastload; + +let appHistory, resetHistory, recordHistory; +if (SETTINGS.useAppHistory){ + appHistory = s.readJSON("fastload.history.json",true)||[]; + resetHistory = ()=>{appHistory=[];s.writeJSON("fastload.history.json",appHistory);}; + recordHistory = ()=>{s.writeJSON("fastload.history.json",appHistory);}; +} + +Bangle.load = (o => (name) => { + if (Bangle.uiRemove && !SETTINGS.hideLoading) loadingScreen(); + if (SETTINGS.useAppHistory){ + if (name && name!=".bootcde" && !(name=="quicklaunch.app.js" && SETTINGS.disregardQuicklaunch)) { + // store the name of the app to launch + appHistory.push(name); + } else if (name==".bootcde") { // when Bangle.showClock is called + resetHistory(); + } else if (name=="quicklaunch.app.js" && SETTINGS.disregardQuicklaunch) { + // do nothing with history + } else { + // go back in history + appHistory.pop(); + name = appHistory[appHistory.length-1]; + } + } + if (SETTINGS.autoloadLauncher && !name){ + let orig = Bangle.load; + Bangle.load = (n)=>{ + Bangle.load = orig; + fastload(n); + }; + Bangle.showLauncher(); + Bangle.load = orig; + } else + o(name); +})(Bangle.load); + +if (SETTINGS.useAppHistory) E.on('kill', ()=>{if (!BTN.read()) recordHistory(); else resetHistory();}); // Usually record history, but reset it if long press of HW button was used. +} diff --git a/apps/apphist/icon.png b/apps/apphist/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7fe9afe6ec8c6f7fd0f639a99c578b2247b716f8 GIT binary patch literal 1076 zcmV-41k3x0P)~AYu0?%tog6?U;p9%sRT2TB)ukSp#dz$xi|w0qRoi)GcxY$nU2A7JdK}G zX<}oT)EmrtEyNS}Lv!d_+uak=2|5RF3U9Mr@Tz^%1KuM#5zpxkylOAQl#;>WYCMCJ zkFuZP99TM1f`>4!`?p?eE6RkQjAwHKui7bP!6(8elPCPwWx>N^Im1`5zAX5=n?Q_X zqcFf1@OK9TxTFmDTVy-zUM!u^{&alY0=$BqO4xx{V6+Lu4H@^%)p{l#EfO3Caj*%% z?}B4z>BT1ZjtVn%M0roeJiLKpo3z;-VY2jFle*WjqYJLKG#y`P{SEI!f0KSTW!!fd zXBWh7GTvzcUTcqJ^s`L1<3CjtJgjRIylP{DGgfC}5^j_oPVdAC-GD8`huAj3-ox>+ z&8iOJYi&Qi#GV#|y`mfVnfSIrhlg=_Y;!3_j$#1q*!|tWPr>^c9o`w+%$2SvMcMP3 zFS(g|GNZ$nV*NC1FBpDJeEzzR|UcE z!jin;8z~Wjs3PFE5Phy*U8emLa04Q7~m2iYHg&fpE zh!40aqkeg;|3wI^TWO_w_;tEG-?pQz@ga*E)Fo2KUfpJYv!$!nzrre3sCLAMojRdB z!Gp2xd*Ls7yV@c|uove6*hre#S+F(uES8Vpf)4xa(>z0+tNxL_YW#=`%L3^} uiLj<05`wk^_({lDZWdObv7XVjq5lAm2P;)U!_=Ap0000 { + writeSettings("useAppHistory",v); + if (v && settings.autoloadLauncher) { + writeSettings("autoloadLauncher",!v); // Don't use app history and load to launcher together. + setTimeout(()=>E.showMenu(buildMainMenu()), 0); // Update the menu so it can be seen if a value was automatically set to false (app history vs load launcher). + } + } + }; + + if (isQuicklaunchPresent) { + mainmenu['Exclude Quick Launch from history'] = { + value: !!settings.disregardQuicklaunch, + onchange: v => { + writeSettings("disregardQuicklaunch",v); + } + }; + } + + mainmenu['Force load to launcher'] = { + value: !!settings.autoloadLauncher, + onchange: v => { + writeSettings("autoloadLauncher",v); + if (v && settings.useAppHistory) { + writeSettings("useAppHistory",!v); + setTimeout(()=>E.showMenu(buildMainMenu()), 0); // Update the menu so it can be seen if a value was automatically set to false (app history vs load launcher). + } // Don't use app history and load to launcher together. + } + }; + + mainmenu['Hide "Fastloading..."'] = { + value: !!settings.hideLoading, + onchange: v => { + writeSettings("hideLoading",v); + } + }; + + mainmenu['Detect settings changes'] = { + value: !!settings.detectSettingsChange, + onchange: v => { + writeSettings("detectSettingsChange",v); + } + }; + + return mainmenu; + } + + E.showMenu(buildMainMenu()); +}) From 13d1c2e48d57948cde5cdaa26bac6e2aae03d0db Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 20 Dec 2025 19:35:37 +0100 Subject: [PATCH 02/21] apphist: refactor away from full fastload utils capabilities keep only app history --- apps/apphist/boot.js | 133 ++++++++++++++----------------------------- 1 file changed, 42 insertions(+), 91 deletions(-) diff --git a/apps/apphist/boot.js b/apps/apphist/boot.js index 57bc8ea949..708c39302c 100644 --- a/apps/apphist/boot.js +++ b/apps/apphist/boot.js @@ -1,99 +1,50 @@ { +// Things that use `eval` instead of `load` or `Bangle.load` (e.g. auto displaying new messages - `messagegui.new.js`) can affect the app history record unexpectedly. They don't themselves get added to the history (since we don't override `eval`) and if they use one of the other two mentioned load functions they may remove the last recorded entry. + const s = require("Storage"); const SETTINGS = s.readJSON("fastload.json") || {}; -let loadingScreen = function(){ - g.reset(); - - let x = g.getWidth()/2; - let y = g.getHeight()/2; - g.setColor(g.theme.bg); - g.fillRect(x-49, y-19, x+49, y+19); - g.setColor(g.theme.fg); - g.drawRect(x-50, y-20, x+50, y+20); - g.setFont("6x8"); - g.setFontAlign(0,0); - g.drawString("Fastloading...", x, y); - g.flip(true); -}; - -let cache = s.readJSON("fastload.cache") || {}; - -const SYS_SETTINGS="setting.json"; - -let appFastloadPossible = function(n){ - if(SETTINGS.detectSettingsChange && (!cache[SYS_SETTINGS] || s.hash(SYS_SETTINGS) != cache[SYS_SETTINGS])){ - cache[SYS_SETTINGS] = s.hash(SYS_SETTINGS); - s.writeJSON("fastload.cache", cache); - return false; +global._load = global.load; +Bangle._load = Bangle.load; + +let appHistory = s.readJSON("fastload.history.json",true)||[]; +const resetHistory = ()=>{appHistory=[];s.writeJSON("fastload.history.json",appHistory);}; +const recordHistory = ()=>{s.writeJSON("fastload.history.json",appHistory);}; + +const traverseHistory = (name)=>{ + if (name && name!=".bootcde" && !(name=="quicklaunch.app.js" && SETTINGS.disregardQuicklaunch)) { + // store the name of the app to launch + appHistory.push(name); + } else if (name==".bootcde") { // when Bangle.showClock is called + resetHistory(); + } else if (name=="quicklaunch.app.js" && SETTINGS.disregardQuicklaunch) { + // do nothing with history + } else { + // go back in history + appHistory.pop(); + name = appHistory[appHistory.length-1]; } - - // no widgets, no problem - if (!global.WIDGETS) return true; - let hash = s.hash(n); - if (cache[n] && hash == cache[n].hash) - return cache[n].fast; - let app = s.read(n); - cache[n] = {}; - cache[n].fast = app.includes("Bangle.loadWidgets"); - cache[n].hash = hash; - s.writeJSON("fastload.cache", cache); - return cache[n].fast; -}; - -global._load = load; - -let slowload = function(n){ - global._load(n); -}; - -let fastload = function(n){ - if (!n || appFastloadPossible(n)){ - // Bangle.load can call load, to prevent recursion this must be the system load - global.load = slowload; - Bangle.load(n); - // if fastloading worked, we need to set load back to this method - global.load = fastload; - } - else - slowload(n); -}; -global.load = fastload; - -let appHistory, resetHistory, recordHistory; -if (SETTINGS.useAppHistory){ - appHistory = s.readJSON("fastload.history.json",true)||[]; - resetHistory = ()=>{appHistory=[];s.writeJSON("fastload.history.json",appHistory);}; - recordHistory = ()=>{s.writeJSON("fastload.history.json",appHistory);}; + return name; } -Bangle.load = (o => (name) => { - if (Bangle.uiRemove && !SETTINGS.hideLoading) loadingScreen(); - if (SETTINGS.useAppHistory){ - if (name && name!=".bootcde" && !(name=="quicklaunch.app.js" && SETTINGS.disregardQuicklaunch)) { - // store the name of the app to launch - appHistory.push(name); - } else if (name==".bootcde") { // when Bangle.showClock is called - resetHistory(); - } else if (name=="quicklaunch.app.js" && SETTINGS.disregardQuicklaunch) { - // do nothing with history - } else { - // go back in history - appHistory.pop(); - name = appHistory[appHistory.length-1]; - } - } - if (SETTINGS.autoloadLauncher && !name){ - let orig = Bangle.load; - Bangle.load = (n)=>{ - Bangle.load = orig; - fastload(n); - }; - Bangle.showLauncher(); - Bangle.load = orig; - } else - o(name); -})(Bangle.load); - -if (SETTINGS.useAppHistory) E.on('kill', ()=>{if (!BTN.read()) recordHistory(); else resetHistory();}); // Usually record history, but reset it if long press of HW button was used. +const addHistoryTraversal = (loadFn => (name) => { + name = traverseHistory(name); + loadFn(name); +}) + +const addHistoryTraversalFastload = (loadFn => (name) => { + global.load = global._load; // Only run through traverseHistory once, not both for Bangle.load and global.load. + name = traverseHistory(name); + loadFn(name); + global.load = globalLoadWithHistory; +}) + +const globalLoadWithHistory = addHistoryTraversal(global.load); +global.load = globalLoadWithHistory; +Bangle.load = addHistoryTraversalFastload(Bangle._load); + +E.on('kill', ()=>{ + // Usually record history, but reset it if long press of HW button was used. May be tricky to release button quick enough to not trigger resetHistory. + if (!BTN.read()) recordHistory(); else resetHistory(); +}) } From 7748335392ff75a90541e434606269b7a2628fa5 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 20 Dec 2025 19:39:34 +0100 Subject: [PATCH 03/21] apphist: rm fastload utils settings entries --- apps/apphist/settings.js | 41 ++-------------------------------------- 1 file changed, 2 insertions(+), 39 deletions(-) diff --git a/apps/apphist/settings.js b/apps/apphist/settings.js index 15c135fe41..fd7ccd6ead 100644 --- a/apps/apphist/settings.js +++ b/apps/apphist/settings.js @@ -1,5 +1,5 @@ (function(back) { - var FILE="fastload.json"; + var FILE="appHist.json"; var settings; var isQuicklaunchPresent = !!require('Storage').read("quicklaunch.app.js", 0, 1); @@ -19,18 +19,7 @@ function buildMainMenu(){ var mainmenu = {}; - mainmenu[''] = { 'title': 'Fastload', back: back }; - - mainmenu['Activate app history'] = { - value: !!settings.useAppHistory, - onchange: v => { - writeSettings("useAppHistory",v); - if (v && settings.autoloadLauncher) { - writeSettings("autoloadLauncher",!v); // Don't use app history and load to launcher together. - setTimeout(()=>E.showMenu(buildMainMenu()), 0); // Update the menu so it can be seen if a value was automatically set to false (app history vs load launcher). - } - } - }; + mainmenu[''] = { 'title': 'App History', back: back }; if (isQuicklaunchPresent) { mainmenu['Exclude Quick Launch from history'] = { @@ -40,32 +29,6 @@ } }; } - - mainmenu['Force load to launcher'] = { - value: !!settings.autoloadLauncher, - onchange: v => { - writeSettings("autoloadLauncher",v); - if (v && settings.useAppHistory) { - writeSettings("useAppHistory",!v); - setTimeout(()=>E.showMenu(buildMainMenu()), 0); // Update the menu so it can be seen if a value was automatically set to false (app history vs load launcher). - } // Don't use app history and load to launcher together. - } - }; - - mainmenu['Hide "Fastloading..."'] = { - value: !!settings.hideLoading, - onchange: v => { - writeSettings("hideLoading",v); - } - }; - - mainmenu['Detect settings changes'] = { - value: !!settings.detectSettingsChange, - onchange: v => { - writeSettings("detectSettingsChange",v); - } - }; - return mainmenu; } From 353978f842c5a7a415d23c8cc4a1c1fb87cb5b94 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 20 Dec 2025 19:48:37 +0100 Subject: [PATCH 04/21] apphist: fix changelog, readme and metadata to not refer to Fastload Utils. --- apps/apphist/ChangeLog | 5 ----- apps/apphist/README.md | 46 +++++--------------------------------- apps/apphist/metadata.json | 15 ++++++------- 3 files changed, 12 insertions(+), 54 deletions(-) diff --git a/apps/apphist/ChangeLog b/apps/apphist/ChangeLog index 6581e51889..5560f00bce 100644 --- a/apps/apphist/ChangeLog +++ b/apps/apphist/ChangeLog @@ -1,6 +1 @@ 0.01: New App! -0.02: Allow redirection of loads to the launcher -0.03: Allow hiding the fastloading info screen -0.04: (WIP) Allow use of app history when going back (`load()` or `Bangle.load()` calls without specified app). -0.05: Check for changes in setting.js and force real reload if needed -0.06: Fix caching whether an app is fastloadable diff --git a/apps/apphist/README.md b/apps/apphist/README.md index e32ec50825..b4d7f272c6 100644 --- a/apps/apphist/README.md +++ b/apps/apphist/README.md @@ -1,48 +1,12 @@ -#### ⚠️EXPERIMENTAL⚠️ - -# Fastload Utils - -**Use this with caution.** When you find something misbehaving please check if the problem actually persists without Fastload Utils -before filing an issue. - -This allows fast loading of all apps with two conditions: -* Loaded app contains `Bangle.loadWidgets`. This is needed to prevent problems with apps not expecting widgets to be already loaded. -* Current app can be removed completely from RAM. - -**Fastload has no way of knowing whether an app can be removed completely from RAM, so if it can't your -Bangle will just end up with a memory leak or undefined behaviour** - -#### ⚠️ KNOWN ISSUES ⚠️ - -* Fastload currently does not play nice with the automatic reload option of the apploader. App installs and upgrades are unreliable since the fastload causes code to run after reset and interfere with the upload process. - -## Settings - -* Activate app history and navigate back through recent apps instead of immediately loading the clock face -* If Quick Launch is installed it can be excluded from app history -* Allows to redirect all loads usually loading the clock to the launcher instead -* The "Fastloading..." screen can be switched off -* Enable checking `setting.json` and force a complete load on changes - -## App history - -* Long press of hardware button clears the app history and loads the clock face -* Installing the 'Fast Reset' app allows doing fastloads directly to the clock face by pressing the hardware button just a little longer than a click. Useful if there are many apps in the history and the user want to access the clock quickly. - -## Technical Notes - -Fastload uses the same mechanism as `.bootcde` does to check the app to be loaded for widget use and stores the result of that and a hash of the js in a cache. - -Fastload calls `Bangle.load` to fast load an app, and this checks if `Bangle.uiRemove` exists and if so calls it to upload the app, and loads a new app using `eval`. `Bangle.uiRemove` is set when -UI elements (`layout`, `Bangle.setUI`, scrollers, etc) are supplied with a `remove` callback - and so it's assumed that the remove callback will remove *everything* related to the app from RAM. - -The problem is that apart from clocks, very few apps do actually completely remove themselves from RAM when the `remove` callback is called, so the possibility of memory leaks is very high. +# App history +* Lets you navigate back trough the series of apps since last you were on the clock face. Works with the software back button and hardware button. +* Long press of hardware button clears the app history and loads the clock face (Sometimes triggered if your not very quickly releasing the button) # Creator -[halemmerich](https://github.com/halemmerich) +[thyttan](https://github.com/thyttan) +[halemmerich](https://github.com/halemmerich) (Fastload Utils) # Contributors -[thyttan](https://github.com/thyttan) diff --git a/apps/apphist/metadata.json b/apps/apphist/metadata.json index 77d29dbe0d..25b3838dde 100644 --- a/apps/apphist/metadata.json +++ b/apps/apphist/metadata.json @@ -1,16 +1,15 @@ -{ "id": "fastload", - "name": "Fastload Utils", - "shortName" : "Fastload Utils", - "version": "0.06", +{ "id": "apphist", + "name": "App History", + "version": "0.01", "icon": "icon.png", - "description": "Enable experimental fastloading for more apps. ⚠️ Use with extreme caution - many apps are not compatible with fastload and will cause memory leaks and instability.", + "description": "Lets you navigate back trough the series of apps since last you were on the clock face. Works with the software back button and hardware button.", "type":"bootloader", "tags": "system", "supports": ["BANGLEJS2"], "readme": "README.md", "storage": [ - {"name":"fastload.5.boot.js","url":"boot.js"}, - {"name":"fastload.settings.js","url":"settings.js"} + {"name":"apphist.5.boot.js","url":"boot.js"}, + {"name":"apphist.settings.js","url":"settings.js"} ], - "data": [{"name":"fastload.json"}] + "data": [{"name":"apphist.json"}] } From 8e1284b02aaa66af1e969cd720fd09dda4d29985 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 20 Dec 2025 20:59:04 +0100 Subject: [PATCH 05/21] apphist: new icon to change from Fastload Utils icon --- apps/apphist/icon.png | Bin 1076 -> 1781 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/apps/apphist/icon.png b/apps/apphist/icon.png index 7fe9afe6ec8c6f7fd0f639a99c578b2247b716f8..2ae70f71b6aa7abe60b76a53f397d89dd4417d73 100644 GIT binary patch delta 1765 zcmVEzb;J*TH&OKCwEw-y+PD73WjEayPEXbkkwcAEGm|Kzl%Jb&-=d!OgMJ=oa1)|UFA zuhxZAkKLoCN=wN#f)X#|)_h}QiRK)LgA4Dd$69+0U@2X${1?`SQppwpaN(0NbO)9M zxLf-i)(a#V76Dk{k37Rps9t4V>xRrLon}{dX%`4{nn!*Kl7v_Uz|j|FI&hJGZ8$Z$ zF;+TeZmknYM}O^k*s#JM6`S38J1()?C6Lg`+O-xiz>$Yvm>XcYMKd|k>IQ+6)CgInUBF9Gz}3Il zP3${0&%tNX4mU*s*B(y~kRuOi%?jYi!^1}7{;5sS(0?|ON=;p(j1z1C{EjH#=|4K= zxv_H;_8gwJW6(2V|}`HrcT%VVDmw(OTf z)zg>ItTDh!KA~U9C$*eJnbt#CKkUdux}O7xRDT;wwV!rMKDYHnTw5O$X~)4Eg431V zv~%efJ0ZDr5PXlefH6wHCn%t(Y8*I8im79QAg2?AfAm1fgFfcF&3o&+?KoA7m-&hX zb{w(4vv=hp8*8=Y-sE>ifV7ec0PeAAfb9v5ZvaG00vP8L4PZ5gUvD1(dOrYI51>}@ z3V%FfC9o-i0FOu#JYz`MxsL+3P&DQiin`fqT`;QOy7ltM76-WTWB~FDB%mWnvx+Oi zT}%DY7asu9{zm|ZApG^}VCwG5KvH5gfIC;jaG|)4m1^#wDLXr3QSW*I)#fE?7+)PG zky{M_-NR6R9kEhV1!ipAze`ahN zlw-oFbgKbqs!3>jgjuQVDgnOn6g=xOK<3ph$iJnA!rN-SlOOi68bDs57!GCBnkQV4yHMUcwkCwyZ&d(Obn!e1IoG57|S?25@bx;(4XsDwSV9$pkyXHZ>^p9cy=8KvnO($>E}WR&>NTWbJE$? z@t*_99Sa7?`Li1$^VQ&WpmC~LMFXUi4gx<-#d;@BI!QoD#l-!Y9vDud99nt|Q={(| zDKRYZCKoLjps_;-ht9S`(f#S#Q5k*#`_Hs7r4<^Wu+a1r%E+bQ0e->Qi+{*$hI``a z;#YJ=6Ks#ceXLHSbai665BA#@CmWzgXf7Q&-wtQ;Nt1Wtqgf=}sv3YY^ny9>7@g0! z)DGEs686XGb>Whvgo4(Q-0R)r1-CUYml6uwW&zB1Ck{MV2N{<;nPRfBaJDZ;1!-9n zGr?H{xQ0u!XNGewu}z_YT7LpIMoB<$QU!?xE#NJppsaM-&U*pi5rLt&hy;9hVp*N} z-Xs89Ztai1g;5<|aWb`+=;<&WR=Tb~A8m`1!RcJWEABexTiHDEoj(B5GwBUh(JoV+9W_t?qTBUw>keGdU5gh$hK|G00000NkvXX Hu0mjf@0L{L delta 1055 zcmV+)1mOGi4YUZ5B!32COGiWi{{a60|De66lK=n%=}AOERA_U5to=9*PVR3VNt4D!M!rT@briK1qR< zbm3H|3mICeMU=PB@tobmTHD#2y=UK?nN2_VKg?Qd)_m8j`G2qVU;p9%sRT2TB)ukS zp#dz$xi|w0qRoi)GcxY$nU2A7JdK}GX<}oT)EmrtEyNS}Lv!d_+uak=2|5RF3U9Mr z@Tz^%1KuM#5zpxkylOAQl#;>WYCMCJkFuZP99TM1f`>4!`?p?eE6RkQjAwHKui7bP z!6(8elPCPwWq-lLV>!cDu)Zw#yPH6aW1}#@7w~rn1GuCN_*-N<>|QLL(EfCM+ycCU zol4k&S75XW#0?qu&DDA)9xW0a263^O`TYnR+s#!DG`FGBH*{u zqpk5FiyG7=QpaB1W`DD#tJc55Dpsg=#D|?ap*+EZvF>}}FM7M$B1Etk=K Date: Sat, 20 Dec 2025 21:13:28 +0100 Subject: [PATCH 06/21] fastload: remove app history feature App history reimplemented in: App History, `apphist`. --- apps/fastload/ChangeLog | 1 + apps/fastload/README.md | 7 ------- apps/fastload/boot.js | 23 ----------------------- apps/fastload/metadata.json | 2 +- apps/fastload/settings.js | 25 ------------------------- 5 files changed, 2 insertions(+), 56 deletions(-) diff --git a/apps/fastload/ChangeLog b/apps/fastload/ChangeLog index 6581e51889..cdbf62ec08 100644 --- a/apps/fastload/ChangeLog +++ b/apps/fastload/ChangeLog @@ -4,3 +4,4 @@ 0.04: (WIP) Allow use of app history when going back (`load()` or `Bangle.load()` calls without specified app). 0.05: Check for changes in setting.js and force real reload if needed 0.06: Fix caching whether an app is fastloadable +0.07: Break out app history to a separate app: App History, `apphist`. diff --git a/apps/fastload/README.md b/apps/fastload/README.md index e32ec50825..53e23ba262 100644 --- a/apps/fastload/README.md +++ b/apps/fastload/README.md @@ -18,17 +18,10 @@ Bangle will just end up with a memory leak or undefined behaviour** ## Settings -* Activate app history and navigate back through recent apps instead of immediately loading the clock face -* If Quick Launch is installed it can be excluded from app history * Allows to redirect all loads usually loading the clock to the launcher instead * The "Fastloading..." screen can be switched off * Enable checking `setting.json` and force a complete load on changes -## App history - -* Long press of hardware button clears the app history and loads the clock face -* Installing the 'Fast Reset' app allows doing fastloads directly to the clock face by pressing the hardware button just a little longer than a click. Useful if there are many apps in the history and the user want to access the clock quickly. - ## Technical Notes Fastload uses the same mechanism as `.bootcde` does to check the app to be loaded for widget use and stores the result of that and a hash of the js in a cache. diff --git a/apps/fastload/boot.js b/apps/fastload/boot.js index 57bc8ea949..eaa7906470 100644 --- a/apps/fastload/boot.js +++ b/apps/fastload/boot.js @@ -60,29 +60,8 @@ let fastload = function(n){ }; global.load = fastload; -let appHistory, resetHistory, recordHistory; -if (SETTINGS.useAppHistory){ - appHistory = s.readJSON("fastload.history.json",true)||[]; - resetHistory = ()=>{appHistory=[];s.writeJSON("fastload.history.json",appHistory);}; - recordHistory = ()=>{s.writeJSON("fastload.history.json",appHistory);}; -} - Bangle.load = (o => (name) => { if (Bangle.uiRemove && !SETTINGS.hideLoading) loadingScreen(); - if (SETTINGS.useAppHistory){ - if (name && name!=".bootcde" && !(name=="quicklaunch.app.js" && SETTINGS.disregardQuicklaunch)) { - // store the name of the app to launch - appHistory.push(name); - } else if (name==".bootcde") { // when Bangle.showClock is called - resetHistory(); - } else if (name=="quicklaunch.app.js" && SETTINGS.disregardQuicklaunch) { - // do nothing with history - } else { - // go back in history - appHistory.pop(); - name = appHistory[appHistory.length-1]; - } - } if (SETTINGS.autoloadLauncher && !name){ let orig = Bangle.load; Bangle.load = (n)=>{ @@ -94,6 +73,4 @@ Bangle.load = (o => (name) => { } else o(name); })(Bangle.load); - -if (SETTINGS.useAppHistory) E.on('kill', ()=>{if (!BTN.read()) recordHistory(); else resetHistory();}); // Usually record history, but reset it if long press of HW button was used. } diff --git a/apps/fastload/metadata.json b/apps/fastload/metadata.json index 77d29dbe0d..18f8eb8a3b 100644 --- a/apps/fastload/metadata.json +++ b/apps/fastload/metadata.json @@ -1,7 +1,7 @@ { "id": "fastload", "name": "Fastload Utils", "shortName" : "Fastload Utils", - "version": "0.06", + "version": "0.07", "icon": "icon.png", "description": "Enable experimental fastloading for more apps. ⚠️ Use with extreme caution - many apps are not compatible with fastload and will cause memory leaks and instability.", "type":"bootloader", diff --git a/apps/fastload/settings.js b/apps/fastload/settings.js index 15c135fe41..f07f649c62 100644 --- a/apps/fastload/settings.js +++ b/apps/fastload/settings.js @@ -1,7 +1,6 @@ (function(back) { var FILE="fastload.json"; var settings; - var isQuicklaunchPresent = !!require('Storage').read("quicklaunch.app.js", 0, 1); function writeSettings(key, value) { var s = require('Storage').readJSON(FILE, true) || {}; @@ -21,34 +20,10 @@ mainmenu[''] = { 'title': 'Fastload', back: back }; - mainmenu['Activate app history'] = { - value: !!settings.useAppHistory, - onchange: v => { - writeSettings("useAppHistory",v); - if (v && settings.autoloadLauncher) { - writeSettings("autoloadLauncher",!v); // Don't use app history and load to launcher together. - setTimeout(()=>E.showMenu(buildMainMenu()), 0); // Update the menu so it can be seen if a value was automatically set to false (app history vs load launcher). - } - } - }; - - if (isQuicklaunchPresent) { - mainmenu['Exclude Quick Launch from history'] = { - value: !!settings.disregardQuicklaunch, - onchange: v => { - writeSettings("disregardQuicklaunch",v); - } - }; - } - mainmenu['Force load to launcher'] = { value: !!settings.autoloadLauncher, onchange: v => { writeSettings("autoloadLauncher",v); - if (v && settings.useAppHistory) { - writeSettings("useAppHistory",!v); - setTimeout(()=>E.showMenu(buildMainMenu()), 0); // Update the menu so it can be seen if a value was automatically set to false (app history vs load launcher). - } // Don't use app history and load to launcher together. } }; From 675a007fca4fe8f2716863dc7c33642c3a96a51a Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 20 Dec 2025 21:16:02 +0100 Subject: [PATCH 07/21] apphist: tweak boot order to run after `Fastload Utils` ... if it's present. --- apps/apphist/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/apphist/metadata.json b/apps/apphist/metadata.json index 25b3838dde..c072d49428 100644 --- a/apps/apphist/metadata.json +++ b/apps/apphist/metadata.json @@ -8,7 +8,7 @@ "supports": ["BANGLEJS2"], "readme": "README.md", "storage": [ - {"name":"apphist.5.boot.js","url":"boot.js"}, + {"name":"apphist.6.boot.js","url":"boot.js"}, {"name":"apphist.settings.js","url":"settings.js"} ], "data": [{"name":"apphist.json"}] From 2245958c3d41689d65a6aac6bf849e68757a915e Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 20 Dec 2025 22:12:59 +0100 Subject: [PATCH 08/21] apphist: fix unchanged Fastload Utils references in code --- apps/apphist/boot.js | 8 ++++---- apps/apphist/settings.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/apphist/boot.js b/apps/apphist/boot.js index 708c39302c..4c318de071 100644 --- a/apps/apphist/boot.js +++ b/apps/apphist/boot.js @@ -2,14 +2,14 @@ // Things that use `eval` instead of `load` or `Bangle.load` (e.g. auto displaying new messages - `messagegui.new.js`) can affect the app history record unexpectedly. They don't themselves get added to the history (since we don't override `eval`) and if they use one of the other two mentioned load functions they may remove the last recorded entry. const s = require("Storage"); -const SETTINGS = s.readJSON("fastload.json") || {}; +const SETTINGS = s.readJSON("apphist.json") || {}; global._load = global.load; Bangle._load = Bangle.load; -let appHistory = s.readJSON("fastload.history.json",true)||[]; -const resetHistory = ()=>{appHistory=[];s.writeJSON("fastload.history.json",appHistory);}; -const recordHistory = ()=>{s.writeJSON("fastload.history.json",appHistory);}; +let appHistory = s.readJSON("apphist.history.json",true)||[]; +const resetHistory = ()=>{appHistory=[];s.writeJSON("apphist.history.json",appHistory);}; +const recordHistory = ()=>{s.writeJSON("apphist.history.json",appHistory);}; const traverseHistory = (name)=>{ if (name && name!=".bootcde" && !(name=="quicklaunch.app.js" && SETTINGS.disregardQuicklaunch)) { diff --git a/apps/apphist/settings.js b/apps/apphist/settings.js index fd7ccd6ead..458d7ba30e 100644 --- a/apps/apphist/settings.js +++ b/apps/apphist/settings.js @@ -1,5 +1,5 @@ (function(back) { - var FILE="appHist.json"; + var FILE="apphist.settings.json"; var settings; var isQuicklaunchPresent = !!require('Storage').read("quicklaunch.app.js", 0, 1); From 538b92fa6dc27d49e1e709e8e325118c4efba5e7 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 20 Dec 2025 22:16:09 +0100 Subject: [PATCH 09/21] apphist: fis missing semicolons --- apps/apphist/boot.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/apphist/boot.js b/apps/apphist/boot.js index 4c318de071..a7a3de681f 100644 --- a/apps/apphist/boot.js +++ b/apps/apphist/boot.js @@ -25,19 +25,19 @@ const traverseHistory = (name)=>{ name = appHistory[appHistory.length-1]; } return name; -} +}; const addHistoryTraversal = (loadFn => (name) => { name = traverseHistory(name); loadFn(name); -}) +}); const addHistoryTraversalFastload = (loadFn => (name) => { global.load = global._load; // Only run through traverseHistory once, not both for Bangle.load and global.load. name = traverseHistory(name); loadFn(name); global.load = globalLoadWithHistory; -}) +}); const globalLoadWithHistory = addHistoryTraversal(global.load); global.load = globalLoadWithHistory; @@ -46,5 +46,5 @@ Bangle.load = addHistoryTraversalFastload(Bangle._load); E.on('kill', ()=>{ // Usually record history, but reset it if long press of HW button was used. May be tricky to release button quick enough to not trigger resetHistory. if (!BTN.read()) recordHistory(); else resetHistory(); -}) +}); } From 08b8473466057af138c8bfdb3dd0c92c0b427f46 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 20 Dec 2025 22:23:16 +0100 Subject: [PATCH 10/21] apphist: fix compat with fasload utils ... by reversing order of execution. Now `apphist` (order 4) is placed before `fasload` (order 5) in boot sequence. When it was the other way around (`apphist` order 6) the Bangle.js 2 would crap out, freeze up and then hard reboot. --- apps/apphist/boot.js | 1 + apps/apphist/metadata.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/apphist/boot.js b/apps/apphist/boot.js index a7a3de681f..c18e9b1d1b 100644 --- a/apps/apphist/boot.js +++ b/apps/apphist/boot.js @@ -1,5 +1,6 @@ { // Things that use `eval` instead of `load` or `Bangle.load` (e.g. auto displaying new messages - `messagegui.new.js`) can affect the app history record unexpectedly. They don't themselves get added to the history (since we don't override `eval`) and if they use one of the other two mentioned load functions they may remove the last recorded entry. +// Seems like `apphist` must be placed before `Fastload Utils` in execution order at boot for compatibility. Otherwise the Bangle.js 2 craps out, freezed up and soon reboots extra hard before loading the clock face again. This is ensured by metadata placing apphist at order 4 and Fastload Utils at order 5 in the boot sequence. const s = require("Storage"); const SETTINGS = s.readJSON("apphist.json") || {}; diff --git a/apps/apphist/metadata.json b/apps/apphist/metadata.json index c072d49428..39a0e4ef14 100644 --- a/apps/apphist/metadata.json +++ b/apps/apphist/metadata.json @@ -8,7 +8,7 @@ "supports": ["BANGLEJS2"], "readme": "README.md", "storage": [ - {"name":"apphist.6.boot.js","url":"boot.js"}, + {"name":"apphist.4.boot.js","url":"boot.js"}, {"name":"apphist.settings.js","url":"settings.js"} ], "data": [{"name":"apphist.json"}] From 750a5951b50129515c866d77731f98b1bae7d098 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 20 Dec 2025 23:03:40 +0100 Subject: [PATCH 11/21] apphist: fix confusion re settings and history json files --- apps/apphist/boot.js | 8 ++++---- apps/apphist/metadata.json | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/apphist/boot.js b/apps/apphist/boot.js index c18e9b1d1b..82f3458957 100644 --- a/apps/apphist/boot.js +++ b/apps/apphist/boot.js @@ -3,14 +3,14 @@ // Seems like `apphist` must be placed before `Fastload Utils` in execution order at boot for compatibility. Otherwise the Bangle.js 2 craps out, freezed up and soon reboots extra hard before loading the clock face again. This is ensured by metadata placing apphist at order 4 and Fastload Utils at order 5 in the boot sequence. const s = require("Storage"); -const SETTINGS = s.readJSON("apphist.json") || {}; +const SETTINGS = s.readJSON("apphist.settings.json") || {}; global._load = global.load; Bangle._load = Bangle.load; -let appHistory = s.readJSON("apphist.history.json",true)||[]; -const resetHistory = ()=>{appHistory=[];s.writeJSON("apphist.history.json",appHistory);}; -const recordHistory = ()=>{s.writeJSON("apphist.history.json",appHistory);}; +let appHistory = s.readJSON("apphist.json",true)||[]; +const resetHistory = ()=>{appHistory=[];s.writeJSON("apphist.json",appHistory);}; +const recordHistory = ()=>{s.writeJSON("apphist.json",appHistory);}; const traverseHistory = (name)=>{ if (name && name!=".bootcde" && !(name=="quicklaunch.app.js" && SETTINGS.disregardQuicklaunch)) { diff --git a/apps/apphist/metadata.json b/apps/apphist/metadata.json index 39a0e4ef14..41228cf119 100644 --- a/apps/apphist/metadata.json +++ b/apps/apphist/metadata.json @@ -11,5 +11,8 @@ {"name":"apphist.4.boot.js","url":"boot.js"}, {"name":"apphist.settings.js","url":"settings.js"} ], - "data": [{"name":"apphist.json"}] + "data": [ + {"name":"apphist.json"}, + {"name":"apphist.settings.json"} + ] } From 034ebfb73bb35b5cb07efffe931d307245dfaec3 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Mon, 22 Dec 2025 13:04:23 +0100 Subject: [PATCH 12/21] apphist: tweak comment re resetHistory on `kill`. --- apps/apphist/boot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/apphist/boot.js b/apps/apphist/boot.js index 82f3458957..8b74b15098 100644 --- a/apps/apphist/boot.js +++ b/apps/apphist/boot.js @@ -45,7 +45,8 @@ global.load = globalLoadWithHistory; Bangle.load = addHistoryTraversalFastload(Bangle._load); E.on('kill', ()=>{ - // Usually record history, but reset it if long press of HW button was used. May be tricky to release button quick enough to not trigger resetHistory. + // Usually record history, but reset it if long press of HW button was used. + // FIXME: May be tricky for user to release button quickly enough to not trigger resetHistory. if (!BTN.read()) recordHistory(); else resetHistory(); }); } From 91384947254cf7a094c9bf79c4c3497f5eec1c44 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Sat, 10 Jan 2026 18:52:05 +0100 Subject: [PATCH 13/21] apphist: disable long press HW BTN to reset history --- apps/apphist/README.md | 4 +++- apps/apphist/boot.js | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/apphist/README.md b/apps/apphist/README.md index b4d7f272c6..60da7d6385 100644 --- a/apps/apphist/README.md +++ b/apps/apphist/README.md @@ -1,7 +1,9 @@ # App history * Lets you navigate back trough the series of apps since last you were on the clock face. Works with the software back button and hardware button. -* Long press of hardware button clears the app history and loads the clock face (Sometimes triggered if your not very quickly releasing the button) + +TODO: +* Long press of hardware button clears the app history and loads the clock face (Sometimes triggered if your not very quickly releasing the button. Commented out for now.) # Creator diff --git a/apps/apphist/boot.js b/apps/apphist/boot.js index 8b74b15098..d93f6c8d00 100644 --- a/apps/apphist/boot.js +++ b/apps/apphist/boot.js @@ -46,7 +46,8 @@ Bangle.load = addHistoryTraversalFastload(Bangle._load); E.on('kill', ()=>{ // Usually record history, but reset it if long press of HW button was used. - // FIXME: May be tricky for user to release button quickly enough to not trigger resetHistory. - if (!BTN.read()) recordHistory(); else resetHistory(); + // FIXME: May be tricky for user to release button quickly enough to not trigger resetHistory. Commented out for now. + // if (!BTN.read()) recordHistory(); else resetHistory(); + recordHistory(); }); } From 757a0f27b45ca49b399ab777d3944b44b8f0c35b Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Thu, 28 May 2026 22:55:42 +0200 Subject: [PATCH 14/21] confthyttan: drop fastload utils as it's functionality is now mostly included in firmware --- apps/confthyttan/ChangeLog | 2 ++ apps/confthyttan/metadata.json | 5 +---- apps/confthyttan/setting.json | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/confthyttan/ChangeLog b/apps/confthyttan/ChangeLog index 392b10aa3c..2e2c82fe89 100644 --- a/apps/confthyttan/ChangeLog +++ b/apps/confthyttan/ChangeLog @@ -9,3 +9,5 @@ 0.08: hide bt indicator when connected (`widbt_notify`). Add "Message Twist to Scroll". Add "Big Clock Info app". Auto open messages if locked. +0.09: remove fastload utils as it's functionality is more or less included in + firmware now. diff --git a/apps/confthyttan/metadata.json b/apps/confthyttan/metadata.json index e9886afa49..fd60fb1148 100644 --- a/apps/confthyttan/metadata.json +++ b/apps/confthyttan/metadata.json @@ -1,6 +1,6 @@ { "id": "confthyttan", "name": "Thyttan's Default Config", - "version":"0.08", + "version":"0.09", "author": "thyttan", "description": "A different default set of apps and configurations. Makes many quality of life changes. Opinionated based on the creators taste. Read more below before installing.", "icon": "app.png", @@ -39,7 +39,6 @@ "autoreset":"app", "chargent":"app", "setting":"app", - "fastload":"app", "boot":"app", "ateatimer":"app", "bigclkinfo":"app", @@ -52,8 +51,6 @@ "url":"autoreset.json"}, {"name":"dtlaunch.json", "url":"dtlaunch.json"}, - {"name":"fastload.json", - "url":"fastload.json"}, {"name":"quicklaunch.json", "url":"quicklaunch.json"}, {"name":"messages.settings.json", diff --git a/apps/confthyttan/setting.json b/apps/confthyttan/setting.json index ece0c87edf..5905e4ec39 100644 --- a/apps/confthyttan/setting.json +++ b/apps/confthyttan/setting.json @@ -1 +1 @@ -{ble:true,blerepl:true,log:false,quiet:0,timeout:10,vibrate:true,beep:true,timezone:2,HID:false,clock:"edgeclk.app.js","12hour":false,firstDayOfWeek:1,brightness:0.5,options:{wakeOnBTN1:true,wakeOnBTN2:true,wakeOnBTN3:true,wakeOnFaceUp:false,wakeOnTouch:false,wakeOnTwist:false,twistThreshold:819.2,twistMaxY:-800,twistTimeout:1000,btnLoadTimeout:700},theme:{fg:65535,bg:0,fg2:65535,bg2:8,fgH:65535,bgH:31,dark:true},clockHasWidgets:true,launcher:"dtlaunch.app.js",touch:{x1:6,y1:14,x2:197,y2:178}} +{ble:true,blerepl:true,log:false,quiet:0,timeout:10,vibrate:true,beep:true,timezone:2,HID:false,clock:"edgeclk.app.js","12hour":false,firstDayOfWeek:1,brightness:0.5,options:{wakeOnBTN1:true,wakeOnBTN2:true,wakeOnBTN3:true,wakeOnFaceUp:false,wakeOnTouch:false,wakeOnTwist:false,twistThreshold:819.2,twistMaxY:-800,twistTimeout:1000,btnLoadTimeout:700},theme:{fg:65535,bg:0,fg2:65535,bg2:8,fgH:65535,bgH:31,fgW:65535,bgW:0,dark:true},clockHasWidgets:true,launcher:"dtlaunch.app.js",touch:{x1:6,y1:14,x2:197,y2:178}} From 8018a89be94b7efb8f530c74f9a77eb697d7d815 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Thu, 28 May 2026 23:03:58 +0200 Subject: [PATCH 15/21] apphist: tweak ChangeLog --- apps/apphist/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/apphist/ChangeLog b/apps/apphist/ChangeLog index 5560f00bce..f88857de4d 100644 --- a/apps/apphist/ChangeLog +++ b/apps/apphist/ChangeLog @@ -1 +1 @@ -0.01: New App! +0.01: New App! (Break out from Fastload Utils app) From 4b90d484155f511da732af135f97926f140233df Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Thu, 28 May 2026 23:09:20 +0200 Subject: [PATCH 16/21] confthyttan: add apphist dependency --- apps/confthyttan/metadata.json | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/confthyttan/metadata.json b/apps/confthyttan/metadata.json index fd60fb1148..327a0f7bfc 100644 --- a/apps/confthyttan/metadata.json +++ b/apps/confthyttan/metadata.json @@ -42,6 +42,7 @@ "boot":"app", "ateatimer":"app", "bigclkinfo":"app", + "apphist":"app", "drained":"app" }, "storage": [ From 2abcb7369a751ffcfb37961b5ff7ebf91effd42f Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Thu, 28 May 2026 23:27:17 +0200 Subject: [PATCH 17/21] apphist: don't use the settings --- apps/apphist/ChangeLog | 1 + apps/apphist/boot.js | 9 ++++++--- apps/apphist/metadata.json | 8 +++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/apps/apphist/ChangeLog b/apps/apphist/ChangeLog index f88857de4d..4113605ff2 100644 --- a/apps/apphist/ChangeLog +++ b/apps/apphist/ChangeLog @@ -1 +1,2 @@ 0.01: New App! (Break out from Fastload Utils app) +0.02: Don't use settings. diff --git a/apps/apphist/boot.js b/apps/apphist/boot.js index d93f6c8d00..fe12683bc0 100644 --- a/apps/apphist/boot.js +++ b/apps/apphist/boot.js @@ -1,9 +1,12 @@ { // Things that use `eval` instead of `load` or `Bangle.load` (e.g. auto displaying new messages - `messagegui.new.js`) can affect the app history record unexpectedly. They don't themselves get added to the history (since we don't override `eval`) and if they use one of the other two mentioned load functions they may remove the last recorded entry. + // Seems like `apphist` must be placed before `Fastload Utils` in execution order at boot for compatibility. Otherwise the Bangle.js 2 craps out, freezed up and soon reboots extra hard before loading the clock face again. This is ensured by metadata placing apphist at order 4 and Fastload Utils at order 5 in the boot sequence. +//Commented out calling the settings object. Seemed like a waste of resources. + const s = require("Storage"); -const SETTINGS = s.readJSON("apphist.settings.json") || {}; +//const SETTINGS = s.readJSON("apphist.settings.json") || {}; global._load = global.load; Bangle._load = Bangle.load; @@ -13,12 +16,12 @@ const resetHistory = ()=>{appHistory=[];s.writeJSON("apphist.json",appHistory);} const recordHistory = ()=>{s.writeJSON("apphist.json",appHistory);}; const traverseHistory = (name)=>{ - if (name && name!=".bootcde" && !(name=="quicklaunch.app.js" && SETTINGS.disregardQuicklaunch)) { + if (name && name!=".bootcde" && !(name=="quicklaunch.app.js"/* && SETTINGS.disregardQuicklaunch*/)) { // store the name of the app to launch appHistory.push(name); } else if (name==".bootcde") { // when Bangle.showClock is called resetHistory(); - } else if (name=="quicklaunch.app.js" && SETTINGS.disregardQuicklaunch) { + } else if (name=="quicklaunch.app.js"/* && SETTINGS.disregardQuicklaunch*/) { // do nothing with history } else { // go back in history diff --git a/apps/apphist/metadata.json b/apps/apphist/metadata.json index 41228cf119..0054036b02 100644 --- a/apps/apphist/metadata.json +++ b/apps/apphist/metadata.json @@ -1,6 +1,6 @@ { "id": "apphist", "name": "App History", - "version": "0.01", + "version": "0.02", "icon": "icon.png", "description": "Lets you navigate back trough the series of apps since last you were on the clock face. Works with the software back button and hardware button.", "type":"bootloader", @@ -8,11 +8,9 @@ "supports": ["BANGLEJS2"], "readme": "README.md", "storage": [ - {"name":"apphist.4.boot.js","url":"boot.js"}, - {"name":"apphist.settings.js","url":"settings.js"} + {"name":"apphist.4.boot.js","url":"boot.js"} ], "data": [ - {"name":"apphist.json"}, - {"name":"apphist.settings.json"} + {"name":"apphist.json"} ] } From f9f793957bd7142d890098f23608a0534a53075c Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Thu, 28 May 2026 23:29:48 +0200 Subject: [PATCH 18/21] apphist: add comment to settings file --- apps/apphist/settings.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/apphist/settings.js b/apps/apphist/settings.js index 458d7ba30e..a40f38a5a1 100644 --- a/apps/apphist/settings.js +++ b/apps/apphist/settings.js @@ -1,3 +1,5 @@ +//Settings has been disabled for apphist. But we leave this file for potential future use. + (function(back) { var FILE="apphist.settings.json"; var settings; From b0ba8c7534581a4f78418080a32c5afbce0f265e Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Thu, 28 May 2026 23:34:25 +0200 Subject: [PATCH 19/21] apphist: add note to readme re quicklaunch being disregarded --- apps/apphist/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/apphist/README.md b/apps/apphist/README.md index 60da7d6385..9fe5173c22 100644 --- a/apps/apphist/README.md +++ b/apps/apphist/README.md @@ -2,6 +2,10 @@ * Lets you navigate back trough the series of apps since last you were on the clock face. Works with the software back button and hardware button. +# Notes + +* Quick Launch app does not get remarked in history. + TODO: * Long press of hardware button clears the app history and loads the clock face (Sometimes triggered if your not very quickly releasing the button. Commented out for now.) From 0a6d555a9a208a66754805e4b0c3742b87b0ad9f Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Thu, 28 May 2026 23:41:33 +0200 Subject: [PATCH 20/21] confthyttan: add to changelog re widget colors --- apps/confthyttan/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/confthyttan/ChangeLog b/apps/confthyttan/ChangeLog index 2e2c82fe89..6c12e94c64 100644 --- a/apps/confthyttan/ChangeLog +++ b/apps/confthyttan/ChangeLog @@ -10,4 +10,4 @@ Scroll". Add "Big Clock Info app". Auto open messages if locked. 0.09: remove fastload utils as it's functionality is more or less included in - firmware now. + firmware now. Fix to handle the new widget theme colors. From 92e83607dad44fec852cd3cacc6acd411352dff9 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Thu, 28 May 2026 23:50:13 +0200 Subject: [PATCH 21/21] fastload: add info that the app is deprecated --- apps/fastload/README.md | 4 +++- apps/fastload/metadata.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/fastload/README.md b/apps/fastload/README.md index 53e23ba262..3e658d6eb6 100644 --- a/apps/fastload/README.md +++ b/apps/fastload/README.md @@ -1,7 +1,9 @@ -#### ⚠️EXPERIMENTAL⚠️ +#### ⚠️DEPRECATED⚠️ ⚠️EXPERIMENTAL⚠️ # Fastload Utils +**Deprecated.** This app's functionality has to a large extent been integrated into firmware, with slight adjustments. + **Use this with caution.** When you find something misbehaving please check if the problem actually persists without Fastload Utils before filing an issue. diff --git a/apps/fastload/metadata.json b/apps/fastload/metadata.json index 18f8eb8a3b..eed264633c 100644 --- a/apps/fastload/metadata.json +++ b/apps/fastload/metadata.json @@ -3,7 +3,7 @@ "shortName" : "Fastload Utils", "version": "0.07", "icon": "icon.png", - "description": "Enable experimental fastloading for more apps. ⚠️ Use with extreme caution - many apps are not compatible with fastload and will cause memory leaks and instability.", + "description": "Deprecated. Enable experimental fastloading for more apps. ⚠️ Use with extreme caution - many apps are not compatible with fastload and will cause memory leaks and instability.", "type":"bootloader", "tags": "system", "supports": ["BANGLEJS2"],