Skip to content

feat(nicojk): miyouコメントを過去ログに統合 - #33

Merged
ci7lus merged 7 commits into
mainfrom
feat/miyou
Aug 22, 2026
Merged

ci7lus merged 7 commits into
mainfrom
feat/miyou

Conversation

@ci7lus

@ci7lus ci7lus commented Aug 22, 2026 •

Copy link
Copy Markdown
Owner

Fixes #10

Sourceryによる概要

Miyou 5ch実況ログをNicoJKの録画再生に統合し、独立したフィード制御と処理設定を提供します。

新機能:

  • Miyou 5ch実況コメントを、認証付き取得とタイムライン同期に対応した録画コメント再生に統合。
  • コメントパネルに、NicoNicoとMiyouそれぞれのフィードフィルタリング、件数、ラベル、ソース制御を追加。
  • Miyouの認証情報と取得に関する設定、およびレスアンカーコメントを表示するオプションを追加。

バグ修正:

  • 録画コメントの取得に失敗したチャンクを、完了済みとしてマークせずに再試行できるように修正。
  • Miyouの設定変更時に録画コメントを更新し、手動での再読み込みにも対応。

機能強化:

  • URLを削除し、レスアンカーを任意でフィルタリングし、取得データの変更時にレンダラーを更新することで、録画コメントの表示を改善。
  • フィード固有のキーへ移行する際、以前のチャンネルレベルのソース表示状態との互換性を維持。
  • 重複するMiyouコメントを排除し、取得中でも録画コメントの一部結果を公開。

ビルド:

  • NicoJKの変更に合わせてプラグインマニフェストを更新。

テスト:

  • Miyouの解析、タイムライン変換、ソースキーの動作、重複削除、レンダラーのテキストフォーマット、録画コメントの再試行処理に関するテストカバレッジを追加。
Original summary in English

Sourceryによる概要

Miyou 5ch実況ログをNicoJKの録画再生に統合し、フィードごとの独立した制御、認証設定、より堅牢なコメント取得を追加します。

新機能:

  • 認証済みのMiyou 5ch実況コメントを、タイムラインを同期した状態でNicoJKの録画再生に統合。
  • NicoNicoとMiyouのフィードラベル、件数、表示フィルター、ソース制御を個別に追加。
  • Miyouアカウント、取得、レスアンカー表示の設定と、録画コメントの手動再読み込みに対応。

バグ修正:

  • 録画コメントのチャンク取得に失敗した場合、完了済みとして扱わず、再試行の対象として保持。
  • Miyouの設定変更時に録画コメントを更新しつつ、既存のNicoNicoコメントを保持。

機能改善:

  • URLを削除し、レスアンカーを任意でフィルタリングし、データ変更時に更新し、取得中に部分的な結果を表示し、Miyouコメントの重複を排除することで、録画コメントの表示を改善。
  • フィード固有のソースキーへの移行時に、以前のチャンネルレベルのソース表示状態との互換性を維持。

ビルド:

  • NicoJKの変更に合わせてプラグインマニフェストを更新。

テスト:

  • Miyouの解析、タイムライン変換、フィードソースキー、重複削除、レンダラーのテキスト整形、録画コメントの再試行動作に関するテストカバレッジを追加。
Original summary in English

Sourceryによる概要

Miyou 5ch実況ログをNicoJKの録画再生に統合し、フィードごとの個別制御、認証設定、より堅牢なコメント取得に対応しました。

新機能:

  • 認証済みのMiyou 5ch実況コメントを、タイムラインを同期した状態でNicoJKの録画再生に統合。
  • NicoNicoとMiyouそれぞれに、フィードラベル、件数、フィルター、ソース制御、録画コメントの手動再読み込みを追加。
  • Miyouアカウントおよび取得設定と、レスアンカーコメントを表示するオプションを追加。

バグ修正:

  • 録画コメントのチャンク取得に失敗した場合、完了済みとして扱わず、再試行可能な状態を維持。
  • Miyouの設定変更時に録画コメントを更新し、Miyouが無効な場合は既存のNicoNicoコメントを保持。

