Skip to content

Conversation

@azu
Copy link
Owner

@azu azu commented Jan 15, 2026

Summary

Claude Code連携機能を拡張し、タグ提案と関連アイテムのコンテキスト連携を追加しました。prompt関数にrelatedItemsとavailableTagsを渡すことで、より文脈に沿った説明文とタグを生成できるようになります。

Changes

  • prompt関数の引数にrelatedItemsとavailableTagsを追加
  • Claude Codeの出力形式をJSON(comment, tags)に変更し、タグ提案をサポート
  • 関連URL追加時に自動で再推論を実行
  • ClaudeCodePreviewにタグ表示エリアを追加
  • 挿入時にコメントとタグの両方を反映

Breaking Changes

  • prompt関数のシグネチャが{ url, title }から{ url, title, relatedItems, availableTags }に変更
  • Claude Codeの出力形式がmarkdownからJSONに変更(従来形式もフォールバックでサポート)

Test Plan

  1. Claude Code連携が有効な状態でURLを入力し、AI説明文が生成されることを確認
  2. 関連URLを追加した際に再推論が実行されることを確認
  3. 生成結果にタグが含まれる場合、プレビューに表示されることを確認
  4. 挿入ボタンでコメントとタグの両方が反映されることを確認

close #47

- prompt関数にrelatedItemsとavailableTagsを渡すように変更
- Claude Codeの出力をJSON形式(comment, tags)で解析
- 関連URL追加時に自動で再推論を実行
- 推論結果にタグを表示し、挿入時にタグもマージ
- ClaudeCodePreviewにタグ表示エリアを追加

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 15, 2026 06:44
Copy link

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 extends the Claude Code integration feature to support tag suggestions and related items context. The prompt function now receives relatedItems and availableTags parameters to generate more contextually relevant descriptions and tag suggestions. The output format has been changed from markdown to JSON containing both comment and tags fields.

Changes:

  • Modified prompt function signature to accept relatedItems and availableTags parameters
  • Changed Claude Code output parsing from markdown to JSON format with backward compatibility
  • Added automatic re-inference when related URLs are added

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/browser/component/ClaudeCodePreview.js Updated to display claudeCode.comment instead of claudeCode.result and added tags display area
src/browser/component/ClaudeCodeButton.js Added relatedItems and availableTags props and passed them to runClaudeCode calls
src/browser/Store/ServiceStore.js Renamed result to comment, added tags array, and implemented tag merging on insert
src/browser/App.js Added automatic re-inference when related items are added, passed new props to ClaudeCodeButton
src/browser/Action/ServiceAction.js Updated runClaudeCode signature, changed output parsing to support JSON format with fallback
css/index.css Added styling for the tags display area in the preview component

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

Comment on lines +198 to +207
setTimeout(() => {
const updatedRelatedItems = appContext.ServiceStore.state.relatedItems;
ServiceAction.runClaudeCode(
this.state.URL,
this.state.title,
this._claudeCodeConfig,
updatedRelatedItems,
this.state.tags
);
}, 100);
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The 100ms delay is a magic number without explanation. Consider adding a comment explaining why this delay is necessary, or extract it as a named constant like RELATED_ITEM_STATE_UPDATE_DELAY.

Copilot uses AI. Check for mistakes.
azu and others added 2 commits January 15, 2026 15:47
コードブロックの正規表現マッチからCLIのJSON出力形式に変更

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@azu azu added the Type: Feature New Feature label Jan 15, 2026
@azu azu merged commit eae84cd into master Jan 15, 2026
5 checks passed
@azu azu deleted the feature/claude-code-tags-and-related-items branch January 15, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude連携の改善

2 participants