11 Commits
Author SHA1 Message Date
Roman ChojnackiandClaude Opus 5.5 63b4fe6dc1 Web page: a Content-Security-Policy
The page allowed any script. It now sets a policy: scripts only from its own origin, plus WebAssembly; images from its own origin, data: and blob:, which the app creates; nothing from elsewhere. The inline script moved to shell.js, copied beside the page like keylog.js, and the canvas's inline context-menu handler went with it. Checked in headless Edge: showcase, notepad and simple start and draw the same pixels with the policy as without, the showcase's accessibility tree is the same, and the console shows no violation, with ?keylog too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 23:27:29 +02:00
adminandClaude Opus 5.5 e4dc3f63db A loading screen with progress, and NukAnim under reaktor_anim_ names
The web build's loading overlay shows the Reaktor mark, the name, a
progress bar and Emscripten's download count, in tiny.css's colors for
either scheme, and fades out once the app starts.

include/reaktor/anim.h aliases the NukAnim names the samples use as
reaktor_anim_ and REAKTOR_ANIM_, so the samples no longer name nka_.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 11:10:05 +02:00
adminandClaude Opus 5.5 1bb65db393 The web canvas is square
The page rounded the canvas's top corners to stand in for a desktop window
manager's, and the page's own background showed through them. In a browser
the canvas is the page, so its corners are square now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 19:49:14 +02:00
adminandClaude Opus 5 1a2b19110e A tap keeps the keyboard it just opened
On Android, tapping a text field opened the on-screen keyboard, closed it,
opened it again, and then typing produced nothing. The page was fighting the
module for the canvas: tools/shell.html focused the canvas on mousedown so SDL
would get keys, and on a touch device the compatibility mousedown arrives after
pointerup - by which point keyboard_web.c has focused the hidden input and the
keyboard has come up. The shell took it back, the keyboard went down, and the
next frame's reaktor_web_keys_wants asked for it again. Whichever of the two
held focus when typing started decided whether anything landed, and with the
canvas holding it Android sends no keypress. SDL never calls focus() itself,
only reads it, so the page was the only thing taking it.

The canvas focus moves into the module that already owns the canvas and the
decision of who should hold the keyboard, and skips itself while the field has
it. The shell now has no focus code at all, which is the point: every embedder
writes that handler for the same reason, and the rule travels with the module
rather than with a copied page.

?keylog is what would have found this without reading anything: a page loaded
with it logs every pointer, touch, mouse, focus, key, beforeinput and
composition event, with the active element on each line, the viewport height
as the keyboard comes and goes, and a timestamp. It lives in tools/keylog.js
and is fetched only when asked for, so the shell stays a page rather than a
debugger.

A clean-up pass followed, and moved most of this: the overlay out of the
template and behind pointer-events, the focus policy into the module, five
copied listener registrations into one, a 250 ms poll deleted in favour of the
focus events already logged, and the log's own rendering batched to a frame so
it stops charging its reflows to the latency it is there to measure.

The README links Avalonia, Shaft and Freya where it names them, says what a
stub module actually costs rather than implying nothing changes, names
build-wasm.ps1 for Windows, and loses about a quarter of Features. PERFORMANCE
loses 81 words of hedging from the benchmark, size, memory and CPU sections,
with every figure and machine unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 10:05:13 +02:00
adminandClaude Opus 5 458d11aa49 Text past Latin-1, and the showcase in three languages
Two optional modules, each an interface library with a _none twin and a
REAKTOR_<NAME> option that defaults on, so an application that wants neither
links neither.

Locale reads a catalog per language from assets/locale, or compiles them in
with REAKTOR_LOCALE_EMBED: key = value lines, gettext plural rules, and
numbers, money and dates written the way each catalog says. The atlas bakes
what the catalogs use that Aileron has, and --lang picks the language.

Text draws what the atlas cannot. A string with any character the atlas lacks
is measured and drawn by core/text/text.c instead of Nuklear: direction by
mojibake's bidirectional algorithm, shaping by kb_text_shape, glyphs from the
first font that has them, rasterized at the size they are drawn, and lines
broken by UAX #14. Both libraries come in as submodules. M PLUS 1p is vendored
with its OFL notice for the showcase's Japanese, and --font-fallback adds more.