改善:

  • URLの削除、レスアンカーのフィルタリング(任意)、データ変更時のレンダラー更新、取得中の部分結果の表示、Miyouコメントの重複削除により、録画コメントの表示を改善。
  • フィード単位のソースキーへの移行時に、以前保存されたチャンネル単位のソース表示設定との互換性を維持。

ビルド:

  • NicoJKの変更に合わせてプラグインマニフェストを更新。

テスト:

  • Miyouの解析およびタイムライン変換、フィードソースキー、重複削除、レンダラーのテキスト形式、録画コメントの再試行動作に関するテストカバレッジを追加。
Original summary in English

Summary by Sourcery

Integrate Miyou 5ch実況 logs into NicoJK recorded playback with separate feed controls, configurable authentication, and more resilient comment acquisition.

New Features:

  • Integrate authenticated Miyou 5ch実況 comments into NicoJK recorded playback with synchronized timelines.
  • Add independent NicoNico and Miyou feed labels, counts, filters, source controls, and manual recorded-comment reload.
  • Add Miyou account and acquisition settings plus an option to display response-anchor comments.

Bug Fixes:

  • Allow failed recorded-comment chunks to remain retryable instead of treating them as completed.
  • Refresh recorded comments when Miyou settings change while preserving existing NicoNico comments when Miyou is disabled.

Enhancements:

  • Improve recorded-comment presentation by removing URLs, optionally filtering response anchors, updating renderers when data changes, exposing partial results during acquisition, and removing duplicate Miyou comments.
  • Preserve compatibility with previously stored channel-level source visibility when migrating to feed-specific source keys.

Build:

  • Update the plugin manifest for the NicoJK changes.

Tests:

  • Add coverage for Miyou parsing and timeline conversion, feed source keys, duplicate removal, renderer text formatting, and recorded-comment retry behavior.

@sourcery-ai

sourcery-ai Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

レビュアー向けガイド

Miyou の 5ch ログを nicojk の過去ログコメントに統合し、ソースごと/オリジンごとのフィルタリングと件数表示を導入します。また、重複排除とエラーハンドリングを備えた Miyou の認証・取得パイプラインを追加し、レスアンカーによるフィルタリング、再読み込み、新しい設定などのレンダラー/UX の変更を行います。

Miyou の過去ログコメント統合のシーケンス図

sequenceDiagram
    participant User
    participant OptionsPage
    participant App
    participant KakologManager
    participant MiyouClient
    participant MiyouAPI
    User->>OptionsPage: saveSettings()
    OptionsPage->>App: settings updated
    App->>MiyouClient: clearMiyouAuth()
    App->>KakologManager: refreshMiyou(duration)
    KakologManager->>MiyouClient: fetchMiyouComments(channel, start, end)
    MiyouClient->>MiyouAPI: POST /auth/moritapo
    MiyouAPI-->>MiyouClient: token
    MiyouClient->>MiyouAPI: GET /miyou/comments
    MiyouAPI-->>MiyouClient: Miyou comments
    MiyouClient-->>KakologManager: convertMiyouComment()
    KakologManager-->>App: synchronized comments
    App-->>User: update recorded comments
Loading

ファイル単位の変更

変更 詳細 ファイル
Miyou の 5ch コメントを、オリジン対応 ID と重複排除を備えた過去ログ取得パイプラインおよびデータモデルに統合。
  • buildMiyouCommentId と origin="miyou" により、Miyou 由来のコメントに対応できるようコメントモデルと ID を拡張。
  • チャンネル/ソース/コンテキスト定義に Miyou のチャンネルメタデータを追加し、buildPrimarySource とソースリゾルバーを通じて伝播。
  • KakologManager に Miyou の取得処理を実装。NicoNico と Miyou のチャンクを統合し、オリジンごとの取得オフセットを追跡し、sourceOrdinal/no/content に基づいて Miyou コメントの重複を排除。
  • 既に取得済みの NicoNico の期間を対象に、Miyou コメントのみを再取得する KakologManager.refreshMiyou を追加。設定と進行中の取得処理を考慮。
  • miyouEnabled が false の場合に、同期対象から Miyou コメントを任意で除外できるよう同期処理を調整。
