Repository navigation
Conversation
The widgets are drawn natively with Win2D instead of a C++ Direct2D painter or a WebView. The plan now ports Android/core file by file, records what was measured on a Windows 11 machine, and lists the phases, risks and fallbacks. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The shared JavaScript build scripts strip import lines with a "\n" pattern and the parity trees are compared byte for byte. A Windows checkout with core.autocrlf turned them into CRLF, so scriptwidget-preview and build-shared-js.mjs failed there. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…parity Windows/native builds swcore.dll from the QuickJS-NG sources the Android app uses, with a C binding that mirrors scriptwidget_jni.c. QuickJS on Windows used today's UTC offset for every date; the build now asks ICU for the offset at the date in question. ScriptWidget.Core ports the engine wrapper, shared script loading, the package compiler, the script executor, the timeline planner, the XML bridge, Intl over the system ICU, $storage and the runtime policy. The shared JavaScript build moves into Scripts/lib/shared-js.mjs so the Android and Windows scripts produce their assets from the same code. The Android assets are byte-identical except android-apis.js, whose "not supported on Android" message now takes the platform name from the host and still defaults to Android. All 127 corpus packages produce the same canonical tree as JavaScriptCore. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ScriptWidget.App has the layered widget window (per-pixel transparency, never activated, dragged with snapping to the work area), the layer that keeps widgets at the bottom of the window order and raises them while Windows shows the desktop, monitor enumeration, the tray icon and popup menus, and a window self-test for checks on a real desktop. ScriptWidget.Core gains the declared actions and controls with the action planner (ported from Android), $device and $system for Windows, the saved widget placements and settings, and the current-user pipe between the host and the programs that drive it. The workflow builds swcore for x64 and ARM64, runs the preview engine tests on Windows and the .NET tests, and runs them again with AddressSanitizer in swcore. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Ports core/pkg (archive preflight, hardened .swt import and export, the package store, atomic file writes, tree verification, name and path rules) from Kotlin to ScriptWidget.Core.Packages, one file per Kotlin file, with the same limits, error codes and messages, and ports its tests to xUnit. Windows additions: path components and package names refuse reserved device names, trailing dots and spaces, colons, < > " | ? *, control characters, drive and UNC forms and overlong segments or paths; disk access refuses every reparse point, opens files without following links, counts hard links, and requires each path to be its own Path.GetFullPath form below the root. ZipArchive stops inflating at the declared size, so an entry that under-declares its size fails its CRC (archive_corrupt) instead of archive_size_mismatch; the three affected tests accept either code. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Adds ScriptWidget.Core.Render: Css, DomPainter, SvgPainter, TextEngine, FontRegistry, GifFrames and WidgetRenderer, one file per Kotlin file. Layout runs in the shared render.js on one large-stack worker thread with the 8-second deadline; the recorded elements are painted with Win2D into premultiplied BGRA bytes, with hit regions and date, GIF, motion and list slots, bitmap budget scaling and a managed PNG encoder. Text is measured and drawn through the same DirectWrite layout (natural advances, no trimming, no pixel snapping). Inter and the display fonts are linked from the Android assets into assets\fonts and loaded as "<absolute path>#<family>"; Noto Sans SC is left out, so Chinese falls back to the system font. Where Direct2D has no counterpart: conic gradients are filled per pixel into an image brush, perspective goes through a 3D transform effect using the CSS rotate3d matrix, and drop shadows, box shadows and SVG masks are recorded into command lists and composed with effects. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Ports FetchModule, the plugin layer (manifest validator, strict JSON, store, request builder, $dataSource module) and WeatherModule from the Android Kotlin sources to C#, with their unit tests and the network cases of NativeApiTest that need no device. The HTTP transport resolves each host itself, refuses private, loopback and link-local addresses, and connects to the address it checked, so a DNS answer that changes between the check and the connect cannot be used. Redirects are followed by hand with the same rules on every hop. No proxy, cookies or credentials are used. Bodies are counted while they are read. The plugin store carries its own archive preflight and link-refusing file helpers so it does not depend on the package layer. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…kaging
ScriptWidget.Core: the runtime facade (compile, run, render with rounded
corners, remote images under the fetch policy), the package library with
the bundled templates that can run on Windows, startup registration, and
a JSON number accessor that reads values built in memory.
ScriptWidget.App: the host that owns the widget windows, runs packages
on a schedule and at timeline transitions, redraws running timers and
clocks, handles buttons, toggles and links (http, https and mailto only),
pauses while the session is locked or a full-screen program is in front,
and serves the management window over the current-user pipe.
ScriptWidget.Studio: the WinUI 3 management window with the library, the
templates, the code editor (the shared CodeMirror bundle in a locked-down
WebView2) with a live preview drawn by the desktop renderer, and settings.
swcli validates, runs and draws a package from a folder. package.ps1
builds the MSIX. A package whose manifest name Windows cannot store as a
directory ("Ratio 16:9") is installed under a safe directory name.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
supportedFamilies in widget.json uses the WidgetKit names (systemMedium); they are mapped to the sizes Windows has. The host logs which kind of action ran and why one was refused (never its content), and a click no longer depends on mouse capture surviving. swcli render prints the hit regions. The solution maps its x64 and ARM64 platforms to the projects, so a solution build and a project build use the same output folder. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The editor bundle decides between an embedding app and the public Web Studio site by a marker object; the Windows bridge now provides it, so the editor opens the document instead of asking to pair with a phone. ScriptWidgetStudio.exe --screenshot <png> [--page ...] saves pictures of the window and of the code editor, used for the checks in testing.md. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…trim when idle Win2D's line-metrics array cannot be marshalled under native AOT, so the published host failed every layout. The text engine now lays lines out in a fixed line box and finds line starts by hit-testing, which needs no metrics array and gives the same lines and baseline. Requests carry a default User-Agent (ScriptWidget-Windows/<version>) when the script sets none: HttpClient sends nothing, and services such as the GitHub API refuse that. The host frees the layout engine 20 seconds after the last render when nothing is due for two minutes. The package script keeps the management window's resources.pri and publishes the Windows App SDK files once. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Adds docs/windows/README.md (what the app does, how it runs a widget, differences from the other platforms, security notes, build commands), testing.md with everything that ran on 2026-11-17 and everything that could not (the development PC was locked all session), and TODO.md. platform-support.md gains a Windows column and AGENTS.md the Windows folders and commands. Installed as a package, the data now lives in the package's own local folder: Windows redirects %LOCALAPPDATA% for packaged programs and that redirection cannot move a directory, which a transactional package install does. Show-desktop detection only treats a raised WorkerW that is the foreground window as "desktop shown", so a click on the wallpaper can never raise widgets over ordinary windows. CI runs the engine binding tests, not the whole suite, under AddressSanitizer. The documentation link check no longer assumes "/" as the path separator. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Reading the window order showed the widget windows underneath Progman: on Windows 11 build 26200 HWND_BOTTOM puts a window below the desktop window, where it is neither seen nor clicked. Widgets and the probe are now inserted after the window just above the desktop. With two widgets placed they sit directly above Progman and below every other visible window, and a window opened later goes above them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…view A redirect to another origin no longer receives the Authorization, Proxy-Authorization or Cookie header the script set. The changelog and the Windows README describe the preview and this difference from the Android transport. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Windows/scripts/desktop-check.ps1 starts the host with a scratch data folder and checks what can be checked on a locked or unattended desktop: what each widget window shows (captured from the window), the window order, a drag with snapping, a button click running its declared action, and the display, clock, sleep, lock and theme events. 22 checks pass with the debug build and with the native AOT build. Found on the way: - The Store form of the package showed "could not be started": the bootstrapper for unpackaged programs ran inside the package. It is off for that form, and the two forms build into separate folders. - A new widget landed exactly on top of one at the default place. - Pointer positions come from the messages instead of the cursor. - Icon-only buttons, switches and inputs of the management window had no accessible names. The Store form was registered and started the way the Start menu starts it: package identity, private data folder, .swt file association and the startup task all work. The test notes say which checks used posted messages or UI Automation and which were never run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Since Windows 11 24H2 the desktop icons live in Progman, and showing the desktop raises Progman itself and makes it the foreground window; before, a WorkerW takes over the icons (documented in Rainmeter's System.cpp). The layer only recognized the WorkerW form, so on this PC the widgets would have been covered by Win+D. It now watches whichever window hosts the icons, and still needs both conditions (foreground and raised above the probe), so a click on the wallpaper is not mistaken for it. ScriptWidget.exe --selftest-showdesktop acts the sequence out with a stand-in for the desktop window and checks that the widget is raised and then returns to its place: 14 checks, part of desktop-check.ps1, which now also waits for a new widget to be shown before looking at it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The Windows workflow now runs desktop-check.ps1 on the build agent's desktop and uploads the pictures of the widget windows. The check reports whether Windows accepted the tray icon (skipped where there is no taskbar). SCRIPTWIDGET_LANGUAGE chooses English or Chinese for one run, which is how the Chinese interface was captured and checked. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
desktop-check.ps1 now runs every action of the tray menu and of a widget's right-click menu through debugging requests the host accepts only with SCRIPTWIDGET_VERBOSE=1: size, lock positions (a drag is refused), add, refresh all, remove, and quit, which must end the host with exit code 0. swcli gains a host command that sends one request. The ARM64 job on windows-11-arm built natively, passed all 235 tests and the desktop check; the notes and the to-do say so, and that no person has run it on an ARM64 PC. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…an emulator Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…refactor Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ed them Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…mplates Found on the unlocked desktop with the real Win+D key and mouse: - Windows raises the desktop window later than it makes it the foreground window, so the widgets were covered while the desktop was shown. The window order is now looked at for as long as the desktop is in front. - When the desktop is left the desktop window is still raised for a moment, so the widgets were left above ordinary windows. The placing is repeated until it has settled. - A bundled template without widget.json got a manifest with no network permission when copied into the library. The copy now declares the hosts the template names. The show-desktop self-test covers both timing cases; the late raise fails on the old code. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A card on the templates page now opens the template: its preview, its read-only code and the hosts its copy will declare. "Use this template" is on that page only. The component and API examples move from tabs of the templates page to an Examples entry in the sidebar; an example opens the same way and offers "Open a copy in the editor" and "Copy code". An example that draws nothing shows what it printed instead of "#UI Not Found#". Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The Examples entry with its two tabs becomes two sidebar entries. Components stays a grid of previews. APIs is a list to look a name up in: each row shows the API and the line of its example that uses it, and the search also matches that line. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
APIs lists the globals a widget's code can use on the left and the functions of the chosen one on the right, with arguments, return type and a sentence each. The data is generated by build-shared-js.mjs from the metadata the code editor completes from. A global with a bundled example offers "View example"; one Windows does not implement is listed last and says so. The search looks through every function. Components shows small tiles instead of cards the size of a widget, and a component's page shows its properties before its example's code. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The package held one plain image per logo, so the taskbar drew the icon on its plate in the user's accent color, visible around the rounded corners. The images are now content of the management window's project and are indexed in its resources.pri with their scale, target-size and unplated qualifiers. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
A preview of ScriptWidget for Windows 11: the same Package 2.0 widgets, drawn natively on the desktop.
Windows/src/ScriptWidget.Core): a C# port ofAndroid/core, file by file: QuickJS-NG engine wrapper, compiler, executor, timeline, packages and archives,$storage,fetch/$http, Data Source Plugins,$weather, and the renderer painted with Win2D. It runs the shared JavaScript fromWeb/preview-engine.ScriptWidget.exe, native AOT): tray icon, one layered window per widget placed directly above the desktop window, scheduling, clicks on buttons, toggles and links, Show Desktop handling.ScriptWidgetStudio.exe, WinUI 3): library, templates, component examples and an API reference generated from the editor's completion metadata (a template or example opens with its preview beside its read-only code; it is copied from there), code editor (the shared CodeMirror bundle in a locked-down WebView2) with a live preview drawn by the desktop renderer, settings; English and Simplified Chinese.swclivalidates, runs and draws a package from a folder.package.ps1builds the MSIX in two forms (self-contained for local testing, framework-dependent for the Store).desktop-check.ps1checks the desktop behavior without needing to look at the screen.Documentation:
docs/windows/README.md(what it does, differences from the other platforms, security),docs/windows/testing.md(what ran, on which machine),docs/windows/TODO.md(what is left),docs/windows/plan.md.Changes outside
Windows/.gitattributes: text is checked out with LF everywhere. A CRLF checkout broke the shared JavaScript build scripts andscriptwidget-previewon Windows.Scripts/lib/shared-js.mjs: the shared-JavaScript build, now used by bothAndroid/scripts/build-shared-js.mjsandWindows/scripts/build-shared-js.mjs. The regenerated Android assets are byte-identical exceptandroid-apis.js.Android/core/src/main/js/android-apis.js(and its generated copy): the "not supported on Android" message takes the platform name from the host and still defaults to Android.Scripts/validate-doc-links.mjs: the repository-boundary check no longer assumes/as the separator..github/workflows/android.yml: a hand-started job that runs the core and app instrumented suites on an emulator.AGENTS.md,CHANGELOG.md,docs/platform-support.md,docs/README.md: Windows entries.Security and compatibility
Android/corewith their tests; Windows adds reserved device names, trailing dots and spaces, colons, UNC and drive forms, and reparse points.AuthorizationorCookieto another origin (the Android transport does; flagged for review there).What ran
dotnet teston Windows 11 x64 and in CI on x64 and ARM64: 238 tests pass, including the 127 parity packages (element tree byte-identical to the JavaScriptCore reference) and the renderer on every parity package at three sizes. The preview engine's own tests pass on Windows (199).swcliran and drew all 140 bundled packages without a crash.desktop-check.ps1passes on the development PC (debug and native AOT builds) and in CI on Windows Server 2025 (x64) and Windows 11 (ARM64): what each widget window shows, the window order, drag with snapping, a button click running its declared action, the tray and right-click menu actions, display/clock/sleep/lock/theme events, and Show Desktop acted out with a stand-in desktop window..swtfile association, startup task.On the unlocked desktop
After the first night the desktop was unlocked, so the host ran on the real desktop with nine widgets, the real Win+D key and real mouse input. Details are in
docs/windows/testing.md.widget.json(Daily Quote and eight more) failed with "Network host is not declared"; the copy now declares the hosts the template names. The Android app installs bundled templates the same way and probably has the same failure; noted indocs/android/TODO.md, not reproduced.Not covered
android-apis.jschange: the JVM tests pass in CI and the core (30 of 30) and app (63 of 63) instrumented suites pass on a CI emulator (new hand-started job inandroid.yml). They were not re-run on a phone.🤖 Generated with Claude Code