kinogaki-ui
kinogaki-ui — audit issues
Audited 2026-06-20. Repo: libraries/kinogaki-ui. Criteria: completeness · tests · separation of concerns · verb-named functions · file size (<1000 lines) · organization.
Health summary
This is the healthiest of the kinogaki libraries: it builds clean (-Wall -Wextra) and all 71 test cases / 228 checks pass, with broad widget coverage (containers, leaves, list/tree/table, curve/ramp editors, popups, docking, keymap). Separation of concerns is genuinely good — Canvas speaks only to the platform RHI, widgets reach their host through a narrow WidgetHost seam, Theme is fully abstract, and the impl is sensibly split (Widgets.cpp = controls, Layout.cpp = containers, shared private WidgetsCommon.h). No source file exceeds 1000 lines and none exceeds 800. The real gaps are: a substantial fully-built TextEdit widget that is orphaned (unused, untested); vestigial Phase-0 "scaffold" stubs (Gpu.h/Gpu.cpp/scaffold_test.cpp) left behind now that the drawer is Canvas; and stale Prisma*/Prism* naming throughout CMakeLists plus old-named binaries littering the build dir.
Issues
[MEDIUM] completeness — orphaned, untested TextEdit widget with stale Phase-0 scaffold left in tree
- Where:
include/kinogaki/ui/TextEdit.h:1-294;include/kinogaki/gpu/Gpu.h:1-11;src/Gpu.cpp:1-7;tests/scaffold_test.cpp:1-14 - Problem: Two opposite completeness problems coexist. (1)
TextEditis a fully-implemented, 294-line header-only multi-line editor (UTF-8 caret motion, word-wrap visual-row layout, mouse selection, clipboard, full keyboard editing) — yetgrepfinds zero references to it anywhere insrc/,apps/, ortests/. It is dead weight that nobody builds against, with a lot of subtle, testable logic that is completely unverified. (2) Conversely,Gpu.h/Gpu.cppare a vestigial Phase-0 placeholder:gpu::version()returns"kinogaki-gpu 0.1.0 (scaffold)"and the header comment still reads "Phase 3 fills this in; this placeholder pins the module" — but Phase 3 shipped as the realCanvas.scaffold_test.cpplikewise still says "Real tests arrive with the drawer (Phase 3) and the widget tree (Phase 4)." These stubs no longer pin anything. - Fix: Either wire
TextEditinto the demo + add tests for its UTF-8/wrap/posAt/selection math, or delete it until needed (don't ship dead code). DeleteGpu.h/Gpu.cppand fold the survivingui::version()smoke check into a real test (or dropscaffold_test.cppentirely); at minimum rewrite the stale comments.
[MEDIUM] tests — the largest pieces of testable layout/state logic are untested
- Where:
include/kinogaki/ui/TextEdit.h:148-211(relayout/posAt/selectWord/deleteSel);include/kinogaki/gpu/Draw.h(bézier/arc/gradient tessellation);src/Layout.cpp(Column/Row/Grid/Field/ScrollView/TabWidget arrange math) - Problem: Test coverage is good for widget state (clicks, drags, toggles) and rendering smoke, but the most error-prone pure-logic surfaces are skipped.
TextEdit's word-wrap visual-row builder and mouse→(line,col) hit-test are non-trivial and entirely untested (see issue above).Draw.h's CPU tessellation helpers (cubicBezier,fillCircle, gradients) have no tests despite being deterministic and trivially checkable. Container arrange math (flex split is tested for Row, but Grid row-major placement and ScrollView content-height/thumb math get only light coverage) is exactly the kind of math that regresses silently. - Fix: Add unit tests for
Draw.htessellation (segment counts / endpoint placement),TextEditwrap+posAtround-trips, and explicit Grid/ScrollView geometry assertions. These are GUI-adjacent but fully testable without a window.
[LOW] organization — stale Prisma/Prism naming in CMakeLists and old-named binaries in build dir
- Where:
CMakeLists.txt:12-13,16,18,36-37,43,53,56,59,61-65(PRISMAUI_*options/vars);build/PrismaUiDemo,build/PrismUiDemo,build/prismaui_tests,build/prismui_tests(untracked, gitignored);include/kinogaki/ui/Build.h:5-7,apps/KinogakiUiDemo/main.cpp:32,tests/build_test.cpp:29("prisma"sample strings) - Problem: The rename to kinogaki is incomplete in the build definition: every CMake option and variable is still
PRISMAUI_BUILD_TESTS/PRISMAUI_SOURCES/PRISMAUI_WARNINGS, even though targets areKinogakiUI. The localbuild/dir holds stale binaries from the old names (PrismaUiDemo,PrismUiDemo,prismaui_tests,prismui_tests) alongside the current ones — harmless (gitignored) but confusing cruft. Demo/test sample text still uses"prisma"as a placeholder field value. - Fix: Rename the CMake
PRISMAUI_*identifiers toKINOGAKIUI_*.rm -rf build/to clear the stale binaries (orgit clean). Swap the"prisma"sample strings for neutral placeholders.
[LOW] naming — a handful of noun-named query helpers
- Where:
include/kinogaki/ui/Popup.h:88(itemAt);include/kinogaki/ui/Popup.h:133,156/155(buttonRect,fieldRect);include/kinogaki/ui/TextEdit.h:181(posAt); privatetabAt/segAt/rowAt/titleAt/tabW/titleWacrossWidgets.h/Widgets.cpp - Problem: A small set of geometry-query methods read as nouns rather than verbs (
itemAt,posAt,buttonRect,fieldRect,tabW). They return "the thing at/of X" so the intent is clear, but they don't read as actions. The vast majority of the API is cleanly verb-named (drawButton,openMenu,captureMouse,requestRedraw,setControl), so these stand out. - Fix: Optional polish — rename to verb forms where worthwhile (
itemAt→hitItem/findItemAt,buttonRect→computeButtonRect/rectForButton). Low priority; current names are unambiguous.
[LOW] separation — clean
- The drawer (
gpu::Canvas, talks only toplatform::rhi), composite helpers (Draw.h, free functions kept off Canvas to keep it lean), widgets (reach the host only through the narrowWidgetHostseam), layout (two-phasemeasure/arrange), and theme (fully abstractThemeinterface) are cleanly separated. No god class; the impl is split deliberately (Widgets.cpp = controls, Layout.cpp = containers, privateWidgetsCommon.hfor shared internals). No platform/core internals leak through public headers. Thekinogaki::gpu/kinogaki::uinamespace split is enforced in the headers as the README claims.
[LOW] filesize — clean
- No source or header exceeds 1000 lines; none exceeds 800. Largest sources:
src/Widgets.cpp(568),src/Popup.cpp(420),src/Dock.cpp(375). Largest headers:include/kinogaki/ui/Widgets.h(403, mostly declarations + doc comments for ~26 widgets),include/kinogaki/ui/TextEdit.h(294, header-only impl). All within reason for the responsibilities they carry.