Skip to content

Conversation

@deflis
Copy link
Owner

@deflis deflis commented Jan 11, 2026

#213 での考慮漏れ。
index.ts の関数シグネチャを変更したが、ブラウザ版 index.browser.ts で関数にオプションを追加していなかったので、ブラウザでランキング履歴を取得するときだけ壊れるようになっていた。

Copilot AI review requested due to automatic review settings January 11, 2026 14:08
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist
Copy link

Summary of Changes

Hello @deflis, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the rankingHistory function by introducing an optional options parameter. This change significantly improves the function's flexibility, allowing users to pass custom execution options to the underlying API call, thereby enabling more tailored interactions with the ranking history API.

Highlights

  • API Flexibility: The rankingHistory function in src/index.browser.ts now accepts an optional options parameter of type ExecuteOptions, allowing for more customizable API calls.
  • Type Definition Update: The ExecuteOptions type is now imported from narou.js to support the new parameter in the rankingHistory function signature.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

このプルリクエストは、ブラウザ版の rankingHistory 関数で fetchOptions を渡せるようにする改善ですね。APIの柔軟性を高めるという目的は素晴らしいと思います。しかし、現在の実装では関数のシグネチャが変更されており、既存のコードとの後方互換性が失われる「破壊的変更」となってしまっています。これを修正するための提案をコメントに記載しました。また、コードの可読性をさらに向上させるための小さな提案も加えています。詳細については、各レビューコメントをご確認ください。

Copy link
Contributor

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 pull request fixes a bug in the browser version of the rankingHistory function where the ExecuteOptions parameter was not being accepted or passed through to the underlying API call. This brings it into parity with the non-browser version of the same function.

Changes:

  • Added ExecuteOptions import from narou.ts to support fetch customization
  • Updated rankingHistory function signature to accept an optional options parameter
  • Modified the API call to pass the options through to executeRankingHistory

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

- ExecuteOptions型をインポート
- api.executeRankingHistoryにoptionsを渡すよう修正
@deflis deflis force-pushed the fix-browser-options branch from c1e467d to ad02dae Compare January 11, 2026 14:14
@deflis
Copy link
Owner Author

deflis commented Jan 11, 2026

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

このプルリクエストは、ブラウザ版の rankingHistory 関数に fetchOptions を渡すための options パラメータが欠けていた問題を修正するものです。変更内容を確認しました。
主な変更点は src/index.browser.ts ファイルで、rankingHistory 関数のシグネチャに options?: ExecuteOptions を追加し、JSDocも更新しています。これにより、Node.js版とブラウザ版でAPIの互換性が保たれるようになります。
修正は適切であり、問題なく動作すると思われます。1点、JSDocの可読性をさらに向上させるための提案をコメントしました。

* なろう殿堂入り API でランキング履歴を取得する
* @param {string} ncode 小説のNコード
* @param {ExecuteOptions} [options] 実行オプション
* @param {NarouNovel} [api] API実行クラスのインスタンス

Choose a reason for hiding this comment

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

medium

JSDocの api パラメータにデフォルト値を記載すると、より分かりやすくなります。JSDocの標準的な記法に従い [api=narouNovelJsonp] のように記述することで、この関数を利用する開発者がIDEのヒントなどでデフォルトの挙動を把握しやすくなります。

Suggested change
* @param {NarouNovel} [api] API実行クラスのインスタンス
* @param {NarouNovel} [api=narouNovelJsonp] API実行クラスのインスタンス

@deflis deflis merged commit 1741f02 into master Jan 11, 2026
7 checks passed
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.

2 participants