Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .agents/docs/2026-11-24-add-huxerui-libs-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Add `huxerui.interaction`, `huxerui.markdown`, and `huxerui.qrcode`

## Summary

Add three Form A native C++23 module libraries from the `HuxerUI` ecosystem targeting `huxerui.huxerui` `0.5.5`:

| Package | Version | Upstream Tag | Module Interface | Descriptor |
| :--- | :--- | :--- | :--- | :--- |
| `huxerui.interaction` | `0.2.0` | `HuxerUI/Lib-Interaction@v0.2.0` (`ff37a8a6`) | `import huxerui.interaction;` | `pkgs/h/huxerui.interaction.lua` |
| `huxerui.markdown` | `0.3.1` | `HuxerUI/Lib-Markdown@v0.3.1` (`3a875ae0`) | `import huxerui.markdown;` | `pkgs/h/huxerui.markdown.lua` |
| `huxerui.qrcode` | `0.1.0` | `HuxerUI/Lib-QRCode@v0.1.0` (`696ff56b`) | `import huxerui.qrcode;` | `pkgs/h/huxerui.qrcode.lua` |

## Package Architecture

- **Form A (External Native Module Repositories)**:
- Each upstream tag archive ships its own `mcpp.toml`, `build.mcpp` (`huxerui.rules`), and `modules/*.cppm`, so none of the three descriptors carries an inline `mcpp` build table:
- `huxerui.interaction` (`0.2.0`): `modules/interaction.cppm` and `modules/operators.cppm` (gesture/press/hover/scroll/overlay/accessibility primitives and pipe/mask operators).
- `huxerui.markdown` (`0.3.1`): `modules/markdown.cppm` and `modules/macros.cppm`, with vendored `md4c` (`c99`) parser sources and CommonMark/GFM declarative view components.
- `huxerui.qrcode` (`0.1.0`): `modules/qrcode.cppm`, with `build.mcpp` generating `zxing/Version.h` and compiling vendored ZXing 3.1.1 (C++ and `c99` `libzueci`) encoder/decoder sources.
- Each package declares `licenses = {"MIT"}`, matching `LICENSE` and `mcpp.toml` in its upstream tag archive.
- All three upstream `mcpp.toml` manifests declare `[dependencies] huxerui.huxerui = "0.5.5"` (`standard = "c++23"`), so no extra `xpm.<platform>.deps` closures need to be duplicated in these descriptors; transitive Linux GTK4 `xim` dependencies come from `pkgs/h/huxerui.huxerui.lua`.
- **Upstream Archives & CN Mirror Status**:
- Plain upstream GitHub tag archive URLs are declared across `linux`, `macosx`, and `windows` (local `gitcode.com/mcpp-res` credentials are unavailable; maintainers can populate `CN` mirrors later without altering versions):
- `Lib-Interaction` `v0.2.0` (`196,811` bytes): `https://github.com/HuxerUI/Lib-Interaction/archive/refs/tags/v0.2.0.tar.gz` — SHA256 verified twice: `9ffff3fa6e8bee09a97a766f84af5b4c7dd61f1db6d321d2256ddcc2b32d968d`
- `Lib-Markdown` `v0.3.1` (`171,647` bytes): `https://github.com/HuxerUI/Lib-Markdown/archive/refs/tags/v0.3.1.tar.gz` — SHA256 verified twice: `0e8be37f40b0377bec57e5354dc3dd1114544db92724eadbb027adf53e1a6f2a`
- `Lib-QRCode` `v0.1.0` (`870,446` bytes): `https://github.com/HuxerUI/Lib-QRCode/archive/refs/tags/v0.1.0.tar.gz` — SHA256 verified twice: `8cee876321cdcaa44362342d1990036faf2bd57cea069d9e725f3563907f2d40`
- **Feature Evaluation**:
- None of the three upstream manifests defines optional `[features]` or `[feature-deps.*]`. Each exposes its single default library/module target cleanly.
- **Automatic Updates**:
- All three descriptors declare `extensions.autoupdate` with `tag = "v${version}"` and `url = "https://github.com/HuxerUI/<Repo>/archive/refs/tags/${tag}.tar.gz"`.