src/plugins/nicojk/comment-client.ts
src/plugins/nicojk/comment-id.ts
src/plugins/nicojk/context.ts
src/plugins/nicojk/definitions.ts
src/plugins/nicojk/kakolog-manager.ts
src/plugins/nicojk/source-resolver.ts
認証、解析、NiconicoComment への変換に対応した Miyou API クライアントを導入。
  • miyou-comment-client に Miyou コメントの型、レスポンス解析、堅牢なフィールド変換を実装。
  • キャッシュトークンと設定ベースの署名を使用する Moritapo ベースの認証フロー、および clearMiyouAuth フックを追加。
  • fetchMiyouComments と convertMiyouComment を公開し、Miyou コメントを、プライマリまたは同時配信ソースを基準に適切な vpos アンカーを設定した NiconicoComment に変換。
src/plugins/nicojk/miyou-comment-client.ts
オリジンごとのコメントソースキーと UI フィルタリングを追加し、パネルに件数とオリジンラベルを表示。
  • チャンネルのソースキーとオリジン(niconico/miyou)を組み合わせたソースキーを導出するコメントソースヘルパーと、コンテキストからキーを列挙するユーティリティを導入。
  • PanelPage と OverlayPage の表示ロジックをオリジン対応キーに更新し、can-show-only-source、切り替え、正規化を含む Miyou フィードを考慮。
  • パネル情報ポップアップを拡張し、ソースごとの合計件数、オリジンごとの件数、オリジンラベルを表示。オリジン単位でのミュート/表示対象限定を可能にし、過去ログコメントの再読み込み操作を追加。
src/plugins/nicojk/comment-source.ts
src/plugins/nicojk/App.tsx
src/plugins/nicojk/components/PanelPage.tsx
src/plugins/nicojk/components/OverlayPage.tsx
Miyou の設定、認証の無効化、UX(メールアドレス/パスワード、有効化フラグ、過去ログコメントの再読み込み)を接続。
  • NicoJKSettings と DEFAULT_SETTINGS を拡張し、Miyou の有効化フラグと認証情報を追加。保存済みの値も正規化。
  • Miyou 用のオプション UI を追加。5ch ログ取得の有効/無効、メールアドレス/パスワードフォーム、保存ボタンに対応。また、オプションセクションを再編成し、showResponseAnchorComments トグルを追加。
  • App で Miyou 設定の署名を追跡し、変更時に認証情報を消去。設定変更時には、キャッシュから Miyou コメントを削除するか、KakologManager.refreshMiyou を通じて再取得。また、過去ログコメントの再読み込みとマネージャー/状態のリセットを行うオーバーレイ・パネル間のメッセージングを追加。
src/plugins/nicojk/ng-settings.ts
src/plugins/nicojk/components/OptionsPage.tsx
src/plugins/nicojk/App.tsx
過去ログ再生時のレンダラーによるコメント前処理と再描画動作を改善。レスアンカーと URL のフィルタリングに対応。
  • formatRendererCommentContent を追加し、デフォルトでレスアンカーコメントを除外するとともに、URL/h抜き URL を削除。アンカーを保持するオプションにも対応。
  • OverlayPage.toFormattedComment で新しいフォーマッターを使用し、レンダラーフィルターのシグネチャに showResponseAnchorComments を追加。切り替え時にレンダラーを再構築。
  • OverlayPage のレンダラー再生成がコメントデータのシグネチャ(id/vpos/sourceOrdinal)の変更を検知するようにし、phase が "none" の場合でもコメントが存在すればフォーマット済みレンダラーを使用可能に。
src/plugins/nicojk/renderer-comment-text.ts
src/plugins/nicojk/components/OverlayPage.tsx
src/plugins/nicojk/components/OptionsPage.tsx
Miyou 統合、コメントソースキーのセマンティクス、レンダラーのテキスト整形、Kakolog のエラー/重複排除動作を網羅するテストを追加。
  • オリジンおよびコンテキストごとのコメントソースキー導出、ならびにタイムラインアンカーを含む Miyou クライアントの解析・変換テストを作成。
  • レスアンカーと URL 周辺のレンダラーコメントテキスト整形テストを追加。
  • Miyou の重複排除動作、kakolog API のエラーハンドリング、および dedupeMiyouComments の公開を検証するよう Kakolog テストを拡張。
