Skip to content

New UI System#11

Draft
szdytom wants to merge 55 commits into
mainfrom
ui-next
Draft

New UI System#11
szdytom wants to merge 55 commits into
mainfrom
ui-next

Conversation

@szdytom
Copy link
Copy Markdown
Owner

@szdytom szdytom commented May 12, 2026

No description provided.

szdytom added 4 commits May 8, 2026 16:02
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
…MoveEvent classes

Signed-off-by: szdytom <szdytom@qq.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a JavaScript-driven “ScriptedScene” pipeline backed by QuickJS bindings, allowing scenes to be authored in TypeScript/JavaScript and rendered via a command-buffer style drawing API.

Changes:

  • Adds a new QuickJS runtime layer (wf::js) with bindings for textures, colors, draw commands, and input events.
  • Adds wf::ScriptedScene that loads/evals JS assets, exposes a waveforge namespace, and supports setupScene() + commitDraw() from scripts.
  • Adds TypeScript declarations + a test script, plus an esbuild-based Makefile and asset-manifest wiring for JS assets.

Reviewed changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
ts-src/waveforge.d.ts Declares the waveforge script API for TS authoring.
ts-src/test_scene.ts Adds a sample scripted scene exercising the new API.
src/scenes/scripted_scene.cpp Implements ScriptedScene and binds the waveforge namespace into QuickJS.
src/runtime/texture.cpp Implements QuickJS binding for Texture.
src/runtime/helper.h Adds helper macros for QuickJS getters/setters/methods.
src/runtime/hacks.h Adds QuickJS internal-structure helpers + property entry builders.
src/runtime/event.cpp Implements QuickJS bindings for keyboard/mouse event objects.
src/runtime/engine.cpp Implements QuickJS engine/context lifecycle and class binding helpers.
src/runtime/draw.cpp Implements QuickJS bindings for draw commands + command list iteration and rendering.
src/runtime/color.cpp Implements QuickJS binding for Color + parsing/serialization.
src/main.cpp Adds --debug-js-scene to boot directly into a scripted scene.
src/assets.cpp Adds a new asset loader type js that loads JS source text.
Makefile Adds esbuild-driven TS→JS bundling into assets/bundled-js.
include/wforge/scene.h Declares the new wf::ScriptedScene scene type.
include/wforge/runtime.h Introduces the public QuickJS binding/runtime API and binding types.
include/wforge/assets.h Adds wf::Script asset type for JS source storage.
docs/bindings.md Documents how to add new QuickJS binding classes.
CMakeLists.txt Adds new runtime + scripted scene sources to the build.
cmake/deps.cmake Updates QuickJS submodule note to reference the new hacks header path.
assets/README.md Documents the new js asset type.
assets/manifest.json Adds a JS asset entry for the test scene bundle.
.gitignore Ignores generated assets/bundled-js output directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/scenes/scripted_scene.cpp Outdated
Comment thread src/scenes/scripted_scene.cpp Outdated
Comment thread src/runtime/texture.cpp
Comment thread cmake/deps.cmake Outdated
Comment thread src/scenes/scripted_scene.cpp Outdated
Comment thread docs/bindings.md Outdated
Comment thread docs/bindings.md Outdated
Comment thread docs/bindings.md Outdated
Comment thread src/scenes/scripted_scene.cpp Outdated
Comment thread src/scenes/scripted_scene.cpp Outdated
szdytom added 23 commits May 12, 2026 17:19
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
…ipt loading error handling

Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
…trol

Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
…peScript definitions

Signed-off-by: szdytom <szdytom@qq.com>
…larity and maintainability

Signed-off-by: szdytom <szdytom@qq.com>
…nder logic

Signed-off-by: szdytom <szdytom@qq.com>
…e TypeScript definitions

Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
…initions

Signed-off-by: szdytom <szdytom@qq.com>
…mline rendering methods

Signed-off-by: szdytom <szdytom@qq.com>
… in layout

Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
szdytom added 17 commits May 19, 2026 08:20
Signed-off-by: szdytom <szdytom@qq.com>
…ions

Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
… efficiency

Signed-off-by: szdytom <szdytom@qq.com>
…context

Signed-off-by: szdytom <szdytom@qq.com>
…aveData class

Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Introduce hover tracking in renderer/host-config (dispatchHoverChange/
dispatchHoverLeave), propagate
onPointerEnter/onPointerLeave/onPointerMove,
and wire mousemove/mouseleave listeners. Add mouseenter/mouseleave
support
in scripted_scene and types, and add hover visuals/state to Button.
Small
include and lint config tweaks

Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
@szdytom szdytom force-pushed the ui-next branch 4 times, most recently from 115ada4 to 6fd10b0 Compare May 21, 2026 08:32
Set up Node.js in CI (install/build and lint TypeScript). Add
copy_bundled_js in pack.py to include only files listed in the
esbuild .metafile and minify JSON outputs. Update build.mjs to emit
a simplified .metafile.json (outputs only) plus a full metafile.

Signed-off-by: szdytom <szdytom@qq.com>
szdytom added 4 commits May 21, 2026 16:48
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Signed-off-by: szdytom <szdytom@qq.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 67 out of 74 changed files in this pull request and generated 8 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread src/save_io.cpp
Comment thread src/save_io.cpp
Comment thread src/scenes/scripted_scene.cpp
Comment thread src/runtime/module_registry.cpp
Comment thread src/scenes/scripted_scene.cpp
Comment thread assets/README.md
Comment thread docs/scripted-ui.md
Comment thread packages/renderer/src/index.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants