fa icon indicating copy to clipboard operation
fa copied to clipboard

Expose ignoreSelection in gamemain.lua

Open 4z0t opened this issue 5 months ago โ€ข 2 comments

Description of the proposed changes

Allow mods read ignoreSelection with no hooking.

Checklist

Summary by CodeRabbit

  • Refactor
    • Internal code improvements to enhance maintainability and code organization.

โœ๏ธ Tip: You can customize this high-level summary in your review settings.

4z0t avatar Nov 20 '25 16:11 4z0t

Walkthrough

A public accessor function IsIgnoredSelection() has been added to expose the ignoreSelection flag. The OnSelectionChanged function now uses this accessor instead of directly accessing the flag variable, improving encapsulation.

Changes

Cohort / File(s) Summary
Accessor refactor
lua/ui/game/gamemain.lua
Added public accessor function IsIgnoredSelection() returning the ignoreSelection flag; updated OnSelectionChanged to call the accessor instead of direct variable access

Estimated code review effort

๐ŸŽฏ 2 (Simple) | โฑ๏ธ ~5-10 minutes

  • Single file with a straightforward accessor pattern addition
  • Direct variable access replaced with function call for consistency

Poem

A rabbit hops through code so bright, With accessors hiding flags from sight, No more peering at private affairsโ€” Public functions show they care! ๐Ÿฐโœจ

Pre-merge checks and finishing touches

โŒ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage โš ๏ธ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check โ“ Inconclusive The description covers the main purpose but is missing required sections and checklist items. Testing section is absent, and changelog documentation and reviewer assignment are unchecked. Add a Testing done section describing validation steps, complete the changelog snippet, and assign 2-3 reviewers from the contributor list.
โœ… Passed checks (1 passed)
Check name Status Explanation
Title check โœ… Passed The title clearly and specifically describes the main change: exposing the ignoreSelection variable as a public accessor function in gamemain.lua.
โœจ Finishing touches
  • [ ] ๐Ÿ“ Generate docstrings
๐Ÿงช Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

๐Ÿ“œ Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 4c2ceab38053643b692ea8782c403e34b3382e78 and 12db7e60cbdfbf8dfe3a23189a4a383fd5b6b298.

๐Ÿ“’ Files selected for processing (1)
  • lua/ui/game/gamemain.lua (2 hunks)
๐Ÿ”‡ Additional comments (2)
lua/ui/game/gamemain.lua (2)

45-48: LGTM! Clean accessor implementation.

The new IsIgnoredSelection() function properly exposes the ignoreSelection flag for external access, achieving the PR's goal of allowing mods to read this value without hooking. The function is well-annotated and follows the naming convention used elsewhere in the codebase (e.g., IsNISMode()).


619-619: Good refactoring to use the new accessor.

Updating the internal usage to call IsIgnoredSelection() instead of directly accessing the flag demonstrates good consistency and ensures the codebase uses the same public API that external consumers will use.

[!TIP]

๐Ÿ“ Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests โ€” including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. ๐Ÿ“ Description โ€” Summarize the main change in 50โ€“60 words, explaining what was done.
  2. ๐Ÿ““ References โ€” List relevant issues, discussions, documentation, or related PRs.
  3. ๐Ÿ“ฆ Dependencies & Requirements โ€” Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. ๐Ÿ“Š Contributor Summary โ€” Include a Markdown table showing contributions: | Contributor | Lines Added | Lines Removed | Files Changed |
  5. โœ”๏ธ Additional Notes โ€” Add any extra reviewer context. Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

โค๏ธ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Nov 20 '25 16:11 coderabbitai[bot]

The name IsIgnoredSelection sounds clunky - what about IsSelectionIgnored?

Hdt80bro avatar Nov 20 '25 17:11 Hdt80bro