tests/nicojk-comment-source.test.ts
tests/nicojk-miyou-comment-client.test.ts
tests/nicojk-renderer-comment-text.test.ts
tests/nicojk-chapter-source-sync.test.ts

関連 Issue に対する評価

Issue 目的 対応済み 説明
#10 過去ログ再生時に、Miyou の 5ch コメントを取得できるようにする。 ✅
#10 取得した Miyou コメントを既存の過去ログコメントへ統合し、ニコニココメントと同じタイムラインで表示・検索・フィルタリングできるようにする。 ✅
#10 Miyou のチャンネル設定、認証情報、取得状態およびコメントソースをユーザーが管理できるようにする。 ✅

関連する可能性のある Issue


ヒントとコマンド

Sourcery とのやり取り

  • 新しいレビューを実行: プルリクエストに @sourcery-ai review とコメントします。
  • 議論を続ける: Sourcery のレビューコメントに直接返信します。
  • レビューコメントから GitHub Issue を作成: レビューコメントに返信して、Sourcery にそのコメントから Issue を作成するよう依頼します。レビューコメントに @sourcery-ai issue と返信して作成することもできます。
  • プルリクエストのタイトルを生成: プルリクエストのタイトル内の任意の場所に @sourcery-ai と記述すると、いつでもタイトルを生成できます。プルリクエストに @sourcery-ai title とコメントして、タイトルを再生成することもできます。
  • プルリクエストの概要を生成: プルリクエスト本文内の任意の場所に @sourcery-ai summary と記述すると、指定した場所に PR の概要を生成できます。プルリクエストに @sourcery-ai summary とコメントして、概要を再生成することもできます。
  • レビュアー向けガイドを生成: プルリクエストに @sourcery-ai guide とコメントすると、レビュアー向けガイドをいつでも再生成できます。
  • Sourcery のコメントをすべて解決: プルリクエストに @sourcery-ai resolve とコメントすると、Sourcery のコメントをすべて解決済みにできます。すべてのコメントに対応済みで、これ以上表示したくない場合に便利です。
  • Sourcery のレビューをすべて却下: プルリクエストに @sourcery-ai dismiss とコメントすると、既存の Sourcery のレビューをすべて却下できます。新しいレビューを最初からやり直したい場合に特に便利です。その場合は、@sourcery-ai review とコメントして新しいレビューを開始することを忘れないでください。

利用環境のカスタマイズ

ダッシュボード にアクセスして、以下を行えます。

  • Sourcery が生成するプルリクエスト概要、レビュアー向けガイドなどのレビュー機能を有効化または無効化する。
  • レビュー言語を変更する。
  • カスタムレビュー指示を追加、削除、編集する。
  • その他のレビュー設定を調整する。

ヘルプの利用

Original review guide in English

Reviewer's Guide

Integrates Miyou 5ch logs into nicojk recorded comments, introduces per-source/per-origin filtering and counts, adds Miyou authentication and fetching pipeline with deduplication and error handling, and adds renderer/UX changes like response-anchor filtering, reload, and new settings.

Sequence diagram for Miyou recorded comment integration

sequenceDiagram
    participant User
    participant OptionsPage
    participant App
    participant KakologManager
    participant MiyouClient
    participant MiyouAPI
    User->>OptionsPage: saveSettings()
    OptionsPage->>App: settings updated
    App->>MiyouClient: clearMiyouAuth()
    App->>KakologManager: refreshMiyou(duration)
    KakologManager->>MiyouClient: fetchMiyouComments(channel, start, end)
    MiyouClient->>MiyouAPI: POST /auth/moritapo
    MiyouAPI-->>MiyouClient: token
    MiyouClient->>MiyouAPI: GET /miyou/comments
    MiyouAPI-->>MiyouClient: Miyou comments
    MiyouClient-->>KakologManager: convertMiyouComment()
    KakologManager-->>App: synchronized comments
    App-->>User: update recorded comments
Loading

File-Level Changes

