Repository navigation
KsuWebUI-SN 1.2-47
·
27 commits
to main
since this release
Tip
Highlights: this release only changes the module console (Eruda) and translations. Live reload now swaps changed CSS in place without reloading the page, the console Network tab can copy just a response body, and the console panel no longer jumps off the screen when the keyboard opens. The new texts are translated in all five languages, and the translation script can now edit existing strings and pick up new ones.
✨ New
- Live reload for styles: when you save only
.cssfiles, the WebUI swaps the changed stylesheet in place instead of reloading the page, so your scroll position, open dialogs and typed text stay as they are. This works for stylesheets added with<link rel="stylesheet">. If a changed file is not loaded that way (for example@importor an inline<style>), or you saved other file types together with the CSS, it falls back to a normal full reload. - Reload messages: Live reload now shows a short message after each update, Styles updated for a style swap and Page reloaded for a full reload.
- Copy response body: open a request in the console Network tab and use the new
{ }button next to the copy-response icon. It copies only the response body to the clipboard (JSON is pretty-printed) and shows Copied.
🔁 Changed
- Live reload batching: the app now keeps every changed file from a quick burst of saves instead of only the last signal, so it can tell a CSS-only save from a mixed one. Several quick saves are still merged into one update.
- Copy message: every copy button in the console now shows the same system Copied message that the app already uses, so it follows the app language and looks the same everywhere.
- No Eruda notifications: Eruda's own in-page notifications are gone, including their unused code and styles, and the console is a little smaller.
- Refreshed message: the refresh buttons in the Elements, Storage, Cookie and Sources tools show the app's own Refreshed message, the same way copy buttons show Copied. In Storage it appears after choosing the table refresh.
- Translations: the new Styles updated, Page reloaded, Refreshed and Copy response body texts are translated in Arabic, French, Polish, Japanese and Simplified Chinese with DeepL.
🛠️ Fixed
- Console and keyboard: tapping a text box in the console, such as the Executions search, opened the keyboard and pushed the whole panel up so its title bar, tabs and search box went off the screen. The panel now shrinks to fit above the keyboard and everything stays visible.
⚙️ Under the hood
For developers ⚠️ (Click to expand)
Live reload styles (new)
IFileChangeListener.aidl:onChanged()is nowonChanged(String path).FileWatchService.kt: eachFileObserverreports the changed file as a path relative towebroot(the folder'srelativeTo(rootDir)prefix plus the file name). The mask, the watched extensions (html,htm,js,mjs,css), the 6 levels depth and the 100 folder limit are unchanged.LiveReload.kt:changesis now aChannel<String>(UNLIMITED)instead of a conflatedChannel<Unit>.watch()drains old paths when the switch is turned on.reloadOnChange(swapStyles, reload)collects the unique paths during the 300 ms debounce. If every path ends with.css(case-insensitive) it callsswapStyles(paths)and skips the reload when that returnstrue, otherwise it callsreload().WebViewHelper.kt: newWebView.swapStyles(paths)suspend function. It readsassets/livereload_css.js, replacesPATHS_JSONwith the paths as aJSONArray, runs it withevaluateJavascriptand resumes withresult == "true".initWebViewshows thelive_reload_stylesorlive_reload_reloadedtoast after a swap or a reload.assets/livereload_css.js(new): finds everylink[rel~="stylesheet"][href]on the same host whose decoded path equals/+ the changed path. For each match it clones the<link>with aksulr=<timestamp>query parameter, inserts the clone after the old one, removes the old one onloadand removes the clone onerror. It returnsfalseif any changed path has no matching<link>, which makes the caller do a full reload.
Network response body (new)
assets/eruda/network.js: injected witherudaJs("network")afterlivereloadand beforetheme. It addspadding-right: 72pxto.eruda-network .eruda-detail .eruda-control, inserts aspan.eruda-copy-body({ }) before.eruda-copy-res, and takes the text fromeruda.get('network')._detail._detailData.resTxt(objects go throughJSON.stringify(..., null, 2)). The text is sent withprompt('__ksu_copy__', text), which the existingPROMPT_COPYhandler copies to the clipboard with thecopiedtoast. AMutationObserveradds the button again when the detail view re-renders, and the script looks for the detail container every 250 ms, up to 40 times. Cost: the script is only loaded together with the console (Eruda), so it does nothing for modules that have the console off. The 250 ms search stops as soon as the container is found, or after 10 seconds at most. The observer watches only the direct children of that one container and only wakes up when request details change, so an idle console uses no battery.WebViewHelper.kt:ksuTexthas a newcopyBodyentry.
Eruda notifications removed
assets/eruda.min.js: the 7notify("Copied", ...)calls (Console, Network response and curl, Elements, Storage, Cookie, Info) now callwindow.prompt("__ksu_copied__", ""). The 7notify("Refreshed", ...)calls (Elements, Storage, Cookie, Sources script, stylesheet, iframe and image) now callwindow.prompt("__ksu_refreshed__", ""). The dead notification code is removed: theluna-notificationmodule (2556) and its import,DevTools.notify,_initNotificationand its call, the empty<div class="notification">in the panel template, and the.luna-notification*rules in the console stylesheet. The embeddedluna-notificationstylesheet (module5259, with its icon font) is emptied.assets/eruda/storage.js: the storage refresh button is intercepted, so the stock handler never runs. After the table refresh it now sendsprompt('__ksu_refreshed__', ''). The WebUI reload choice reloads the page and shows no message.WebViewHelper.kt: newPROMPT_COPIED. It shares one branch withPROMPT_COPY:PROMPT_COPYstill writes the clipboard first,PROMPT_COPIEDonly shows the existingcopiedtoast. NewPROMPT_REFRESHEDhas its own branch that shows the newrefreshedtoast.
Console and keyboard
assets/eruda/inset.js: the injected rule for.eruda-dev-toolsnow also setsmax-height: calc(100vh - var(--safe-area-inset-bottom,0px) - var(--safe-area-inset-top,0px)) !important. The panel'sbottomis pinned to--safe-area-inset-bottom, which includes the keyboard height, and the panel is 80% of the screen tall by default, so with the keyboard open its top used to end up above the screen.
Strings and tooling
- Strings: new
eruda_copy_body,live_reload_styles,live_reload_reloadedandrefreshedin English, Arabic, French, Polish, Japanese and Simplified Chinese.check_strings.pypasses and there are noTODO translatemarkers. scripts/add_language.py: running it again for an existing language first adds any new English strings (markedTODO translate) and then continues with the marked ones. New--edit [name ...]mode shows the English and the current text of one, several or all strings and asks for a new one, where Enter keeps the current text.--create-onlywas removed. The READMEs in all six languages describe the new commands. None of this changes the app.