Skip to content

Options: add missing tooltips#7044

Open
NoryGit wants to merge 5 commits intoFAForever:developfrom
NoryGit:pan_desc
Open

Options: add missing tooltips#7044
NoryGit wants to merge 5 commits intoFAForever:developfrom
NoryGit:pan_desc

Conversation

@NoryGit
Copy link

@NoryGit NoryGit commented Feb 19, 2026

Description of the proposed changes

This also removes the warnings when hovering over the affected options.

Checklist

- [ ] Changes are annotated, including comments where useful

Summary by CodeRabbit

  • New Features
    • Added tooltips for: invert middle-mouse pan, reclaim batching distance threshold, painting duration while observing, assist-to-upgrade for radars, factory repeat-build default, and showing player names (client-side).
  • Bug Fixes
    • Clarified assist-to-upgrade tooltip to reference mass extractors specifically.
    • Fixed reclaim batching distance threshold option key and ensured batching respects the configured threshold.
  • Documentation
    • Added changelog entry documenting the new tooltips.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

📝 Walkthrough

Walkthrough

Adds several new UI tooltip entries, fixes/renames a public option key for reclaim batching distance, updates code that reads that option, and adds a changelog snippet documenting the tooltip additions. (50 words)

Changes

Cohort / File(s) Summary
UI Tooltips
lua/ui/help/tooltips.lua
Added tooltip entries: options_invert_middle_mouse_button, ooptions_reclaim_batching_distance_threshold (typo-prefixed duplicate), options_painting_duration_observing, options_assist_to_upgrade_radar, options_repeatbuild, options_show_player_names. Updated options_assist_to_upgrade.description to target mass extractors.
Options declaration
lua/options/options.lua
Renamed public option key from reclaim_batching_distance_tresholdreclaim_batching_distance_threshold (fixes typo in public key).
Reclaim logic
lua/ui/game/reclaim.lua
Updated lookup to use the corrected option key reclaim_batching_distance_threshold when gating reclaim batching behavior.
Changelog
changelog/snippets/fix.7044.md
Added snippet documenting the new/missing tooltip entries for options.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nibble keys both fixed and new,
Tooltips planted, tidy too.
A threshold renamed, a duplicate ghost—
I hopped around and mattered most. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Options: add missing tooltips' is clear, concise, and directly matches the main objective of the pull request—adding missing tooltip entries for options.
Description check ✅ Passed The description covers the main change and mentions tooltip additions and warnings removal, but lacks testing details and reviewer requests; however, the changelog snippet requirement is met.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
lua/ui/help/tooltips.lua (1)

590-591: LOC key suffix convention is inconsistent with nearby entries.

Other descriptive tooltip keys in this file use paired _TITLE / _DESCRIPTION suffixes (e.g., ASSIST_TO_UPGRADE_TITLE / ASSIST_TO_UPGRADE_DESCRIPTION, WATER_DEPTH_ASSISTANCE_TITLE / WATER_DEPTH_ASSISTANCE_DESCRIPTION). The new entry uses no suffix on the title key (INVERT_MOUSE_PAN) and an abbreviated _DESC suffix on the description key (INVERT_MOUSE_PAN_DESC). This matters most if localization strings are ever added to a .loc file, as translators and tooling will expect consistent naming.