The showcase gains a Translations page: the opening of The Ugly Duckling in
English, Polish and Japanese, beside a date, a number, money in three
currencies and a plural count, each formatted the way that language writes it.

A clean-up pass followed: shared helpers for what was duplicated, and comments
cut to the few one-liners that guard against a bug. Screenshots and
--a11y-dump of all ten tabs, of Polish and Japanese, and of a right-to-left
sample were compared before and after it and are byte-identical. The seven
tests pass, localetest and texttest among them, and the native and
WebAssembly builds both link.

The docs follow. DOCUMENTATION.md covers both modules and the formatting keys,
DEMO.md shows each of the four applications, benchmarks/README.md becomes
BENCHMARKS.md, PERFORMANCE.md drops the per-machine CPU column and the history
of the old chart, and the GitHub Pages workflow is added. The showcase and
bench windows are titled Showcase and Bench, as notepad and simple already were.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 22:01:24 +02:00
adminandClaude Opus 5 d4e0bf9c4c Three applications, a tree without prose, and six bugs it was hiding
Structure. Onlay and simple.css become submodules; the vendored copy of Onlay
under onlay/ goes. The samples split into samples/showcase, samples/notepad and
samples/simple, sharing runtime/ and core/ through a reaktor_runtime static
library, and sample.h grows a window spec so an application says how big it
wants to be instead of inheriting the showcase's 1100x680. branding/ moves into
assets/icons and assets/rest.

Prose. Every comment is gone from the tree's own sources, and put back only
where a reader would otherwise be misled: the one-frame lag, the settling
bound, the Nuklear behaviours, the menu row spacing MENU_H counts on. About
4,850 lines of narration removed. third_party/ is untouched, and the vendored
nk_sdl3_renderer.h keeps its licence header and its REAKTOR markers, which are
the only record of how it differs from upstream.

Six bugs found on the way, each verified against the running application
rather than against a reading of the source:

  * REAKTOR_SCALE never worked. The panel was laid out from SDL_GetWindowSize,
    which is already divided on a real HiDPI display but not under a forced
    scale; and draw.c set the font's logical height before nk_sdl_font_stash_end,
    which bakes and puts the device height back. At 2x every label measured and
    drew twice its size and the tab strip fell off the window.
  * rss_mark() wrote runtime/app.c's copy of g_rss and the Diagnostics page read
    core/ui/widgets.c's, because both were statics in a header included by ten
    translation units. Every row of "What startup costs" reported 0.0 MB.
  * The WASM preload and the macOS bundle work out which icons to ship by
    grepping the sources, and both were still looking where the sources used to
    be. They shipped 3 of 43 glyphs.
  * The Styling page's progress bar shared a value with the Inputs page's but
    never got .modifiable, so it alone ignored the pointer.
  * REAKTOR_STATS wrote build/stats.log relative to the process's cwd - the one
    path in the tree that skipped reaktor_path().
  * UIA re-announced the same focused element on every frame the diff was
    non-empty; the AT-SPI and web bridges already guarded it.

Simplification. No unused variable, unreachable branch or uncalled static
survives /W4 across our sources. Eleven copies of the box-default rule collapse
into box_default/row_height; the menu chrome, row height and item become
reaktor_menu_* so the two samples cannot drift apart again; twenty hand-inlined
token lookups become reaktor_token; three private copies of read-whole-file
become reaktor_read_file. reaktor_path resolves the asset root once instead of
walking the tree on every call, the notepad stops re-hashing its document every
frame, and Diagnostics samples process memory twice a second instead of per
frame - it was inflating the timings it prints.

The accessibility dump is unchanged through all of it except where a change was
intended, which is what made the whole pass reviewable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-11 01:34:32 +02:00
AlpaqandClaude Opus 4.7 ed5fe2d427 A macOS build that reaches Finder, a titlebar that folds when told, and a walk-up that finds itself from anywhere
The .app bundle is assembled around the plain binary at build time: same
executable file, plus an Info.plist and the assets under Contents/Resources,
and a real .icns rasterised from the brand PNG at ten sizes with sips and
iconutil. `./build/reaktor` still works from a shell; Finder now opens
`build/reaktor.app` with no Terminal beside it. reaktor_root() detects the
bundle layout in argv[0] and hands back Contents/Resources directly, so
the bundle is self-contained and can be moved to /Applications.

