3859 Commits
Author SHA1 Message Date
Liu 1b8c8ef6bd chore(release): 3.0.0-alpha.2 v3.0.0-alpha.2 2026-11-24 22:01:30 +08:00
Liu b309800d3e build: allow release scope in commit message check
.npmrc uses chore(release): %s again, and the commit-msg hook accepts
"release" alongside lib/ directory names, styles and widgets.
2026-11-24 22:00:47 +08:00
Liu 08778d8bf6 fix(yutil): strlist_sorted_add should not leave a dangling list
realloc() may move the array before the duplicate check returns
early, leaving *strlist pointing at freed memory. Assign the new
pointer before inspecting entries.

Refs GHSA-v42w-m2h7-fm23.
2026-11-24 21:49:21 +08:00
Liu d57350e286 fix(ui-xml): resource node should reject missing type attribute
ui_builder_parse_resource_node() only rejected the case where both
type and src were absent, then passed a NULL type to strstr(). Require
type before dispatching on it, release attributes through the existing
exit path, and check src before loading a font.

Fixes GHSA-xr82-f9q8-h384.
2026-11-24 21:49:20 +08:00
Liu ec5cd503fa fix(css): oversized selectors should not overflow parser buffers
- Cap the token buffer position across chunked input so a selector
  spanning 511-byte reads cannot write past css_parser_t::buffer.
- Reject selector names longer than MAX_NAME_LEN in
  css_selector_create() instead of writing past name[].
- Bound selector name composition in css_selector_collect_name()
  with explicit length checks.
- Fix trim-left in css_parser_commit() reading buffer[pos] instead
  of buffer[i] and moving the wrong number of bytes.

Fixes GHSA-v42w-m2h7-fm23.
2026-11-24 21:24:49 +08:00
Liu c09223932f docs: specify the CPU rendering benchmark 2026-11-24 21:03:46 +08:00
Liu 3d97970efe ci: restrict commit scopes 2026-11-22 23:51:44 +08:00
Liu ced0bd2a52 ci: attach example archives to release assets 2026-11-22 22:14:30 +08:00
Liu 539e3b28a5 chore(release): 3.0.0-alpha.1 v3.0.0-alpha.1 2026-11-22 21:59:41 +08:00
Liu cd987b81d0 chore(release): add npm version lifecycle script
- sync versions.json, xmake descriptors, generated headers and the CI TARGET_* values from the version npm just wrote
- generate the commit summary into CHANGELOG.md; human-readable notes are written manually on the Releases page
- drop CHANGELOG.zh-cn.md and the automatic release-notes step
- preserve CRLF in sync-versions so --check passes on Windows
2026-11-22 21:59:12 +08:00
Liu f0577b64ba ci: update GitHub Actions to Node 24 runtimes 2026-11-22 21:02:56 +08:00
Liu 429df6a39b chore(doc-viewer): regenerate the demo code snippets
- pick up the sidebar and input-group placeholder text changes
2026-11-22 20:11:24 +08:00
Liu 5b18848ef9 fix(ui): size flex lines by content in fixed-size containers
- subtract the line content height, not the container text sizehint, when
  distributing cross-axis free space
- center icons correctly in text-based flex containers such as empty-media
- pin the empty-media icon to a 16px box
2026-11-22 20:11:23 +08:00
Liu 3270d8f34f fix(examples): make the fabric demo DPI-aware and fit the window
Run the simulation in a fixed 800x600 world and map it into the widget with an object-fit: contain viewport, so rendering and mouse hit testing share one transform. Derive the draw scale from the canvas buffer and content box because the global scale read in the timer callback does not match the buffer DPI. Let the canvas fill the window instead of a fixed size and keep the fabric world unchanged on resize.
2026-11-22 20:11:23 +08:00
Liu 8948f14c9f docs(examples): remove the shadcn branding from the demos
- use username for the sidebar user menu
- use example.com/username in the input-group button placeholder
- apply the change to the C, XML and TSX variants
2026-11-22 20:11:22 +08:00
Liu b7a5779b61 fix(widgets): keep the sidebar footer menu in flow
- fill the provider height so the footer stays inside the sidebar
- overlay only action menus instead of every menu inside a menu item
- mark action menus with sidebar-menu-action-menu in the demos
- assert the project action layout still overlays its row
2026-11-22 20:11:22 +08:00
Liu 1a030c3a48 fix(styles): keep the focus ring out of grouped inputs
- reset the generic textinput ring on input-group children
- match the accent override specificity in both light and dark modes
- cover the grouped input reset with a test
2026-11-22 20:11:21 +08:00
Liu 63ed1be359 style: drop the pointer cursor from buttons and scrollbars
- keep the default cursor over buttons, select triggers and scrollbars
- update the cursor test for the new button default
2026-11-22 20:11:21 +08:00
Liu 747a222fcc feat(styles): follow the accent in focus rings and app fills
- generate focus box-shadow overrides from the accent primary color
- add the fill-primary class for app-level primary fills
- use it for the doc-viewer payout progress bar
2026-11-22 20:11:20 +08:00
Liu 90dbba2cdd feat(widgets): migrate textinput editing to the stb_textedit kernel
- vendor stb_textedit and add the textedit core with canonical text
- map edit indices to pd_text layout for caret, selection and hit testing
- support caret movement, selection, clipboard, undo/redo, password,
  read-only and multiline editing