♻️ Suggested rename for consistency
-        title = "<LOC INVERT_MOUSE_PAN>Invert pan direction with middle mouse button",
-        description = "<LOC INVERT_MOUSE_PAN_DESC>When enabled, dragging with the middle mouse button moves the camera in the opposite direction.",
+        title = "<LOC INVERT_MOUSE_PAN_TITLE>Invert pan direction with middle mouse button",
+        description = "<LOC INVERT_MOUSE_PAN_DESCRIPTION>When enabled, dragging with the middle mouse button moves the camera in the opposite direction.",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lua/ui/help/tooltips.lua` around lines 590 - 591, The LOC key names for this
tooltip are inconsistent: change the title key "INVERT_MOUSE_PAN" to
"INVERT_MOUSE_PAN_TITLE" and change the description key "INVERT_MOUSE_PAN_DESC"
to "INVERT_MOUSE_PAN_DESCRIPTION" so they match the surrounding *_TITLE /
*_DESCRIPTION convention; update the two entries in the tooltip table (the title
and description fields in tooltips.lua) and ensure any corresponding .loc or
lookup usages reference the new keys (search for INVERT_MOUSE_PAN and
INVERT_MOUSE_PAN_DESC to update callers).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@lua/ui/help/tooltips.lua`:
- Around line 590-591: The LOC key names for this tooltip are inconsistent:
change the title key "INVERT_MOUSE_PAN" to "INVERT_MOUSE_PAN_TITLE" and change
the description key "INVERT_MOUSE_PAN_DESC" to "INVERT_MOUSE_PAN_DESCRIPTION" so
they match the surrounding *_TITLE / *_DESCRIPTION convention; update the two
entries in the tooltip table (the title and description fields in tooltips.lua)
and ensure any corresponding .loc or lookup usages reference the new keys
(search for INVERT_MOUSE_PAN and INVERT_MOUSE_PAN_DESC to update callers).

@NoryGit NoryGit changed the title Add a missing tooltip for the invert middle mouse pan option Add three missing tooltips Feb 19, 2026
@NoryGit NoryGit changed the title Add three missing tooltips Options: add missing tooltips Feb 19, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
lua/ui/help/tooltips.lua (1)

673-676: Minor capitalization inconsistency in title

"Assist to upgrade radars" (sentence case) versus the adjacent "Assist to Upgrade" (title case) in options_assist_to_upgrade. Aligning to title case would keep these related entries consistent.