The custom titlebar switch on the tab strip stopped keeping both frames
alive on macOS. The styleMask change SDL_SetWindowBordered triggers
arrives back as a phantom mouse event that Nuklear reads as a second
click on the same button; the flag flipped twice, the WindowServer had
already added the native title bar, and the app kept drawing its own on
top. The flip is now deferred to the top of the next SDL_AppIterate,
protected by a three-frame lock-out that swallows the phantom, and
followed by SDL_SyncWindow plus a same-size SDL_SetWindowSize to force
the renderer's backing texture to rebuild rather than present the
pre-flip drawable.

reaktor_root() also learned the executable path on Unix (mach-o/dyld
on macOS, /proc/self/exe on Linux), which is what makes running
./build/reaktor from anywhere find its own assets. The old getcwd
fallback stays for the BSDs and other Unices that answer neither of
those calls.

The macOS numbers in PERFORMANCE.md are measured now, and the
prediction that the footprint would sit close to Linux's was wrong:
the Cocoa compositor takes eight megabytes of IOKit, three of
CoreGraphics backing stores, two and a half of IOSurface and about
a megabyte and a half of framework dirty pages before any of Reaktor
is loaded. A one-shot malloc_zone_pressure_relief after the first
frame and a smaller IMG_CACHE trim shave one to two megabytes; the
rest is Cocoa, not the app.

Also: a shell.html favicon, the SDK 11.3 workaround for
CommandLineTools whose default MacOSX12.1 SDK is newer than the
compiler that ships with it, and the ACCESSIBILITY.md sections that
covered the macOS bridge caught up with the fact that it now builds
and runs against real Cocoa (though Accessibility Inspector and
VoiceOver still have not walked it).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-09-09 07:23:37 -07:00
adminandClaude Opus 5 df33dac00c A Linux build, the AT-SPI bridge finally run, and 112 MB that belonged to Mesa
First build of this tree on a free desktop, which found five things that
Windows could not have.

build.sh and build-wasm.sh, the counterparts of the two .ps1 scripts. All the
build logic stays in CMakeLists.txt, as it does there.

reaktor_root() stripped a path component before its first probe. On Windows
the walk starts at reaktor.exe and that strip is what turns a file into its
directory; everywhere else it starts at the working directory, so the one
directory carrying .reaktor-root was the one never tested. Run from the
repository root the app came up with no stylesheet and no icons. Probe first,
strip second - one extra fopen on Windows, which cannot succeed.

SDL wants XScreenSaver's headers at configure time and fails hard without
them, for a code path this app never reaches: main.c allows the screensaver on
purpose. Turned off, so the README's one-liner works on a stock Debian.

auto is now SDL's software rasteriser on every platform, not only where the
adapter turned out to be WARP. And on the free desktops SDL's GL drivers are
compiled out, because X11 initialises Mesa whatever the renderer is: with no
GPU that GL is llvmpipe, a software rasteriser reached through a JIT, and it
cost 53 MB of libLLVM plus 10 of libgallium and 30 of heap. Same binary, same
page, that flag the only difference - 123.6 MB resident to 11.4.

Labels rode low on every 30px control. nk_widget_text centres on the content
rect, which folds back to the button's middle for any padding - but its first
line clamps a negative height to zero and leaves the origin below the centre,
and tiny.css asks for 39.2px of inset on a 30px row. Four and a half pixels,
on everything that height. reaktor_fit_label() trims the padding to what the
row holds, per widget, so taller buttons keep what the stylesheet asked for.
The same arithmetic compact_push() already documented for glyphs, where it
hides artwork instead of moving text.

Tree headers reported a 4px height to the model, because nk_widget_bounds
peeks the current row and nk_tree_push resets it. The focus ring drew as a
thin bar above the label; so did every bound AT-SPI and UIA were told.

Scroll-to-focus was the keyboard's alone, so a reader that moved focus got a
ring it could not see. Shared as focus_reveal().