Change Details Files
Integrate Miyou 5ch comments into recorded kakolog pipeline and data model with origin-aware IDs and deduplication.
  • Extend comment model and IDs to support Miyou-origin comments via buildMiyouCommentId and origin="miyou".
  • Add Miyou channel metadata to channel/source/context definitions and propagate through buildPrimarySource and source resolver.
  • Implement Miyou fetching in KakologManager, combining NicoNico and Miyou chunks, tracking per-origin fetch offsets, and deduping Miyou comments by sourceOrdinal/no/content.
  • Add KakologManager.refreshMiyou to re-fetch only Miyou comments over already-fetched NicoNico windows, respecting settings and in-flight fetches.
  • Adjust synchronization to optionally exclude Miyou comments when miyouEnabled is false.
src/plugins/nicojk/comment-client.ts
src/plugins/nicojk/comment-id.ts
src/plugins/nicojk/context.ts
src/plugins/nicojk/definitions.ts
src/plugins/nicojk/kakolog-manager.ts
src/plugins/nicojk/source-resolver.ts
Introduce Miyou API client with authentication, parsing, and conversion to NiconicoComment.
  • Implement Miyou comment types, response parsing, and robust field coercion in miyou-comment-client.
  • Add Moritapo-based authentication flow with cached tokens and a settings-based signature, plus clearMiyouAuth hook.
  • Expose fetchMiyouComments and convertMiyouComment that map Miyou comments into NiconicoComment with proper vpos anchoring against primary or simulcast sources.
src/plugins/nicojk/miyou-comment-client.ts
Add per-origin comment source keys and UI filtering, plus counts and origin labels in the panel.
  • Introduce comment-source helpers to derive source keys that combine channel source key and origin (niconico/miyou), and utilities to enumerate keys from context.
  • Update PanelPage and OverlayPage visibility logic to use origin-aware keys and to consider Miyou feeds, including can-show-only-source, toggling, and normalization.
  • Enhance panel info popup to show per-source total counts, per-origin counts, origin labels, and allow muting/show-only per origin, plus a reload-recorded-comments control.
src/plugins/nicojk/comment-source.ts
src/plugins/nicojk/App.tsx
src/plugins/nicojk/components/PanelPage.tsx
src/plugins/nicojk/components/OverlayPage.tsx
Wire Miyou settings, auth invalidation, and UX (email/password, enable flag, and recorded comment reload).
  • Extend NicoJKSettings and DEFAULT_SETTINGS with Miyou enable flag and credentials, and normalize persisted values.
  • Add options UI for Miyou: enable/disable 5ch log retrieval, email/password form, and save button; also reorganize options sections and add showResponseAnchorComments toggle.
  • In App, track Miyou settings signature, clear auth when it changes, and on settings changes either strip Miyou comments from caches or refresh them via KakologManager.refreshMiyou; also add overlay-panel messaging to reload recorded comments and reset managers/state.
src/plugins/nicojk/ng-settings.ts
src/plugins/nicojk/components/OptionsPage.tsx
src/plugins/nicojk/App.tsx
Improve renderer comment preprocessing and re-render behavior for recorded playback, including response-anchor and URL filtering.
  • Add formatRendererCommentContent to drop response-anchor comments by default and strip URLs/h抜き URLs, with an option to keep anchors.
  • Use the new formatter in OverlayPage.toFormattedComment and add showResponseAnchorComments to renderer filter signature so renderer rebuilds when toggled.
  • Make OverlayPage renderer recreation sensitive to comment data signature (id/vpos/sourceOrdinal) and allow formatted renderer when there are comments even in phase "none".
src/plugins/nicojk/renderer-comment-text.ts
src/plugins/nicojk/components/OverlayPage.tsx
src/plugins/nicojk/components/OptionsPage.tsx
Add tests covering Miyou integration, comment-source key semantics, renderer text formatting, and Kakolog error/dedup behavior.
  • Create tests for comment-source key derivation per origin and context, and for Miyou client parsing and conversion including timeline anchoring.
  • Add tests for renderer comment text formatting around response anchors and URLs.
  • Extend Kakolog tests to cover Miyou deduplication behavior and error handling for kakolog API, plus exposure of dedupeMiyouComments.
tests/nicojk-comment-source.test.ts
tests/nicojk-miyou-comment-client.test.ts
tests/nicojk-renderer-comment-text.test.ts
tests/nicojk-chapter-source-sync.test.ts

Assessment against linked issues