- render selections with the accent color and configurable text color
- fix caret scaling, input-group repaint and zero-size reflow regressions
- add integration tests, a preview page and internals notes
2026-11-22 20:11:20 +08:00
Liu b0c031f8dc feat: add window icon support
- Add ptk_window_set_icons with Win32 WM_SETICON, X11 _NET_WM_ICON and fb no-op.

- Add LCUI window/default icon APIs, DPI-aware HICON selection and pre-rendered built-in icon assets.

- Add pandagl memory image readers and fix bilinear zoom edge sampling.

- Cover file/data icons, defaults and high-DPI sizes with integration tests.
2026-11-21 23:26:34 +08:00
Liu dc0ab38546 feat(styles): add switchable accent color themes
- generate an override stylesheet for each preset from style-nova
- add the ui_theme_* API, custom colors and single-slot loading
- persist the choice and add the navbar color picker
- keep badge variants, tooltip arrows and swatches consistent
2026-11-21 23:26:31 +08:00
Liu 64ea750885 feat(css): allow unloading style rules by source
- track rules by the source name passed to the loader
- add css_remove_style_rules() and ui_unload_css_string()
- refresh computed styles after removal and cover it with a test
2026-11-21 22:23:12 +08:00
Liu 2c4958b427 feat(doc-viewer): show repository icons, star counts and version badge
- add monochrome GitHub and Gitee assets with light/dark CSS backgrounds
- replace the GitHub text link with icon links for both repositories
- fetch and cache repository star counts at build time and render them
  beside the icons when available
- abbreviate counts of 1000 or more as `Nk` and separate the navbar
  actions with vertical dividers
- move the version number from the navbar to a badge below the Home title
- harden the star script for cold checkouts: root-relative paths, request
  timeouts, cache fallbacks and CI coverage
2026-11-21 20:53:30 +08:00
Liu 331e07840a fix(styles): correct card action and title class selectors 2026-11-21 19:42:40 +08:00
Liu dbc3eaf20e docs: add the doc-viewer navbar icon and star design 2026-11-21 19:27:19 +08:00
Liu 83c1c6d07d feat(styles): add class variants for badge, alert, item and card 2026-11-21 19:22:43 +08:00
Liu 0b63de799f fix(doc-viewer): demo code tabs should show a visible hover background
- use a foreground overlay instead of `bg-muted`, which matched the code
  header background exactly
- add a pointer cursor to the clickable tabs
- add a regression test for light and dark hover
2026-11-21 18:53:16 +08:00
Liu 1a6c3100e2 fix(styles): dark button variants should stay flat
- reset the border color under `.dark` for the primary, ghost, destructive
  and link variants, so the base `.dark .button` border cannot outline them
