Skip to content

feature: SVG rendering support in wasm module. - #1052

Merged
highperformancecoder merged 1 commit into
developfrom
cairoShim-refactor
Nov 27, 2026
Merged

highperformancecoder merged 1 commit into
developfrom
cairoShim-refactor

Conversation

@highperformancecoder

@highperformancecoder highperformancecoder commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

This change is Reviewable

Summary by CodeRabbit

  • New Features
    • Added support for loading SVG icon resources for use in the application.
    • The application now refreshes its display when SVG content is ready.
  • Bug Fixes
    • Updated the sample and smoke test flows to load the bank icon before checking model rendering. If loading the icon fails in the sample, the error is displayed and the load action still proceeds.

Copilot AI balanced review requested due to automatic review settings November 26, 2026 06:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Wasm integration adds SVG-ready callback wiring and a helper that loads SVG resources into the virtual filesystem. The test page and smoke test load the bank icon before using it.

Changes: Wasm SVG icon loading

Layer / File(s) Summary
SVG-ready callback wiring
mansoura, wasm/jsminsky.cc, wasm/minsky.js
The Mansoura subproject reference changes. JSMinsky exposes setSVGReadyCallback, and newMinsky registers a redraw callback or warns if the callback is unavailable.
Icon resource loading and test setup
wasm/minsky.js, wasm/test.html, wasm/test/smoke.js
loadIconResource fetches an SVG, writes its bytes to the Wasm filesystem, and calls the supplied backend method with the path. The test page loads the bank icon before clicking Load and adds version queries to script and runtime URLs. The smoke test sets the bank icon path as the Godley icon resource.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant minsky.js
  participant SVG_URL
  participant Wasm_filesystem
  participant Minsky_backend
  Browser->>minsky.js: Call loadIconResource(method, url, name)
  minsky.js->>SVG_URL: Fetch url
  SVG_URL-->>minsky.js: Return response bytes and status
  minsky.js->>Wasm_filesystem: Write bytes to resource path
  minsky.js->>Minsky_backend: Call method with resource path
Loading
Merge Risk: Minimal · up to d665c

This change adds SVG icon loading to the Wasm module and redraws once icons are ready. No concrete defects were found, and the change is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feature: SVG rendering support in wasm module." is a short, specific single sentence. The changeset adds SVG handling to the wasm module: a new setSVGReadyCallback method on JSMinsky, a loa…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feature: SVG rendering support in wasm module." is a short, specific single sentence. The changeset adds SVG handling to the wasm module: a new setSVGReadyCallback method on JSMinsky, a loadIconResource helper in minsky.js that writes SVG bytes into the virtual filesystem, and a bank.svg icon load in the test page and smoke test. The title names the main theme, though the changes are narrower than a general SVG rendering feature (they focus on icon resource loading and a ready callback). The title is therefore related to the change, and the scope is slightly broad.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clang (23.1.4)

wasm/jsminsky.cc

Clang-Tidy produced no recognizable diagnostics; analysis is incomplete

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between defc30f and d665c4f.

Files selected for processing: 5

  • mansoura
  • wasm/jsminsky.cc
  • wasm/minsky.js
  • wasm/test.html
  • wasm/test/smoke.js

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@highperformancecoder
highperformancecoder merged commit 0b00655 into develop Nov 27, 2026
5 checks passed
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