A full audit of Reaktor's own sources: section banners, return-value and
parameter notes, and descriptions of what a function does are gone. What
stays records a library, OS or browser quirk, a threading or lifetime rule,
or a license. Two comments that still named libdbus are corrected. Code is
unchanged; the vendored nk_sdl3_renderer.h keeps its own comments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
reaktor_fill_round and reaktor_fill_gradient lay out their corners and runs
through one routine; the button's per-state ramps need no separate flag; the
two background properties emit the gradient through one call. Pixels and
--a11y-dump unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
background and background-image take a two-stop linear-gradient() run to a
side or a multiple of 90deg; background-color leaves it in place, as in CSS.
reaktor_style carries it as gradient, gradient_from and gradient_to, and bg
falls back to the first stop where nothing draws it. A rounded gradient is the
corner masks cut into texel strips along the run, each tinted where it sits,
and multi-color runs between them, so its edge is as smooth as a solid fill's
on the software renderer. reaktor_fill_gradient draws one for an application.
Requested by PapayaPlayer (#104, item 1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The engine parses every selector when the sheets load and a rule's
declarations the first time a query matches it. Loading the sheets takes
0.16 ms instead of 0.35, and the first round of queries on top 0.21 ms
instead of 0.33. A sheet can be added after the others: the role sheet is
appended with reaktor_style_add instead of loading every sheet again.
Diagnostics and the Inspector show where startup goes: the window, the
font atlas and the first frame, beside the stylesheets.
REAKTOR_SDL_D3D, on by default, builds SDL's Direct3D 11 and 12 renderers;
off, a program is 105 KB smaller and draws in software only. MSVC builds
with /Gw, so unused data goes as unused functions do: 24 KB off the small
programs, 96 KB off the showcase. DOCUMENTATION steers away from direct3d11,
whose CPU is in SDL's renderer or the driver, and the chart drops it.
Against the libcss build, measured in one session with the clock pinned,
old and new alternating: private memory is 0.16-0.28 MB lower everywhere,
direct3d11 frames a little faster, and the rest the same within noise.
PERFORMANCE.md carries today's sizes, memory, frame times and WARP, with
the frame-time method written down.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
core/css/css.c reads the stylesheets once into typed values and cascades
them as CSS does: !important, then specificity, then source order. It takes
var(), color-mix(in srgb, ...), em and rem, calc() over pixels, the @media
features Reaktor answers, @import at the top of a sheet, :not(), :enabled,
attribute selectors read as classes, descendant and child combinators, and
escapes. Rules are bucketed by the last compound of their selector, so a
query checks only the rules that could match. cssflat.c, LCUI's libcss and
yutil, and the lcui submodule go.
Screenshots of every showcase tab, notepad and simple, light and dark, with
normal and more contrast, are byte-identical to the libcss build, with
Water.css and with Simple.css; --a11y-dump differs only in the a11y struct's
size. Three values change to what CSS says: an unset background is
transparent black, an unset border color is the text's, and Simple.css's
:enabled:hover no longer reaches a disabled button. Against libcss, loading
the sheets takes 0.35 ms instead of 1.24 and a first query 0.32 us instead
of 4.4. csstest covers the cascade, values, @media and hostile sheets: import
loops and fan-out, var() that grows or expands too often, deep calc(), a sheet
left open, a huge file. 200,000 mutated sheets ran clean under AddressSanitizer.
Simplifications: dead state (redraw_always, sw_noaa, the hover-gap pin, a
muted note, an overwritten slider range, the font-baking blocks of the SDL
renderer, the a11y change index); REAKTOR_LAY_FILL for FILL_X | FILL_Y; one
helper each for flag parsing, capture runs, timings, paths from the working
directory, array growth, focus moves, tooltips, button presses, a11y slot
probes, UIA fragments and test strings; launchtest's notef() and last_node();
the output folder set once in CMake and a write-if-changed function; one test
list, tools/ci/tests.txt, for every workflow, so basetest and imagetest run.
The showcase drops its relaunch button, an ask() button is as wide as its
label, and build.sh takes a bare target. The docs follow, and PERFORMANCE.md
and the chart carry a new pass of all seven benchmark arms on one machine.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
NOTICE gains FreeType's row and the credit its license asks for, and loses
stb_truetype. DOCUMENTATION drops the Nuklear traps that went with its font
baking. A comment in cssflat.c no longer holds the two characters that open
one.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The tree's jump to a parent checks the parent against the tree's count, not
the list's. A font's name table is checked in reaktor_font_valid, before
Nuklear reads it, in place of the late check in text.c.
cssflat.c checks every token with one token_ok, frees in one place in
emit_one, and drops unresolved variables once. UTF-8 cleaning uses SDL's
decoder. The file dialog flag becomes file_busy, freed by reaktor_app_free.
urltest becomes basetest and holds the UTF-8 checks.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A stylesheet could crash or stall the app:
- calc() nested deeper than 32 levels overflowed the stack; such a
declaration is now dropped as invalid.
- A sheet importing itself, directly or through others, loaded until the
app hung. As in Blink, an import of a sheet already in the chain above is
skipped, and no import starts once the flattened sheet passes 4 MB.
- var() fallbacks nested without limit, and variables built from variables
could grow to gigabytes. A value whose source or result passes 4 KB is
left unresolved, as CSS Values 5 asks of overly long substitutions, and a
declaration still holding var() after substitution is dropped.
csstest covers each case; the crafted sheets no longer crash or hang the
showcase, and every showcase page draws byte-identical in both themes.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
libcss copies each token into a 512-byte buffer without a bound. cssflat
kept every emitted declaration under that size, but the engine also reads
'//' or '/*' as a comment that does not end the token, and '}' inside a
value as the end of the block, so the lines after one ran on into the same
buffer: a stylesheet could write past it. A declaration whose value holds
';', '}', '//' or '/*', or whose property holds '}', is now dropped, and so
is a selector with any of them; the engine misread all of these already.
The crafted sheets no longer crash the showcase; every showcase page draws
byte-identical in both themes.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@media (prefers-reduced-motion) and (prefers-contrast) are answered from the
OS (Windows settings, macOS accessibility, the desktop portal, the browser),
reduced motion makes every animation jump to its end, and reaktor.css
strengthens muted text and borders under more contrast. --motion and
--contrast override; --watch-css restyles when a sheet on disk is saved.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A "Nuklear underneath" section on the Display tab uses a Nuklear menu,
tree node, selectable element and right-aligned checkbox, and reads the
style structs and the panel bounds. Writing it found reaktor_tree_element
naming a function Nuklear does not have (reaktor_tree_element_pop is what
was missing), and no REAKTOR_ names for the symbols or for TEXT_RIGHT.
Widgets passed cursors as bare numbers, which is why the text fields'
I-beam looked unused; they are named now. reaktor_style_darken and
reaktor_locale_start move to internal headers, and the two _is_open
queries are documented.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The renderer header loses its debug font, userdata accessors and the
nk_sdl_render wrapper, none of which anything called. Text width, the
#rrggbb formatter, the clear-style push and pop and the end of a drag are
one helper each; ten functions only one file used are static there.
CI: the Windows ccache download draws no progress bar, the macOS embedded
check compiles through ccache, and the emulated Linux jobs run on master
and releases rather than on every pull request.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rendering skips work it repeated: an image is found by a hash before its
path is compared, an SVG that needs no recoloring is read without staging
copies, wrapped text is measured a word at a time, the software renderer
is told once, and an unchanged clip is not set again.
The accessibility tree interns into two pools that take turns, so a full
pool no longer reports every node as new; on Windows the copy a screen
reader reads is not made until one asks. The text-shaping cache keeps what
is on screen when it fills, and its shaper settings drop only the oldest.
color-mix() reads its colors through plutovg, which adds names and hsl().
SDL's dummy video driver is left out on Windows. Six copies of one hash
are one helper, and the icon calls share one path builder.
Linux, macOS, Windows and the web build keep a ccache between runs, with
SDL's precompiled header off so its compiles are cached too; the web job
also keeps its Emscripten SDK.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
libcss's border shorthand parser reads three parsed parts whatever it got,
so a value that parses as one part crashed it: border: unset, initial,
inherit, revert, a lone red, dotted or thin, or junk. The converter now
writes border and border-top/-right/-bottom/-left out as their width,
style and colour longhands, with left-out parts at the values libcss
gave them (0px, none, transparent). unset, initial and revert are no
border; inherit, which the engine cannot express, drops the declaration,
as do invalid values; !important reaches every longhand.
In border and outline values, thin, medium and thick become 1px, 3px and
5px, the lengths CSS gives them; libcss reads a border width only as a
length.
Every showcase tab, simple, notepad and 24 runs with app sheets are
byte-identical to master; csstest gains checks for both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build: Nuklear and its backend compile once, in reaktor_core, instead of
three times; libHaru's CJK encoders and fonts, never linked, are not
compiled; SDL's OpenGL drivers stay out of Windows builds unless
REAKTOR_SDL_GL is on (the benchmark's OpenGL arm passes it); GCC and
Clang builds collect unused sections. Windows executables lose 109 KB.
Runtime: a theme load skips its second CSS pass when the sheets' own
role tokens already say what the role sheet would. Printing renders a
page in four frames rather than seven when it settles.
Housekeeping: the backend keeps its vertex buffers across frames; a
label measures its text only when that sets its width; cssflat walks
rules through one splitter and drops a dead context; the Inspector
redraws only when the tree, a value or the sheets change; bench reads
process memory every 30 frames; apply_widget_style resolves the button
rule once; file_exists asks SDL_GetPathInfo; the layout reads direction
and declared size back from onlay instead of keeping copies.
Shots and dumps of every showcase tab, simple and notepad, 24 runs with
app sheets, and the printed PDF are byte-identical to master.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
reaktor_css_flatten takes the token limit instead of a global setter. A
surface is recorded only once it is drawn. Flat and image buttons share
their press and icon code, and flat ones keep the mapped hover. The
unused inset of push_edit_style is gone, the Inspector draws its icons
through one helper, and the showcase names its strip rounding once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Water.css replaces tiny.css and Bamboo replaces simple.css. cssflat reads
@import, and drops a token too long for libcss or a value with a ';',
which crashed Picnic. reaktor.css maps the tokens Water lacks and no
longer overrides its hover.
A label's color token falls back when it vanishes on the page, an icon
moves to the edge before it is dropped, and a field filled like its card
takes the page's color. Buttons get .flat, for icon-only toolbar buttons.
The Inspector opens from Diagnostics, keeps its actions as flat icons
beside the tabs, and has room around its contents. Notepad's menu bar and
the Translations language row are centered and sized. Screenshots are
retaken.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Names: applications see only reaktor_ names. include/reaktor/nuklear.h
aliases the Nuklear types, constants and calls the samples use, so values
mix freely with nk_*. The samples and public headers use them throughout;
colour and CENTRE are color and CENTER.
Speed: the web accessibility tree moves only the nodes out of place, the
style cache is a hash table with no size cap, wrapped labels keep their
line breaks, and screen-reader lookups in the snapshot are indexed.
Features: reaktor_file_dialog_open (open, many, save, folder, filters),
reaktor_ask, reaktor_timer and reaktor_post, settings with remembered
window geometry, reaktor_list (sheet-styled, only the visible rows, keys
move the selection), reaktor_splitter (drag or arrow keys), .tooltip,
PNG and JPEG through .src, a link's .url, and REAKTOR_CURSOR_*. The quit
confirmation is a reaktor_ask. A root box that fills is as wide as its
panel. Dead code is gone: css_field, unused App fields, duplicate helpers.
Tree: src/ is gone (core/internal.h), core/base/util.h, render/svg.c, the
tests in tests/, assets/css/reaktor.css. app.c hands input to input.c;
declare.c keeps the frame and boxes, controls.c and views.c the widgets.
NukAnim's switch is now nka_set_keep_at_rest.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comments that restated a name, explained a design the docs already
describe, or repeated another comment are gone; what remains names a
dependency's quirk, an ordering rule, or a locale or browser trap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compared against Edge rendering tiny.css and simple.css in light and dark:
fields keep their own border and 4 px corners instead of borrowing the
button's, a field's style picks its colors as well as its size, checkboxes
and radios read the sheet's input rules (a transparent border is no longer
drawn as a white ring), and text with no size of its own takes the body's,
as CSS inherits it. The showcase's login card is drawn as the sheet draws a
details box. When a sheet is laid over tiny.css, tiny's --links,
--background-body and --text-main are given its link, page and text colors
in one more sheet read last, so Reaktor's own chrome follows it.
Rounded corners and border runs are drawn by plutovg as a small rounded
rectangle with a straight middle row and column, replacing our own
supersampling and the patch over its middle texels. The renderer rounds a
sub-image's edges to whole texels, which SDL's software copy truncated a
texel short.
Code that dependencies already provide is theirs now: the executable's
folder (SDL_GetBasePath), loading a file (SDL_LoadFile, freed with SDL_free
throughout), stepping UTF-8 (SDL_StepUTF8), the day of the week
(SDL_GetDayOfWeek), rectangle overlap (NK_INTERSECT) and col_of
(nk_rgba_bv). reaktor_core and localetest link SDL.
The cleanups: accent_hex and REAKTOR_BRAND are gone, the accent button reads
app->accent, calc() numbers are read without the locale, sheet margins are
one loop, part_neighbors uses add_margin and take_margin, and comments that
only restated a name became better names.
mkicon no longer converts the 256 px PNG to straight alpha twice, which
had wrapped its edge pixels into stray colors; the icon is regenerated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A rule's margin now only parts a widget from its neighbors. Across a row or
column it is skipped, since the page sized the box; along it the first
widget's leading margin and the last one's trailing margin are dropped, so a
row of buttons starts and ends where the field below it does, and in a row
that wraps each line starts at the edge. A margin set in code always counts.
The first frame after a stylesheet loads counts as unsettled, so the new
sheet's sizes are laid out before the frame settles.
cssflat.c works out calc() over pixels and plain numbers, drops :enabled,
since every widget that asks is enabled, rewrites a bare [disabled] as
.disabled, and drops a selector that names the same class or pseudo-class
twice in one compound, which made libcss go on using a list it had freed. The
new csstest checks those, and simple.css read through it, in every CI job.
The page and its text come from the body rule, and the accent from a:link,
falling back to --links: accent buttons, sliders, progress bars, checks and
accent icons follow it, and reaktor_page_color and reaktor_accent_color hand
them to an application. Fields read input.type-text, so a sheet's
[type=text] rule reaches them. reaktor_style carries a rule's opacity.
A disabled button reads button.disabled:disabled and is faded by that rule's
opacity, as a browser fades it, instead of having its colors halved toward
black; a sheet that does not tell a disabled button apart gets half. A rule
can give a button's border a color per state, and an icon on a button takes
its label's color. A rounded border's straight runs are cut from mask texels
that hold a straight band, so a one-pixel border with small corners is sharp.
The showcase's login card takes its height from its rows, so a sheet's
margins no longer push the last line out of it, and the showcase's accented
decorations read reaktor_accent_color.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Applications now include reaktor/reaktor.h and nothing else of
Reaktor's: include/reaktor holds every type and call a program uses,
App is opaque, and the internal headers include the public ones instead
of declaring the same things again. The samples prove it: each builds
from the public headers alone, MSVC refuses an implicit declaration in
any app, and the showcase draws every page as before. Where they reached
into App there are calls now: the SDL window and renderer, the theme,
the borderless titlebar, focus areas, SVG icons, and the frame and
process timings.
The libreaktor target merges Reaktor, its modules and every dependency
into one static archive, and the libreaktor install component lays it
out with the public headers, Nuklear's and SDL's, a CMake package
(find_package(reaktor), reaktor::reaktor), a pkg-config file and the
licenses. Added with add_subdirectory, Reaktor builds no samples or
tests and installs nothing unless asked. examples/consumer builds Simple
against an installed package.
Every workflow builds, installs and links libreaktor and checks that the
consumer's Simple draws exactly what the tree's does. Releases gain a
libreaktor archive for every system and architecture, and SHA256SUMS.
The version is 0.2.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A window opened with reaktor_window_open now runs as its own App: an input
queue that takes one change a frame, a wake of its own, its keys and dropped
files through the key hook and file_opened with its App, animations scoped
to it, and its accessibility tree served to UI Automation under its own
handle (NSAccessibility and AT-SPI still serve the main window only).
Closing one frees its layout, undo, icon cache and queue, and one closed
while its file picker is open is kept until the picker answers.
reaktor_set_title retitles the window whose App it gets, and a theme set
from any window applies to every window.
Nuklear's own rounded fills are swapped for masks once the command list is
built, so fill anti-aliasing stays off on every renderer without jagged
corners on the GPU ones. GTK's setlocale under the tray is undone,
stylesheets parse under the C numeric locale, and cssflat reads and writes
numbers and colors without the locale, clamping NaN and huge channels. A
font is checked table by table before stb_truetype sees it, and a --font
that cannot be read falls back to Aileron. A missing icon draws as nothing
rather than a white square, and an icon-only button draws its icon through
its CSS look. On the web, the page's key event no longer takes the event
type every wake pushes.
The BSD jobs: SDL's dlopen notes are left out on the BSDs, as OpenBSD
refuses a program whose note segment passes 1 KB; libm is linked into every
target on Unix rather than plutovg alone; and the smoke run picks its video
driver with the new --video flag instead of an environment variable.
.confirm_close and reaktor_set_confirm_close ask a question in a modal
floater, with Cancel and Quit, before a quit that closing could refuse,
bringing a minimized window back to ask it; the showcase's Popups page turns
it on. The sidebar takes copy-outline for Layout, chatbubble-outline for
Popups and color-fill-outline for Styling. Comments are trimmed again to the
ones that guard a trap, the screenshots are retaken, and PERFORMANCE.md's
module sizes and UI Automation count are measured again.
Verified: the seven tests pass, the 24 launchtest hold probes match the
last run, and new launchtest modes cover a window's keys, drops, animation,
title, theme, wakes, one change a frame, a drag, 200 open-and-close cycles,
its picker and a close under it, and the question both answered and
canceled. Each step was diffed against the previous sweep of every page in
both themes; the last differs only by the Popups page's new section and the
Diagnostics page's live numbers, and the accessibility-off build draws
byte-identical pixels and dumps. The web build passes its typing harness
and the wake, floater and toast checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An application now owns main and makes one call, launchApp, declared in
include/reaktor/launch.h with its hooks (page, start, key, closing, stop,
file_opened) and the quit reasons platform/lifecycle reports: the window, the
app, the console, a signal, the session.
Above the page sit floaters, dialogs inside the main window whose modal kind
holds everything under it, and toasts. reaktor_window_open opens real windows
with their own renderer, and reaktor_tray_open puts the icon in the system
tray with a menu; SDL's tray is built again for it. reaktor_sidebar and
reaktor_tabs share one spec. The showcase moves its pages into a sidebar, with
the scheme and the titlebar switch at its foot, around a rounded panel, and
its tray menu shows the window, sends a toast and picks the theme.
Along the way: the icon cache gives up its stalest slot instead of drawing
white squares once full; a toast honors each side's padding; the click that
activates a window lands everywhere but macOS; cssflat works out
color-mix(), which reaktor.css uses for stronger light hovers and a tinted
current sidebar entry; the web link reads its asset list from a response
file, which had outgrown cmd.exe. Comments are cut to the few that guard a
trap, and every Markdown file is rewritten, DOCUMENTATION.md with a catalogue
of every widget, container, layer and helper.
Verified: the seven tests and lt3 pass, and the 24 launchtest hold probes give
their expected results. Every page in both themes was reviewed by eye and
diffed against the last baseline's accessibility dump, which lost no node.
The web build was captured on four phone configurations, with the Android
typing harness passing 62 of 62 checks; the tray menu, toasts and secondary
windows were driven through Win32 and UI Automation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
The Styling page claimed that swapping tiny.css for simple.css changes the
application. It changed the colours and nothing else, and the accessibility
dump proved it: byte-identical with the sheet swapped. Six things had to be
true before it moved.
* Read the whole box. resolve() took padding-left and border-top and threw
the other six sides away, so `padding: 4px 12px` rendered as 4px round.
* Size from the rule. Every widget's height came from the page - .box.h =
30 - and CSS could only decide where the label sat inside it. It is the
CSS box model now: content, padding, border, with min/max as bounds and
the sheet's margins applied.
* Compute em against the sheet's own base. cssflat converts em and rem
itself, because libcss has no such unit, and it read the base from
`html { font-size }` alone. simple.css sets it on body - 1.15rem, 18.4px
- so every length in that sheet came out 15% small.
* Type from the rule. Ten call sites said reaktor_font(app, 13, 0); they
name a selector now, and .api-line stopped being dead weight in our own
sheet.
* Attribute selectors reach a widget. cssflat rewrites input[type=range]
into input.type-range rather than discarding the rule, which is what it
used to do with most of a document sheet's control styling.
* :hover and :active are read rather than computed. :hover supplied a
background and :active nothing at all - it was the base colour ten per
cent darker, which is a decision a stylesheet is entitled to make.
Measured against the browser's own computed style on simplecss.org/demo:
padding 9.2, border 1, radius 5, margin 0 0 8 0, type 18. We agree on all
five now; we did not agree on any of them before.
Then /code-review at max effort over the result, ten angles. Fourteen of its
fifteen findings are fixed here, the worst of them mine from earlier in the
same work:
* resolve() handed CSS percentages back as pixel counts. simple.css puts
`max-width: 100%` on every control, so max_width came back as the float
100 and would have clamped any text-sized widget to a hundred pixels.
Every length passes a unit gate now.
* A narrow rule replaced the element rule instead of cascading under it, so
`input[type=range] { padding: 0 }` cost the slider all of input's box.
That 37px-to-18px change was demonstrated as a feature; it was half a bug.
* The base style cascaded html and then body into one computed style, which
erased the first pass and leaked font_family on every theme change.
* line-height told a ratio from a length by being under 4. libcss already
tags it, and `line-height: 150%` was becoming a 150px line box.
* base_length trusted any unit it did not recognise as pixels: 12pt read as
12, and `1.15rem !important` as 1.15.
* font-weight worked at exactly one size, because the bold face was baked
once at 16px - so the h4 and th rules added by this very work rendered
regular. Bold is baked at every step now: atlas 512 KB to 1024 KB,
private memory 6.9 to 7.4 MB. That is the price of the feature existing.
* reaktor_fill_round seamed. Cutting a rounded rect into pieces in floats
and letting the renderer snap each one could round two edges apart and
leave the row between them unpainted. It snaps the shape first now, so
the pieces meet exactly - and the three non-overlapping bands could come
back, which also stops a translucent colour being composited twice.
The fifteenth is skipped and said so: five selector resolutions per button
per frame is waste, not a defect, and the cache has headroom.
Also here, and unrelated except in time:
* No environment variables. All 21 reads are gone; getenv appears nowhere
in our sources. The two that were verification tooling rather than
settings became flags - --shot, --a11y-dump, --theme, and --tab/--scroll
through sample_args - taken out of argv before the application sees it,
so the notepad still opens the file named on its command line. Deleting
the overrides collapsed what they guarded: the renderer block was thirty
lines choosing between five modes and is now two.
* third_party is external, moved with git mv so the eight gitlinks follow.
* British spelling to American, 113 replacements. Seven identifiers went
with it, two of them public: reaktor_colour_spec and reaktor_colour_pick
are reaktor_color_*, and REAKTOR_CENTRE is REAKTOR_CENTER. LICENSE and
the font's notice are untouched - editing a licence's words is not a
spelling decision.
* README gains a pitch, a development warning, a Features list and a
smaller Usage sample that was compiled before it was published; the three
applications move to docs/DEMO.md.
Clean build, five tests, and every page under both sheets and both schemes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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>
Stages 00-05 of the declarative refactor. Nothing about how the
application looks or reads has changed: all 14 accessibility dumps
(7 pages x 2 themes) still match, to the pixel.
Structure. src/main.c is gone, split by function rather than by
platform: core/{a11y,base,css,render,ui}, platform/a11y, runtime,
samples, tools. No library header names a sample type any more -
showcase_state, the tab enum, reaktor_tab_names, set_tab and the
REAKTOR_TAB/REAKTOR_SCROLL reads all live in samples/ now.
Onlay. A layout engine forked from randrew/layout (MIT), in onlay/,
bound for its own repository. Plain C99, because upstream needs C++
under MSVC; plus weighted tracks with floors, and gap. Grid needed no
code at all - rows carrying the same weights put their columns in the
same place. 231 diff lines against upstream, each marked ONLAY:.
Keyboard. core/ui/keys.c matches a chord exactly and ignores Caps,
Num, Scroll and AltGr, which fixes two live bugs: Ctrl+Alt+Tab fired
the Ctrl+Tab binding, and Caps Lock spoiled it. Bindings are a table
in samples/shortcuts.c, and the runtime's 23 lines of them became 2
of dispatch.
Announced. A node carries its chords as one ARIA string and all four
bridges publish it: aria-keyshortcuts, UIA AcceleratorKey, the AT-SPI
keyshortcuts attribute, AXKeyShortcutsValue. Read back through a real
UIA client on Windows. Publishing the table also forced a binding
change - Cmd+Tab is the macOS app switcher and Win+Tab is Task View,
so neither ever reached the app, which was survivable until the table
began telling a screen reader what works.
BSD. All three BSDs now report resident memory through sysctl, and
FreeBSD and NetBSD find their install path the same way. OpenBSD
exposes no such path by design, so it reconstructs one from argv[0]
and checks it before believing it. None of that is compiled here:
there is no BSD on this machine.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>