## Workspace Test Members

All three members use `[indices] huxerui = { path = "../../.." }` and `standard = "c++23"`, matching `tests/examples/huxerui-module` (`huxerui.huxerui = "0.5.5"`), and run headless C++23 module tests without opening a GUI window:

1. `tests/examples/huxerui-interaction` (`huxerui.interaction = "0.2.0"`):
- Verifies unbound controllers, pipeable `ViewAdaptor`s (`operator|`, `operator&` via `huxerui.interaction.operators`), and out-of-line `std::invalid_argument` validation across subgroups.
2. `tests/examples/huxerui-markdown` (`huxerui.markdown = "0.3.1"`):
- Verifies `macros::HUXERUI_MARKDOWN_SOURCE_MAPPING == 1` (`modules/macros.cppm`), GitHub-flavored AST + source range resolution, incremental parse sessions, streaming output, link policy, and `Markdown(doc)` view construction.
3. `tests/examples/huxerui-qrcode` (`huxerui.qrcode = "0.1.0"`):
- Verifies `Encode`/`ToSvg`/`Rasterize`/`Decode`/`DecodeAll` round-trips across QR Code, Code128, DataMatrix, Aztec, and PDF417, declarative `QRCode`/`Barcode` views, and out-of-line `std::invalid_argument` exception paths.

## Local Verification (`mcpp 2026.11.23.1`, `gcc@16.2.0`)