Issue Objective Addressed Explanation
#10 過去ログ再生時に、Miyou の 5ch コメントを取得できるようにする。 ✅
#10 取得した Miyou コメントを既存の過去ログコメントへ統合し、ニコニココメントと同じタイムラインで表示・検索・フィルタリングできるようにする。 ✅
#10 Miyou のチャンネル設定、認証情報、取得状態およびコメントソースをユーザーが管理できるようにする。 ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

こんにちは。1件の問題を見つけました

AIエージェント向けプロンプト
このコードレビューのコメントに対応してください:

## 個別のコメント

### コメント1
<location path="src/plugins/nicojk/App.tsx" line_range="916-918" />
<code_context>
+
+				pendingResumeRef.current.delete(playerID);
+				const manager = kakologManagersRef.current.get(playerID);
+				manager?.setProgressListener(null);
+				manager?.clearCache();
+				resetRecordedCommentsState(data);
+				if (manager && data.jkContext) {
+					data.jkContext = withKakologSourceStates(data.jkContext, manager);
</code_context>
<issue_to_address>
**issue (bug_risk):** 録画コメントの再読み込みハンドラーはマネージャーのキャッシュを消去してプレーヤーの状態をリセットしますが、新しい `fetchWithLimit`/`fetchMore` 処理を開始していません。そのため、再読み込みボタンをクリックすると、後から無関係なイベントによって読み込みが発生するまで、録画再生にコメントが表示されなくなります。

**Triggers:** ユーザーが録画番組に対して「コメントを最初から再取得」をクリックしたとき。

**Suggested fix:** 状態をリセットした後、`playerID` に対する既存の録画コメント初期読み込み処理を呼び出す(またはマネージャーの fetch メソッドを明示的に呼び出す)とともに、読み込み状態とトークン状態を一貫して更新してください。
</issue_to_address>

Sourceryによる評価

人間のレビュアーによる確認が必要です。 最初に対応すべき指摘が1件あります。また、新しいサードパーティサービスへの認証リクエストを追加し、ユーザーのMiyou認証情報を保存しているため、バグによって認証情報が誤って送信されたり、誤ったコメントデータが公開・表示されたりする可能性があります。機能を無効化するか変更を元に戻せば今後のリクエストは停止できますが、すでに送信された認証情報や、外部サービス上で発生した副作用を取り消すことはできません。

ブロッキング対象の指摘:src/plugins/nicojk/App.tsx:918


Sourceryはオープンソース向けに無料です。レビューが役に立った場合は、共有をご検討ください ✨
もっと役立つレビューにするため、各コメントの 👍 または 👎 をクリックしてください。フィードバックをもとにレビューを改善します。
Original comment in English

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/plugins/nicojk/App.tsx" line_range="916-918" />
<code_context>
+
+				pendingResumeRef.current.delete(playerID);
+				const manager = kakologManagersRef.current.get(playerID);
+				manager?.setProgressListener(null);
+				manager?.clearCache();
+				resetRecordedCommentsState(data);
+				if (manager && data.jkContext) {
+					data.jkContext = withKakologSourceStates(data.jkContext, manager);
</code_context>
<issue_to_address>
**issue (bug_risk):** The recorded-comments reload handler clears the manager cache and resets the player state, but never starts a new `fetchWithLimit`/`fetchMore` operation. Clicking the reload button therefore leaves recorded playback with no comments until an unrelated later event happens to trigger loading.

**Triggers:** When the user clicks “コメントを最初から再取得” for a recorded program.

**Suggested fix:** After resetting the state, invoke the existing initial recorded-comment loading path for `playerID` (or explicitly call the manager’s fetch method) and update the loading/token state consistently.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and this adds authenticated requests to a new third-party service and stores the user's Miyou credentials, so a bug could send credentials incorrectly or expose and display incorrect comment data. Disabling the feature or reverting stops future requests, but it cannot undo credentials already transmitted or any external-service side effects.

Blocking findings: src/plugins/nicojk/App.tsx:918


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/plugins/nicojk/App.tsx
@ci7lus
ci7lus merged commit 9e3e3a8 into main Aug 22, 2026
3 checks passed
@ci7lus
ci7lus deleted the feat/miyou branch August 22, 2026 12:03
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.

miyouのコメントを取得する

1 participant