Repository navigation
fix: demo の View に markdown が出ない問題を直す - #38
Merged
Merged
Conversation
demo が execute を通さず引数を jsonData に入れていたため、View が読む data.markdown が無かった。 demo でもプラグインの execute を呼び、ホストと同じ形の結果を渡す。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dataが View 用、jsonDataは LLM 用。プラグインのexecute(presentDocument)はdata: { markdown, filenameHint }を返し、ホストはその結果をそのまま View に渡す。demo だけがexecuteを通さずに結果を手で組み立て、引数をjsonDataに入れていたためdata.markdownが無かったisMarkdownArgs(demo/markdownArgs.ts)で確かめてからexecuteMarkdown(null, args)を呼び、その結果を View / Preview に渡すplans/fix-demo-view-markdown.mdItems to Confirm / Review
executeの戻り値なので、「Current Result Data」の表示はmessage/title/data/instructionsになる(以前はjsonDataを表示していた)contextはnullで呼んでいる。そのため画像のプレースホルダ(__too_be_replaced_image_path__)は画像生成されず、そのまま残る(プラグインがもともと context 無しのホストのために用意している経路)samples.value[0]がToolSample | undefined)とplugin as unknown as ToolPluginは今回触っていない。yarn typecheckは src だけが対象なので CI では出ないUser Prompt
Verification
yarn lint(error 0、既存の warning のみ)→yarn build→yarn typecheck→yarn test:すべて成功yarn devを headless Chrome で読み込み、スクリーンショットで View に sample の markdown(見出し・太字・リスト・コードブロック)が描画されることを確認。--dump-domで<h1>Hello World</h1>があり「No markdown content available」が無いこと、console error が無いことも確認。dev server は停止済みapplyJsonを通る)🤖 Generated with Claude Code