- reset the link variant's hover and active background in dark mode
- add regression tests for the class-based variants
2026-11-21 17:19:03 +08:00
Liu a9d94e2188 fix(font): use the resolved family name for fontconfig aliases
lcui_fc_fonts_init used the candidate name for aliases. When fontconfig falls back (for example no Ubuntu Mono on CI), the alias pointed at a family that was never loaded, so monospace/sans-serif/serif resolved to -2 and text rendering was empty. Query FC_FAMILY and use the actual loaded family.
2026-11-21 15:58:53 +08:00
Liu e56cee573b test: list loaded font families in environment output 2026-11-21 15:58:53 +08:00
Liu a9de756541 test(css): identify properties and cursor values in assertions 2026-11-21 15:58:52 +08:00
Liu 5eb230e877 ci: run library test targets in separate steps 2026-11-21 15:42:48 +08:00
Liu cf111c4a90 test: print environment details before test suites
Log display backend, metrics, screen size, fontconfig matches and font ids once so CI failures can be compared against the local environment.
2026-11-21 15:13:53 +08:00
Liu 03aef4fed3 test: add context to spinner capture and gallery resize assertions
Spinner tolerances scale with the reference ink size, and gallery resize assertions include the requested width and column index so repeated loop iterations are distinguishable.
2026-11-21 14:45:31 +08:00
Liu e26cd958a0 fix(ptk): emit window size event synchronously on Windows
Hidden windows may not receive WM_SIZE, so the gallery native resize tests saw stale root sizes. Emit PTK_EVENT_SIZE with the requested client size, matching the X11 backend.
2026-11-21 14:45:27 +08:00
Liu e50a5fa5fd test: use relative tolerances for text measurement tests
Shimmer allows a relative capture-width delta, the breadcrumb check asserts it stays within its parent, and assertion names include the property/value and measured metrics so CI failures show numbers instead of only true/false.
2026-11-21 14:26:38 +08:00
Liu 7c72628f23 fix(ui-server): apply window resize before the first frame
ui_server_on_window_resize() required INITIALIZED, but the doc-viewer tests resize a window before ui_server_update transitions PENDING to INITIALIZED, especially under Xvfb, so the resize was ignored. Update the widget whenever a connection exists.
2026-11-21 13:46:27 +08:00
Liu 279eacd3ad fix(css): report unsupported declarations at debug level
Tailwind-generated doc-viewer CSS contains standard values LCUI does not implement (fixed, sticky, grid, table, ...). Skipping them is expected fallback behavior, so log the property or value at debug level instead of error.
2026-11-21 13:42:01 +08:00
Liu 5460d5a733 fix(styles): remove unsupported letter-spacing from dropdown shortcut 2026-11-21 13:41:57 +08:00
Liu 4ab2de700a test: use tailwind-style labels in block and percentage wrap fixtures
Match the flex layout fixture: short utility-style labels keep example titles on one line and consistent across platform fonts.
2026-11-20 00:32:51 +08:00
Liu 64cfdc477c test: use tailwind-style labels in flex layout fixtures
Replace prose CSS declarations with short tailwind utility names so example titles stay on one line and remain readable at narrow widths.
2026-11-20 00:22:14 +08:00
Liu 7404070d5e fix(pandagl): release fontconfig global caches on shutdown
FcInitLoadConfigAndFonts() leaves fontconfig global configuration and caches allocated; FcConfigDestroy() only releases the per-call config. Call FcFini() when the font library is destroyed.
2026-11-20 00:15:26 +08:00
Liu 74255f501c test: shorten flex layout titles to avoid font-dependent wrapping
The example 10/12 titles were long enough to wrap at 320px, so their container height depended on the resolved monospace font. Use short tailwind-style labels, expect the single-line height, and drop the bundled DejaVu Sans Mono fixture.
2026-11-20 00:00:29 +08:00
Liu 4f83a1b2b0 test: pin layout fixtures to a bundled monospace font
The monospace alias resolved to Ubuntu Mono locally and a different font on CI runners, so the 320px flex wrapping expectations diverged. Bundle DejaVu Sans Mono under tests/fixtures/fonts, load it in the layout suites and point the monospace alias at it.
2026-11-19 23:51:09 +08:00
Liu 87d63f3c8a fix(ptk): keep cached window size in sync on Windows
ptk_window_set_size() only issued SetWindowPos(); the cached client size was updated later by WM_SIZE. Closing a window immediately after create/set_size saved the stale 320x240 size. Update the cache with the requested client size, matching the X11 backend.
2026-11-19 23:39:49 +08:00
Liu edf192475d test(css): identify properties in inheritance assertions
The shorthand and default-inheritance checks reused one fixed description inside loops, so the log showed identical lines with no property context. Include the selector and property name in each assertion name.
2026-11-19 23:38:27 +08:00
Liu 7449e6fb4a feat(pandagl): add quiet font loading for optional fonts
pd_font_try_load_file() reports failures at debug level so platform probes, test candidates and CSS @font-face no longer spam errors for missing system fonts. pd_font_load_file() and XML font resources still report errors, and initialization warns once when no usable default font exists.
2026-11-19 23:37:21 +08:00
Liu 7db080e684 test: use the logical monospace font in layout fixtures
Ubuntu Mono and Consola did not exist on Windows (Consola is a typo), so the fixtures fell back to Microsoft YaHei, a proportional font. Use the monospace alias so both platforms select their system monospace font, and unify the flex title height expectation now that Windows also wraps.
2026-11-19 22:49:34 +08:00
Liu ce47e50ed3 fix: keep example tests in the console subsystem on Windows
win.sdk.application was added globally in examples/xmake.lua, so doc-viewer-tests inherited the GUI subsystem and failed to link with WinMain. Scope the rule to the GUI example targets instead.
2026-11-19 22:39:49 +08:00