Fix call tag variable assignments using Proxy-based context#181
Fix call tag variable assignments using Proxy-based context#181
Conversation
Co-authored-by: EndoHizumi <5486808+EndoHizumi@users.noreply.github.com>
Use Proxy and 'with' statement to execute code in sceneFile context, allowing assignments to modify the original properties instead of creating local variables. Co-authored-by: EndoHizumi <5486808+EndoHizumi@users.noreply.github.com>
…omment Co-authored-by: EndoHizumi <5486808+EndoHizumi@users.noreply.github.com>
|
@copilot この確認デモ用に、if-test.sceneを書き換えて |
Enhanced the demo scene to better showcase the call tag fix:
- Added 4 test sections with clear labels and visual separators
- Test 1: Basic value assignment (hoge = 1)
- Test 2: Value modification (hoge = 2)
- Test 3: Increment operations (count = count + 1)
- Test 4: Complex expressions (result = hoge * count)
- Added additional variables (count, result) to demonstrate various scenarios
- Clear success/error indicators for conditional display
- Shows variable values before and after each operation using {{variable}} expansion
Co-authored-by: EndoHizumi <5486808+EndoHizumi@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
if_test.sceneを更新しました(コミット: b7f7707) 更新内容:
実行時の出力イメージ: |
…om/EndoHizumi/webTaleKit into copilot/fix-call-tag-functionality
|
@copilot こちらで、動作確認できるURLとか出せる? ローカルだとうまく確認できてない。 |
Created demo_call_tag_fix.html - a standalone HTML file that demonstrates the call tag fix without requiring local dev server setup. Can be opened directly in browser or hosted on GitHub Pages. Features: - Self-contained demo with all CSS/JS inline - Visual test results with success/error indicators - 4 comprehensive test sections - Re-runnable test button - Beautiful gradient UI with clear sections - No dependencies required Also added DEMO_README.md with usage instructions. Co-authored-by: EndoHizumi <5486808+EndoHizumi@users.noreply.github.com>
スタンドアロンのデモHTMLファイルを作成しました(コミット: faf199b) ファイル: 確認方法オプション1: ファイルを直接開く(最も簡単)リポジトリをcloneして、 オプション2: GitHubでRawファイルを開くこのPRがマージされた後、以下のようなURLでアクセス可能になります: オプション3: GitHub Pagesで公開このブランチをGitHub Pagesにデプロイすれば、オンラインURLで確認できます。 デモの内容
すべてのCSSとJavaScriptがインライン化されているため、サーバー不要で単一ファイルで完結します。 詳細な使用方法は |
…om/EndoHizumi/webTaleKit into copilot/fix-call-tag-functionality
EndoHizumi
left a comment
There was a problem hiding this comment.
@copilot exampleのifテストを動かしても、変化がないよ
…ckage The example needs to use the packaged/built version of webtalekit-alpha to work properly. Changes: - Updated import path from 'webtalekit-alpha/src/core/' to 'webtalekit-alpha/dist/src/core/' - Added webtalekit-alpha as a local dependency (installed from tarball) - Fixed webpack config regex escaping - Made parser/cli.js executable To test the example: 1. npm run build (in root to build the package) 2. npm pack (in root to create tarball) 3. cd example && npm install ../webtalekit-alpha-0.2.12.tgz 4. npm run dev (in example directory) 5. Open http://localhost:8080?scene=if_test to see the if test demo Co-authored-by: EndoHizumi <5486808+EndoHizumi@users.noreply.github.com> Agent-Logs-Url: https://github.com/EndoHizumi/webTaleKit/sessions/1a2ebdba-ff81-4c4b-b14a-3872ee06b6ce
Added TESTING_EXAMPLE.md with detailed instructions on how to properly build, install, and test the example to verify the call tag fix works correctly. Co-authored-by: EndoHizumi <5486808+EndoHizumi@users.noreply.github.com> Agent-Logs-Url: https://github.com/EndoHizumi/webTaleKit/sessions/1a2ebdba-ff81-4c4b-b14a-3872ee06b6ce
問題を修正しました(コミット: 70cd925, d3b7b59) 原因exampleが 修正内容
テスト手順詳細は # ルートディレクトリで
npm install
npm run build
npm pack
# exampleディレクトリで
cd example
npm install ../webtalekit-alpha-0.2.12.tgz
npm run devその後、ブラウザで 期待される動作
これでexampleのif_testが正常に動作するはずです。 |
…om/EndoHizumi/webTaleKit into copilot/fix-call-tag-functionality
The
calltag was not updating exported scene variables. Assignments like<call method="hoge = 1" />created local variables instead of modifying the scene context, breaking conditional logic and variable expansion.Root Cause
executeCode()passed scene properties by value, making assignments local-only:Changes
executeCode()to use Proxy: Intercepts property access/assignment to modifysceneFiledirectlywithstatement: Enables natural variable syntax while maintaining reference to source objectif_test.scenedemo: Updated the demo scene with 4 comprehensive test sections showcasing basic assignment, value modification, increment operations, and complex expressionsdemo_call_tag_fix.html- a self-contained, browser-ready demo file with no dependencies or server setup requireddist/directory, ensuring local testing works correctlyVerification
Manual test confirms proper behavior:
Variable assignments now propagate correctly to conditionals (
if="hoge==1") and expansions ({{hoge}}).Demo Scene
The updated
if_test.sceneprovides a comprehensive demonstration:■テスト1: 値の代入 - Basic value assignment (
hoge = 1)■テスト2: 値の変更 - Value modification (
hoge = 2)■テスト3: 計算式 - Increment operations (
count = count + 1, executed twice)■テスト4: 複雑な式 - Complex expressions (
result = hoge * count)Each test section displays variable values before and after operations using
{{variable}}syntax, with visual success/error indicators (✓/✗) to confirm conditional logic works correctly.Standalone Demo
demo_call_tag_fix.htmlprovides an easy way to verify the fix without any setup:DEMO_README.mdfor usage instructionsTesting the Example
To test the fix with the example project:
Build and pack the package:
Install in example:
cd example npm install ../webtalekit-alpha-0.2.12.tgz npm run devOpen
http://localhost:8080?scene=if_testin your browserSee
TESTING_EXAMPLE.mdfor detailed testing instructions and troubleshooting.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.