Skip to content

Conversation

@sharrlotte
Copy link
Member

@sharrlotte sharrlotte commented Jan 29, 2026

Summary by CodeRabbit

  • New Features

    • Added a "Re-enable" control to restore previously enabled features.
    • Added a searchable/filterable features pane for easier discovery.
  • Bug Fixes / Behavior

    • God Mode is now disabled by default.
    • Increased HTTP timeouts to improve connection reliability.
    • Post-send behavior adjusted to reset the send control and trigger the input field interaction.
  • Chores

    • Updated mod version to v4.39.0-v8.

✏️ Tip: You can customize this high-level summary in your review settings.

The previous 30-second timeout was insufficient for some network conditions,
causing premature failures. Doubling to 60 seconds improves reliability.
Enable the feature only when explicitly selected by the user to prevent unintended gameplay effects.
@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

Walkthrough

Adds a re-enable UI action and FeatureManager.reEnable(), persists/restores enabled feature names during disableAll/reEnable, explicitly disables GodMode by default, increases two HTTP timeouts, and bumps mod version from v4.38.3-v8 to v4.39.0-v8.

Changes

Cohort / File(s) Summary
Version Management
mod.hjson
Bumps mod version from v4.38.3-v8 to v4.39.0-v8.
Feature manager & UI
src/mindustrytool/features/FeatureManager.java, src/mindustrytool/features/settings/FeatureSettingDialog.java
Adds FeatureManager.reEnable() to load mindustry-tool.enableds and re-enable listed features; disableAll() now saves enabled feature names to settings; UI adds a "Re-enable" button and a search/filter pane with rebuilt feature listing.
Feature metadata
src/mindustrytool/features/godmode/GodModeFeature.java
Sets GodMode metadata to enabledByDefault(false) (explicitly disabled by default).
Service timeouts
src/mindustrytool/services/PlayerConnectService.java
Increases two HTTP timeouts from 30000 ms to 60000 ms in findPlayerConnectRooms() and findPlayerConnectProvider().
Chat UI behavior
src/mindustrytool/features/chat/global/ChatOverlay.java
After a successful send, resets send button text and additionally fires inputField.fireClick() (programmatically triggers input field click post-send).

Sequence Diagram(s)

sequenceDiagram
    participant UI as FeatureSettingDialog (UI)
    participant FM as FeatureManager
    participant S as SettingsStore
    participant F as Feature instances

    UI->>FM: click "Re-enable" -> reEnable()
    FM->>S: read "mindustry-tool.enableds"
    S-->>FM: list of enabled feature names
    FM->>F: for each feature name -> enable()
    F-->>FM: enable ack
    FM-->>UI: update UI / completion
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Dev #134: Related UI/rebuild changes to FeatureSettingDialog; overlaps with the dialog/layout edits here.
  • Update mod.hjson #122: Related mod version bump in mod.hjson.
  • Dev #113: Related to PlayerConnectService changes (timeouts) and FeatureSettingDialog edits.

Poem

🐇 I hopped through settings, soft and spry,
Saved which features waved goodbye.
A gentle tap — I bring them back,
Time doubled so no calls go slack.
Version bumped, I twitch my whiskers—hi!

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Dev' is too vague and generic, failing to describe the actual changes in the pull request such as version bumps, feature defaults, timeout adjustments, or UI enhancements. Replace 'Dev' with a specific, descriptive title that summarizes the main changes, such as 'Bump version to v4.39.0 and add reEnable feature with UI enhancements'
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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
  • Commit unit tests in branch dev

🧹 Recent nitpick comments
src/mindustrytool/features/chat/global/ChatOverlay.java (1)

826-829: Consider using explicit focus instead of fireClick().

If the intent is to refocus the input field after sending, fireClick() is unconventional for text fields and may have unintended side effects (e.g., triggering click listeners). A more direct approach would be:

Core.scene.setKeyboardFocus(inputField);

If fireClick() is intentional for a specific reason (e.g., triggering a custom listener), please clarify with a comment.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0245d38 and bbbb731.

📒 Files selected for processing (2)
  • src/mindustrytool/features/chat/global/ChatOverlay.java
  • src/mindustrytool/features/settings/FeatureSettingDialog.java
🧰 Additional context used
🧬 Code graph analysis (1)
src/mindustrytool/features/settings/FeatureSettingDialog.java (1)
src/mindustrytool/features/FeatureManager.java (1)
  • FeatureManager (6-85)
🔇 Additional comments (4)
src/mindustrytool/features/settings/FeatureSettingDialog.java (4)

67-84: LGTM on the filter state and translation helper.

The t() method provides a clean fallback mechanism for translation keys. The exception handling is defensive and appropriate since bundle lookups can fail with missing keys in some scenarios.


112-126: LGTM on the search field integration.

The search field with live filtering via rebuildPane() follows a good reactive UI pattern.


248-254: LGTM on layout width adjustments.

