Skip to content

fix: demo の View に markdown が出ない問題を直す - #38

Merged
isamu merged 1 commit into
mainfrom
fix/demo-view-markdown
Oct 18, 2026
Merged

isamu merged 1 commit into
mainfrom
fix/demo-view-markdown

Conversation

@isamu

@isamu isamu commented Oct 17, 2026

Copy link
Copy Markdown
Member

Summary

  • demo の View が常に「No markdown content available」になる問題を直す
  • 原因:gui-chat-protocol では data が View 用、jsonData は LLM 用。プラグインの execute(presentDocument)は data: { markdown, filenameHint } を返し、ホストはその結果をそのまま View に渡す。demo だけが execute を通さずに結果を手で組み立て、引数を jsonData に入れていたため data.markdown が無かった
  • 修正は demo 側だけ(src は protocol どおりなので触っていない):入力 JSON を isMarkdownArgs(demo/markdownArgs.ts)で確かめてから executeMarkdown(null, args) を呼び、その結果を View / Preview に渡す
  • 方針は plans/fix-demo-view-markdown.md

Items to Confirm / Review

  • demo の結果は execute の戻り値なので、「Current Result Data」の表示は message / title / data / instructions になる(以前は jsonData を表示していた)
  • context は null で呼んでいる。そのため画像のプレースホルダ(__too_be_replaced_image_path__)は画像生成されず、そのまま残る(プラグインがもともと context 無しのホストのために用意している経路)
  • title / markdown が文字列でない JSON は、demo 側でエラー表示にした
  • demo にもともとあった型エラー(samples.value[0] が ToolSample | undefined)と plugin as unknown as ToolPlugin は今回触っていない。yarn typecheck は src だけが対象なので CI では出ない

User Prompt

  • demo の View に markdown が出ない問題を直す

Verification

  • yarn lint(error 0、既存の warning のみ)→ yarn build → yarn typecheck → yarn test:すべて成功
  • demo:yarn dev を headless Chrome で読み込み、スクリーンショットで View に sample の markdown(見出し・太字・リスト・コードブロック)が描画されることを確認。--dump-dom で <h1>Hello World</h1> があり「No markdown content available」が無いこと、console error が無いことも確認。dev server は停止済み
  • sample ボタンの切り替えや Apply JSON のクリック操作までは試していない(初期表示は onMounted から同じ applyJson を通る)

🤖 Generated with Claude Code

demo が execute を通さず引数を jsonData に入れていたため、View が読む data.markdown が無かった。
demo でもプラグインの execute を呼び、ホストと同じ形の結果を渡す。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@isamu
isamu merged commit 64ef279 into main Oct 18, 2026
12 checks passed
@isamu
isamu deleted the fix/demo-view-markdown branch October 18, 2026 00:51
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.

1 participant