✏️ Suggested change
 options_assist_to_upgrade_radar = {
-    title = "<LOC ASSIST_TO_UPGRADE_RADAR>Assist to upgrade radars",
+    title = "<LOC ASSIST_TO_UPGRADE_RADAR>Assist to Upgrade Radars",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lua/ui/help/tooltips.lua` around lines 673 - 676, The title string in
options_assist_to_upgrade_radar uses sentence case ("Assist to upgrade radars")
while the related option options_assist_to_upgrade uses title case; update the
title value in options_assist_to_upgrade_radar to Title Case (e.g., "Assist to
Upgrade Radars") so it matches the casing style of options_assist_to_upgrade and
keeps UI entries consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@lua/ui/help/tooltips.lua`:
- Around line 681-684: The title/description pair for options_show_player_names
is contradictory (title says "Show Player Names" but description says it hides
them); update the description to describe the effect when the option is enabled
to match the title and the pattern used by other entries (e.g.,
options_painting, options_assist_to_upgrade). In the options_show_player_names
table change the description string to something like "When enabled, player
names are shown locally in the game; this change is client-side only." ensuring
the title remains options_show_player_names.title and the explanatory text is in
options_show_player_names.description.
- Around line 609-612: Rename the misspelled Lua key
options_reclaim_batching_distance_treshold to
options_reclaim_batching_distance_threshold everywhere it appears; update the
entry in the tooltip table (the shown diff), the options table entry, and the
reclaim handling code that references the key so lookups match the correctly
spelled key. Ensure you update all three occurrences and run a quick search for
any other references to options_reclaim_batching_distance_treshold to replace
them with the corrected key.

---

Nitpick comments:
In `@lua/ui/help/tooltips.lua`:
- Around line 673-676: The title string in options_assist_to_upgrade_radar uses
sentence case ("Assist to upgrade radars") while the related option
options_assist_to_upgrade uses title case; update the title value in
options_assist_to_upgrade_radar to Title Case (e.g., "Assist to Upgrade Radars")
so it matches the casing style of options_assist_to_upgrade and keeps UI entries
consistent.

Comment on lines 609 to 612
options_reclaim_batching_distance_treshold = {
title = "<LOC OPTIONS_RECLAIM_BATCHING_DISTANCE>Reclaim Batching Distance Threshold",
description = "<LOC OPTIONS_RECLAIM_BATCHING_DISTANCE_DESCRIPTION>Adjusts the distance threshold for batching reclaim commands. Higher values group more props together.",
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

rg -n --type=lua -i "reclaim_batching_distance" -A 5 -B 2

Repository: FAForever/fa

Length of output: 3283


Fix spelling: options_reclaim_batching_distance_tresholdoptions_reclaim_batching_distance_threshold

The Lua key options_reclaim_batching_distance_treshold misspells "threshold" as "treshold". This typo is consistent across the codebase (lua/options/options.lua line 1077 and lua/ui/game/reclaim.lua line 379), so the tooltip lookup will succeed, but the user-facing title correctly spells it as "Threshold". All three occurrences should be corrected to match proper spelling.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lua/ui/help/tooltips.lua` around lines 609 - 612, Rename the misspelled Lua
key options_reclaim_batching_distance_treshold to
options_reclaim_batching_distance_threshold everywhere it appears; update the
entry in the tooltip table (the shown diff), the options table entry, and the
reclaim handling code that references the key so lookups match the correctly
spelled key. Ensure you update all three occurrences and run a quick search for
any other references to options_reclaim_batching_distance_treshold to replace
them with the corrected key.

Comment on lines +681 to +684
options_show_player_names = {
title = "<LOC options_show_player_names_title>Show Player Names",
description = "<LOC options_show_player_names_description>Locally hides player names in the game. This change is client-side only.",
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Title and description are semantically contradictory

The title is "Show Player Names", which implies that enabling the option shows player names. However, the description says "Locally hides player names in the game." — the opposite behaviour. Every comparable option in this file describes what happens when the option is enabled (e.g., options_painting: "When enabled, you can send and receive brush strokes…"; options_assist_to_upgrade: "When enabled, mass extractors automatically…"). As written, a user enabling this option would be confused.

The description likely needs to be reworded to describe the enabled state, for example:

✏️ Suggested rewording
 options_show_player_names = {
     title = "<LOC options_show_player_names_title>Show Player Names",
-    description = "<LOC options_show_player_names_description>Locally hides player names in the game. This change is client-side only.",
+    description = "<LOC options_show_player_names_description>When enabled, player names are shown in the game. This change is client-side only.",
 },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lua/ui/help/tooltips.lua` around lines 681 - 684, The title/description pair
for options_show_player_names is contradictory (title says "Show Player Names"
but description says it hides them); update the description to describe the
effect when the option is enabled to match the title and the pattern used by
other entries (e.g., options_painting, options_assist_to_upgrade). In the
options_show_player_names table change the description string to something like
"When enabled, player names are shown locally in the game; this change is
client-side only." ensuring the title remains options_show_player_names.title
and the explanatory text is in options_show_player_names.description.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@lua/options/options.lua`:
- Line 1077: The renamed profile key causes existing profiles to lose their
value; update the read site (e.g. in reclaim.lua where
GetFromCurrentProfile('options.reclaim_batching_distance_threshold') is used) to
attempt the new key first and, if nil, fall back to the old misspelled key
'options.reclaim_batching_distance_treshold' and use that value (then continue
using the default 150 only if both are nil); this one-line migration preserves
existing user settings without changing profile storage and can be removed after
a full migration cycle.

In `@lua/ui/help/tooltips.lua`:
- Line 609: The tooltip key is misspelled as
ooptions_reclaim_batching_distance_threshold — rename it to
options_reclaim_batching_distance_threshold so the options UI can find and
display the tooltip; locate the entry in lua/ui/help/tooltips.lua (the table key
currently named ooptions_reclaim_batching_distance_threshold) and correct the
key to options_reclaim_batching_distance_threshold, then run a quick UI hover to
verify the tooltip appears.

---

Duplicate comments:
In `@lua/ui/help/tooltips.lua`:
- Around line 681-684: The description for the tooltip entry
options_show_player_names semantically contradicts its title — update the
description to describe what the option enables (e.g., that toggling it controls
whether player names are shown locally and that states are 'on' vs
'allies-only') instead of saying it "locally hides" names; also verify the
tooltip lookup logic that resolves keys (the code that constructs the lookup
key, likely where Tooltips[...] is accessed) because the option key in
options.lua is already "options_show_player_names" and a lookup implementation
that prefixes "options_" would produce "options_options_show_player_names" (fix
the lookup to use the raw key or rename the tooltip entry to match the lookup).
Ensure you update the tooltip text for options_show_player_names and confirm/fix
the lookup code accordingly.

{
title = "<LOC OPTIONS_RECLAIM_BATCHING_DISTANCE>Reclaim Batching Distance Threshold",
key = 'reclaim_batching_distance_treshold',
key = 'reclaim_batching_distance_threshold',
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Silent reset of existing user profiles — consider migration fallback.

Renaming the stored key from reclaim_batching_distance_treshold to reclaim_batching_distance_threshold means any profile that already contains the old misspelled key will silently fall back to the default value (150) because GetFromCurrentProfile('options.reclaim_batching_distance_threshold') returns nil. No migration path is provided.

🛡️ Optional: one-liner migration in the threshold read site

A cheap fallback in reclaim.lua preserves old values without touching profile storage:

- if zoom < (Prefs.GetFromCurrentProfile('options.reclaim_batching_distance_threshold') or ZoomThreshold) then
+ local _threshold = Prefs.GetFromCurrentProfile('options.reclaim_batching_distance_threshold')
+     or Prefs.GetFromCurrentProfile('options.reclaim_batching_distance_treshold')
+     or ZoomThreshold
+ if zoom < _threshold then

Remove the fallback once a full profile-migration pass is done (or after one release cycle).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lua/options/options.lua` at line 1077, The renamed profile key causes
existing profiles to lose their value; update the read site (e.g. in reclaim.lua
where GetFromCurrentProfile('options.reclaim_batching_distance_threshold') is
used) to attempt the new key first and, if nil, fall back to the old misspelled
key 'options.reclaim_batching_distance_treshold' and use that value (then
continue using the default 150 only if both are nil); this one-line migration
preserves existing user settings without changing profile storage and can be
removed after a full migration cycle.

description = "<LOC OPTIONS_0318>The higher the value, the easier it becomes to select and target units or props. The value is in (screen) pixels. This threshold is specifically used when watching a replay, it makes it easier to hover over units.\r\n\r\nInteraction with units take precedence over props.\r\n\r\nWhen multiple entities are in range, the one nearest to the mouse location has precedence.",
},

ooptions_reclaim_batching_distance_threshold = {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Typo in tooltip key: ooptions_…options_… — tooltip will not be shown.

The entry key starts with oo instead of o. Every other option tooltip in this file uses the options_ prefix. The options UI will look up options_reclaim_batching_distance_threshold, which will not match ooptions_reclaim_batching_distance_threshold, so the tooltip remains absent and the hover warning persists — directly contradicting the PR's stated goal.

🐛 Proposed fix
-    ooptions_reclaim_batching_distance_threshold = {
+    options_reclaim_batching_distance_threshold = {
         title = "<LOC OPTIONS_RECLAIM_BATCHING_DISTANCE>Reclaim Batching Distance Threshold",
         description = "<LOC OPTIONS_RECLAIM_BATCHING_DISTANCE_DESCRIPTION>Adjusts the distance threshold for batching reclaim commands. Higher values group more props together.",
     },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ooptions_reclaim_batching_distance_threshold = {
options_reclaim_batching_distance_threshold = {
title = "<LOC OPTIONS_RECLAIM_BATCHING_DISTANCE>Reclaim Batching Distance Threshold",
description = "<LOC OPTIONS_RECLAIM_BATCHING_DISTANCE_DESCRIPTION>Adjusts the distance threshold for batching reclaim commands. Higher values group more props together.",
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lua/ui/help/tooltips.lua` at line 609, The tooltip key is misspelled as
ooptions_reclaim_batching_distance_threshold — rename it to
options_reclaim_batching_distance_threshold so the options UI can find and
display the tooltip; locate the entry in lua/ui/help/tooltips.lua (the table key
currently named ooptions_reclaim_batching_distance_threshold) and correct the
key to options_reclaim_batching_distance_threshold, then run a quick UI hover to
verify the tooltip appears.

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.

1 participant

Comments