- **Descriptor Lints & Parser**:
- Passed `lua5.4` syntax checks (with a temporary `lua5.4 -> /usr/bin/lua` 5.4.8 symlink on `PATH`), `check_mirror_urls.lua`, `check_package_name.lua`, `check_reserved_namespace.lua`, `check_mplugin_layout.lua`, `check_capability_providers.lua`, `check_cross_package_refs.lua`, `check_platform_version_parity.lua`, `check_duplicate_versions.lua`, `check_quill_install.lua`, `tools/platform_rows.py check`, `test_check_mplugin.py` (12/12), `test_check_capability_providers.py` (8/8), `tests/openkal/compat.py selftest` (32/32), `tests/red_members.py selftest` (6/6), and `mcpp xpkg parse` across all `pkgs/*/*.lua` (all three new descriptors report `form A`, `parse OK`).
- **Selective Member Selection**:
- `python3 tests/select_members.py --base upstream/main pkgs/h/huxerui.interaction.lua pkgs/h/huxerui.markdown.lua pkgs/h/huxerui.qrcode.lua` selected `huxerui-interaction huxerui-markdown huxerui-qrcode`.
- **Consumer Member Runs (`tests/run_members.sh`)**:
- `huxerui-interaction`: `runtime ... ok (0.01s)`, `1 passed; 0 failed` (`42.85s` total; downloaded directly from `github.com` with `XLINGS_MIRROR_FALLBACK=off`, `XLINGS_ADAPTIVE_MIRROR=off`, `XLINGS_DOWNLOAD_CONNECT_TIMEOUT=5` to bypass stalled CN ghproxy/kkgithub endpoints).
- `huxerui-markdown`: `module_smoke: ok`, `runtime ... ok (0.01s)`, `1 passed; 0 failed` (`33.27s` total).
- `huxerui-qrcode`: `qrcode module_smoke: ok`, `runtime ... ok (0.06s)`, `1 passed; 0 failed` (`133.38s` total).
- Workspace lockfile verified resolution of `huxerui.huxerui@0.5.5`, `huxerui.interaction@0.2.0`, `huxerui.markdown@0.3.1`, and `huxerui.qrcode@0.1.0`.
- **Autoupdate Verification (`openxlings/xpkgindex-update` @ `6c0bee29`)**:
- `tests/autoupdate` unit tests (26/26 OK) and `test_mwrap_tag_selection.py` (4/4 OK).
- `tests/autoupdate/ci.py audit --base upstream/main`: `115` updateable GitHub-direct descriptors declared, all existing versions preserved.
- `xpkgindex_update inspect` and authenticated `check` verified `up-to-date` (`0.2.0`, `0.3.1`, `0.1.0`).
3 changes: 3 additions & 0 deletions mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ members = [
"tests/examples/gmp",
"tests/examples/gzip-hpp",
"tests/examples/huxerui-module",
"tests/examples/huxerui-interaction",
"tests/examples/huxerui-markdown",
"tests/examples/huxerui-qrcode",
"tests/examples/gmp-gmpxx",
"tests/examples/gsl",
"tests/examples/godot-cpp",
Expand Down
43 changes: 43 additions & 0 deletions pkgs/h/huxerui.interaction.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
local versions = {
["0.2.0"] = {
url = "https://github.com/HuxerUI/Lib-Interaction/archive/refs/tags/v0.2.0.tar.gz",
sha256 = "9ffff3fa6e8bee09a97a766f84af5b4c7dd61f1db6d321d2256ddcc2b32d968d",
},
}

-- huxerui.interaction — HuxerUI interactive primitives as a native mcpp module package.
--
-- Form A: upstream carries its own `mcpp.toml` (`Lib-Interaction-0.2.0/mcpp.toml`)
-- and exports `import huxerui.interaction;` (`modules/interaction.cppm` and
-- `modules/operators.cppm`), depending on `huxerui.huxerui = "0.5.5"` which
-- provides the transitive SDK and platform dependencies.
--
-- 0.2.0 uses plain upstream GitHub URLs (no CN mcpp-res mirror yet).
package = {
spec = "1",
namespace = "huxerui",
name = "interaction",
description = "Interactive primitives, controllers, feedback modifiers, and visual motion effects for HuxerUI",
licenses = {"MIT"},
repo = "https://github.com/HuxerUI/Lib-Interaction",
type = "package",

extensions = {
autoupdate = {
tag = "v${version}",
url = "https://github.com/HuxerUI/Lib-Interaction/archive/refs/tags/${tag}.tar.gz",
},
},

xpm = {
linux = {
["0.2.0"] = versions["0.2.0"],
},
macosx = {
["0.2.0"] = versions["0.2.0"],
},
windows = {
["0.2.0"] = versions["0.2.0"],
},
},
}
43 changes: 43 additions & 0 deletions pkgs/h/huxerui.markdown.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
local versions = {
["0.3.1"] = {
url = "https://github.com/HuxerUI/Lib-Markdown/archive/refs/tags/v0.3.1.tar.gz",
sha256 = "0e8be37f40b0377bec57e5354dc3dd1114544db92724eadbb027adf53e1a6f2a",
},
}

-- huxerui.markdown — HuxerUI Markdown parser and declarative view component as a native mcpp module package.
--
-- Form A: upstream carries its own `mcpp.toml` (`Lib-Markdown-0.3.1/mcpp.toml`)
-- with vendored `md4c` (C99) and exports `import huxerui.markdown;`
-- (`modules/markdown.cppm` and `modules/macros.cppm`), depending on
-- `huxerui.huxerui = "0.5.5"` for transitive SDK and platform dependencies.
--
-- 0.3.1 uses plain upstream GitHub URLs (no CN mcpp-res mirror yet).
package = {
spec = "1",
namespace = "huxerui",
name = "markdown",
description = "Native CommonMark and GFM Markdown parser and declarative view component for HuxerUI",
licenses = {"MIT"},
repo = "https://github.com/HuxerUI/Lib-Markdown",
type = "package",

extensions = {
autoupdate = {
tag = "v${version}",
url = "https://github.com/HuxerUI/Lib-Markdown/archive/refs/tags/${tag}.tar.gz",
},
},

xpm = {
linux = {
["0.3.1"] = versions["0.3.1"],
},
macosx = {
["0.3.1"] = versions["0.3.1"],
},
windows = {
["0.3.1"] = versions["0.3.1"],
},
},
}
43 changes: 43 additions & 0 deletions pkgs/h/huxerui.qrcode.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
local versions = {
["0.1.0"] = {
url = "https://github.com/HuxerUI/Lib-QRCode/archive/refs/tags/v0.1.0.tar.gz",
sha256 = "8cee876321cdcaa44362342d1990036faf2bd57cea069d9e725f3563907f2d40",
},
}

-- huxerui.qrcode — HuxerUI QR code and barcode package as a native mcpp module package.
--
-- Form A: upstream carries its own `mcpp.toml` (`Lib-QRCode-0.1.0/mcpp.toml`)
-- and `build.mcpp` (vendored ZXing 3.1.1 sources + Version.h generation) and
-- exports `import huxerui.qrcode;` (`modules/qrcode.cppm`), depending on
-- `huxerui.huxerui = "0.5.5"` for transitive SDK and platform dependencies.
--
-- 0.1.0 uses plain upstream GitHub URLs (no CN mcpp-res mirror yet).
package = {
spec = "1",
namespace = "huxerui",
name = "qrcode",
description = "QR code and barcode generation, declarative HuxerUI views, and multi-format image decoding",
licenses = {"MIT"},
repo = "https://github.com/HuxerUI/Lib-QRCode",
type = "package",

extensions = {
autoupdate = {
tag = "v${version}",
url = "https://github.com/HuxerUI/Lib-QRCode/archive/refs/tags/${tag}.tar.gz",
},
},

xpm = {
linux = {
["0.1.0"] = versions["0.1.0"],
},
macosx = {
["0.1.0"] = versions["0.1.0"],
},
windows = {
["0.1.0"] = versions["0.1.0"],
},
},
}
10 changes: 10 additions & 0 deletions tests/examples/huxerui-interaction/mcpp.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[indices]
huxerui = { path = "../../.." }

[package]
name = "huxerui-interaction-tests"
version = "0.1.0"
standard = "c++23"

[dependencies.huxerui]
interaction = "0.2.0"
87 changes: 87 additions & 0 deletions tests/examples/huxerui-interaction/tests/runtime.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// Headless C++23 module consumer test for huxerui.interaction.
// Verifies package resolution, transitive huxerui.huxerui linking, pipe/mask
// operators exported via huxerui.interaction.operators, and out-of-line
// std::invalid_argument validation across the module boundary.
import std;
import huxerui.interaction;

using namespace huxerui;
using namespace huxerui::interaction;

namespace {

template <class Fn>
bool ThrowsInvalidArgument(Fn&& fn) {
try {
fn();
} catch (const std::invalid_argument&) {
return true;
}
return false;
}

} // namespace

int main() {
bool ok = true;

// 1. Default-constructed unbound controllers across gesture/overlay/scroll/accessibility subgroups
ok = ok && (SwipeController{} == SwipeController{}) && !static_cast<bool>(SwipeController{});
ok = ok && (PanZoomController{} == PanZoomController{});
ok = ok && (HoverCardController{} == HoverCardController{});
ok = ok && (PopoverController{} == PopoverController{}) && !static_cast<bool>(PopoverController{});
ok = ok && (RovingFocusController{} == RovingFocusController{}) && !static_cast<bool>(RovingFocusController{});
ok = ok && !RovingFocusController{}.FocusIndex(0);
ok = ok && !RovingFocusController{}.FocusNext();
ok = ok && (ScrollToTopController{} == ScrollToTopController{}) && !static_cast<bool>(ScrollToTopController{});
ok = ok && (CompareSliderController{} == CompareSliderController{}) && !static_cast<bool>(CompareSliderController{});
ok = ok && (RadialDialController{} == RadialDialController{}) && !static_cast<bool>(RadialDialController{});
ok = ok && (PredictiveBackController{} == PredictiveBackController{}) && !static_cast<bool>(PredictiveBackController{});

// 2. Construct valid Views and pipeable ViewAdaptors across press, hover, gesture, reorder,
// dragdrop, overlay, scroll, accessibility, and visual subgroups (no #include of library headers)
View composed = Text("interaction-smoke")
.With(Ripple{}, Spotlight{}, HoverHighlight{}, Shimmer{})
| Pressable([] {})
| HoverLift()
| DoubleClickable([](const MultiTapEvent&) {})
| ContextMenuArea([](Point) {})
| KeyboardShortcut({.key = Key::K}, [] {})
| BackHandler([] {})
| RovingFocusItem(0)
| RovingFocusGroup()
| Copyable("hello")
| Popover([](PopupContext) { return Text("popover"); })
| Expandable(true)
| Appear()
| DropZone<int>([](int v) { return v > 0; });
ok = ok && static_cast<bool>(composed);

ok = ok && static_cast<bool>(InteractiveSurface([](const InteractionSnapshot&) { return Text("surface"); }));
ok = ok && static_cast<bool>(Hoverable([](bool) { return Text("hoverable"); }));
ok = ok && static_cast<bool>(CompareSlider(Text("before"), Text("after")));
ok = ok && static_cast<bool>(RadialDial());
ok = ok && static_cast<bool>(SwipeActions(Text("row"), [](SwipeActionContext) { return Text("act"); }));
ok = ok && static_cast<bool>(Reorderable({Text("a"), Text("b")}));
ok = ok && static_cast<bool>(RollingNumber(42));
ok = ok && static_cast<bool>(HoverCard(Text("anchor"), [](PopupContext) { return Text("card"); }));
ok = ok && static_cast<bool>(Text("scroll").With(ScrollProgress(ScrollController{}), ScrollEdgeFade(ScrollController{})));
const SwipeDirectionMask dir_mask = SwipeDirectionMask::Left | SwipeDirectionMask::Right;
ok = ok && ((dir_mask & SwipeDirectionMask::Left) == SwipeDirectionMask::Left);
ok = ok && HasDirection(dir_mask, SwipeDirectionMask::Right);

// 3. Call out-of-line validation paths across subgroups (must throw std::invalid_argument)
ok = ok && ThrowsInvalidArgument([] { (void)InteractiveSurface({}); });
ok = ok && ThrowsInvalidArgument([] { (void)Pressable(Text("x"), {.hovered_scale = 0.0F}); });
ok = ok && ThrowsInvalidArgument([] { (void)HoverLift(Text("x"), {.hovered_scale = -1.0F}); });
ok = ok && ThrowsInvalidArgument([] { (void)Text("x").With(Ripple{RippleStyle{.duration = 0.0}}); });
ok = ok && ThrowsInvalidArgument([] { (void)Copyable(std::function<View(bool)>{}, "text"); });
ok = ok && ThrowsInvalidArgument([] { (void)Popover(Text("x"), std::function<View(PopupContext)>{}); });
ok = ok && ThrowsInvalidArgument([] { (void)HoverCard(Text("x"), std::function<View(PopupContext)>{}); });
ok = ok && ThrowsInvalidArgument([] { (void)RollingNumber(0, {.minimum_digits = -1}); });
ok = ok && ThrowsInvalidArgument([] {
(void)SwipeActions(Text("row"), [](SwipeActionContext) { return Text("act"); }, {.action_extent = 0.0F});
});

return ok ? 0 : 1;
}
10 changes: 10 additions & 0 deletions tests/examples/huxerui-markdown/mcpp.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[indices]
huxerui = { path = "../../.." }

[package]
name = "huxerui-markdown-tests"
version = "0.1.0"
standard = "c++23"

[dependencies.huxerui]
markdown = "0.3.1"
Loading
Loading