The web canvas is rounded at the top - the desktop gets that from the window
manager - which exposed a shell that painted the page dark in both schemes.

The AT-SPI bridge has now been built and run. It compiled clean first try
under -Wall -Wextra, against the docs' own prediction that it would not.
Handshake, tree, signatures, Action and GrabFocus all check out; GetAll still
answers {} and GetExtents still answers in window coordinates, both of which
were predicted. ACCESSIBILITY.md is rewritten around what was measured, and
its phase-4 sketch now matches the three signatures that actually exist.

DEVELOPMENT.md said the app loads reaktor-icon.png and explained at length
why, while the constant names the .svg and the section's own last paragraph
agreed. Corrected, along with a branding/ inventory that counted six files in
two inks where there are three in one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-08 22:53:06 +02:00
adminandClaude Opus 5 35000db86a Reaktor, and seven functions nobody was calling
The project is renamed. Curie becomes Reaktor everywhere it appeared: 1462
occurrences across 41 files, in three spellings, plus five files whose names
carried it - the root sentinel, src/curie.h, and the three branding marks. The
CMake targets go with them, so the binary is reaktor.exe and the page is
reaktor.html, and so do the environment variables, which are REAKTOR_TAB and
the rest now. Nothing under third_party/ was touched; the submodules are
upstream's and stay that way.

The replacement was case-preserving and checked before it ran rather than
after: the only place "curie" appeared adjacent to another letter was
CurieElement in the macOS bridge, which is ours, so there were no words to
break. Afterwards the tree was swept for any spelling that survived, including
inside the binaries, and none did.

Ahead of that, the dead code. Seven functions were defined, declared in a
header, and called by nothing:

  curie_glyph and curie_link      one-line pass-throughs to icon() and
                                  text_link(), which every caller uses directly
  curie_snap_shutdown             the snapshot's teardown, from a design where
                                  the platform API had one; it has init, push
                                  and drain and never grew a fourth
  curie_css_flatten_text          the from-memory twin of curie_css_flatten,
                                  which is the one the app actually uses
  curie_unpx and curie_px_rect    the unused half of the scale helpers
  curie_svg_surface               a convenience wrapper naming an Ionicon,
                                  where every caller has a path already

The web bridge's two exported functions look the same to a search and are not:
curie_a11y_web_activate and curie_a11y_web_focus are EMSCRIPTEN_KEEPALIVE and
called from JavaScript. They stay.

Two documented claims had gone stale and were corrected rather than renamed
around: ACCESSIBILITY.md listed curie_link among the wrappers a page uses, and
the README described branding/ as holding two inks when it holds one mark in
three formats.

Off disk: the .obj files and the gen/ directory left at the root by the
hand-rolled cl.exe build that CMakeLists.txt replaced - flatdump.obj outlived
the source file it was built from. .claude/settings.local.json is local
configuration and is now ignored rather than sitting untracked forever.

Checked, not assumed. Both builds run clean from scratch: the native binary
links and starts, and its accessibility tree dumps twenty-seven nodes with the
window and its title now reading Reaktor, which is the end-to-end proof that
the renamed .reaktor-root sentinel still resolves and the assets under it still
load. The model's golden test passes. The web build links reaktor.html with an
86 KB data package, so the asset and icon globs still match at their new paths
- that number is the one that went to 903 KB the last time they did not.

One cosmetic consequence, left alone on purpose. "reaktor" is two characters
longer than "curie", which pushed 55 lines from 80 to 83 columns in a tree that
otherwise wraps at 79. Rewrapping them would have meant reflowing whole comment
paragraphs and hand-breaking half the code lines, which would bury a rename
that is currently reviewable by reading one substitution. It is a separate
pass if it is wanted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-08 19:29:48 +02:00
adminandClaude Fable 5.1 5bc59f837e Keyboard focus that scrolls, a tree served to the browser, and a renderer that picks the cheap path
Accessibility phase 3 is finished. Focus moves at the key, against the tree
of the last drawn frame, so keys faster than frames each move once - two
Tabs before one frame used to merge into a single move, and the count
wandered with timing. A focused node outside the page's visible band scrolls
the page to it on the next frame; only nodes inside the page ask, which the
tree answers by ancestry. The keypad arrows count with Num Lock off.