Switching from minWidth() to width() ensures consistent card sizing in the grid layout across all card types.


145-147: LGTM on the filtering logic.

The case-insensitive filtering with translation lookup ensures both localized and raw names are searchable. Consistently applied across feature buttons and feature cards.

Also applies to: 158-161, 191-194

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

Add a button to re-enable previously enabled features after disabling all. This allows users to easily restore their preferred feature state without manual reconfiguration.
The send button's text was updated but the click action was not triggered, causing the chat message to not be sent. This ensures the button behaves correctly after text localization.
Copy link

@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: 1

🤖 Fix all issues with AI agents
In `@src/mindustrytool/features/settings/FeatureSettingDialog.java`:
- Around line 134-136: Fix the typo in the translation key used in the
FeatureSettingDialog button by changing "@reeanable" to "@reenable", and after
calling FeatureManager.getInstance().reEnable() ensure the dialog UI is
refreshed: call the dialog rebuild/refresh method (or re-create the dialog
contents) so the updated feature state is shown and add a short user feedback
action (e.g., a toast/label update or call to show a confirmation) so users see
the re-enable succeeded; locate this in FeatureSettingDialog where
table.button(...) is defined and in the callback that invokes
FeatureManager.getInstance().reEnable().
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a0d56b and 25a000a.

📒 Files selected for processing (3)
  • mod.hjson
  • src/mindustrytool/features/FeatureManager.java
  • src/mindustrytool/features/settings/FeatureSettingDialog.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • mod.hjson
🧰 Additional context used
🧬 Code graph analysis (1)
src/mindustrytool/features/settings/FeatureSettingDialog.java (1)
src/mindustrytool/features/FeatureManager.java (1)
  • FeatureManager (6-85)
🔇 Additional comments (2)
src/mindustrytool/features/FeatureManager.java (2)

17-26: Implementation looks correct.

The reEnable() method properly loads the saved feature names and re-enables matching features. The Seq::new supplier ensures a safe default when the setting doesn't exist.

Minor note: The settings key "mindustry-tool.enableds" uses a hyphen while other feature keys use "mindustrytool.feature.xxx.enabled" (no hyphen). Consider aligning the naming convention for consistency.

[approve_code_changes, suggest_optional_refactor]


29-31: LGTM!

The disableAll() method now correctly persists the currently enabled features before disabling them, enabling the reEnable() flow to restore the previous state.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines 134 to 136
table.button("@reeanable", () -> {
FeatureManager.getInstance().reEnable();
}).row();
Copy link

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 translation key: @reeanable@reenable

The translation key has an extra 'a'. Additionally, after re-enabling features, the dialog should rebuild to reflect the updated state and provide user feedback.

Proposed fix
-                table.button("@reeanable", () -> {
+                table.button("@reenable", () -> {
                     FeatureManager.getInstance().reEnable();
+                    rebuild();
+                    Vars.ui.showInfoFade("@features.reenabled");
                 }).row();
📝 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
table.button("@reeanable", () -> {
FeatureManager.getInstance().reEnable();
}).row();
table.button("@reenable", () -> {
FeatureManager.getInstance().reEnable();
rebuild();
Vars.ui.showInfoFade("@features.reenabled");
}).row();
🤖 Prompt for AI Agents
In `@src/mindustrytool/features/settings/FeatureSettingDialog.java` around lines
134 - 136, Fix the typo in the translation key used in the FeatureSettingDialog
button by changing "@reeanable" to "@reenable", and after calling
FeatureManager.getInstance().reEnable() ensure the dialog UI is refreshed: call
the dialog rebuild/refresh method (or re-create the dialog contents) so the
updated feature state is shown and add a short user feedback action (e.g., a
toast/label update or call to show a confirmation) so users see the re-enable
succeeded; locate this in FeatureSettingDialog where table.button(...) is
defined and in the callback that invokes
FeatureManager.getInstance().reEnable().

Copy link

@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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/mindustrytool/features/chat/global/ChatOverlay.java (1)

821-829: Remove programmatic click after send to avoid empty-content toast.

sendButton.fireClick() will re-trigger sendMessage() after clearing input, producing a "@chat.empty-content" toast on every successful send and potentially executing other click handlers. Drop the click and rely on state updates; if a refresh is needed, call invalidateHierarchy() or similar.

💡 Proposed fix
                     if (sendButton != null) {
                         sendButton.setText("@chat.send");
-                        sendButton.fireClick();
                     }
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25a000a and 0245d38.

📒 Files selected for processing (1)
  • src/mindustrytool/features/chat/global/ChatOverlay.java

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

When the send button is clicked, it should trigger the input field's click event instead of the button's own click event to ensure proper focus behavior.
Add a search field to filter features by name. Extract rebuild logic into separate method to handle filtering. Adjust layout width calculation and card width constraints for better responsiveness.
@sharrlotte sharrlotte merged commit 326f03c into main Jan 29, 2026
3 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