Phase 4a serves the tree to a browser: src/a11y_web.c mirrors it into
hidden DOM over the canvas, one element per node with the ARIA role, name,
states and position, rebuilt in tree order whenever a frame reported a
change and left alone otherwise. Focus is announced through
aria-activedescendant rather than moved, so keys keep reaching the app; a
reader's press and move come back through two exports and become the same
click and focus a key would make. The shell page keeps Tab on the canvas.

`auto` now takes SDL's software renderer when the Direct3D adapter is WARP.
A frame costs 7-12 ms of CPU there against 78 on WARP; waving over the
Buttons page is 3% of four cores where it was 11-16%, a held button 3.9%
where it was 11-18%. PERFORMANCE.md is re-measured on that default. A GPU
keeps its renderer; a named driver is never swapped.

On the way: the login field takes the button's radius, an inset fill and a
proper text inset; its border is a stroke, since the software renderer
draws Nuklear's fill-ring borders as square corners. Property steppers and
tree headers draw the Ionicon chevron instead of Nuklear's hairline one.
The Buttons page shows Ionicons rather than nk_button_symbol. The Popups
menu bar has a rounded frame that fits its fill, and its items sit centred.
Window controls take --text-main on the light scheme. The titlebar switch
is not drawn on the web.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-07 22:53:25 +02:00
adminandClaude Opus 5 bd6700c027 A tabbed shell with a control showcase, and a WebAssembly target
The app was one login screen. It is now seven pages behind a tab strip:
the card as it was, five that put every Nuklear widget on screen under
the same stylesheet, and a diagnostics readout. src/ui.h is the seam -
App stays an opaque pointer and a page gets fonts, icons, hover
registration and the CSS-styled button and field, nothing else.

Drawing all of them was the point. tiny.css is classless, so a slider,
a knob, a chart or a scrollbar has no rule to read and must be styled
from the palette tokens instead. apply_widget_style() is that half of
the seam; src/style.c remains the rule half. Doing it for every widget
is what showed where the line falls - and that six selectors were going
unread: select, details, summary and dialog now style the combo, the
tree and the popup frame.

WASM works. The same sources, built with emcc: the assets are packaged
into Emscripten's filesystem at the paths the code already asks for
(curie_root answers "" there), the canvas fills the page, and the
bundle is 1.3 MB - CMake packages only the four files and eighteen
icons the sources actually name, against a 1 MB font directory where
one font is loaded and 1357 SVGs where twenty are drawn.

One bug had to be found first, and it was in Nuklear's defaults.
nk_button_behavior ends in nk_input_is_mouse_pressed - (down &&
clicked) - so a button needs a frame drawn while it is still held. A
desktop click gives it one; a browser delivers mousedown and mouseup in
the same task, so the single frame drawn for a whole click sees down=0
and nothing fires. Every button, tab and link on the web build was
inert. NK_BUTTON_TRIGGER_ON_RELEASE is also the better default on
native: press, change your mind, drag off, let go, nothing happens.

Hover tracking was rebuilt around that. hot_last held an index into an
array refilled every frame, so opening a menu shifted every index and
crossings were missed at random; it compares rects now. Regions can be
marked as belonging to a popup, which outranks whatever it covers, and
as following the pointer, which a tooltip needs.

Open-Color is gone. Its only remaining users were the app mark and the
executable icon, and the palette has come from tiny.css since the
Nuklear rework - a whole submodule and a JSON scanner for two lookups.
Inside the window the mark follows --links; the .ico takes CURIE_BRAND,
because the desktop draws it before any stylesheet exists.

SDL is pinned to release-3.4.16. It was tracking an untagged commit on
main.

Memory: the font atlas was 1024x512 RGBA - two megabytes, and the
largest allocation by an order of magnitude - because six sizes were
baked at 3x2 oversampling. Horizontal offsets are the ones that matter
for horizontal text, and nothing ever asked for the 23px step, so it is
1024x128 and half a megabyte. The process went from 13.3 MB to 9.7 MB.
The diagnostics page reports all three figures, so the next such
question is answerable without guessing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 14:39:08 +02:00