Skip to content

Conversation

Phoenix616
Copy link

@Phoenix616 Phoenix616 commented Jul 17, 2025

This fixes that disabling the effects and game indicators overlays wasn't working via the config gui or disabledUiParts query parameters as the passed boolean parameters were never used in the IndicatorEffectsProvider.tsx

Summary by CodeRabbit

  • Refactor
    • Improved conditional rendering of indicators and effects based on input props.
    • Removed dependency on internal options state for determining UI display.

Copy link

coderabbitai bot commented Jul 17, 2025

Walkthrough

The component in IndicatorEffectsProvider.tsx was updated to remove the import and subscription to options. The displayIndicators and displayEffects props are now explicitly passed in the JSX instead of relying on shorthand boolean props. No changes were made to public APIs or component state logic.

Changes

File(s) Change Summary
src/react/IndicatorEffectsProvider.tsx Removed import and subscription to options; replaced shorthand boolean props with explicit displayIndicators and displayEffects props in JSX.

Suggested labels

Review effort 1/5

Poem

In the garden of code where the carrots grow tall,
A rabbit hopped in, making changes quite small.
No more options to fetch, no more state to defend—
Just props at the ready, the logic to mend.
With a twitch of the nose, and a hop to the end! 🥕


📜 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 56ddf54 and d14b239.

📒 Files selected for processing (1)
  • src/react/IndicatorEffectsProvider.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/react/IndicatorEffectsProvider.tsx
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

🧹 Nitpick comments (1)
src/react/IndicatorEffectsProvider.tsx (1)

123-124: Consider removing redundant prop passing.

Since the conditional logic is now handled in the parent component (lines 121-122), passing displayIndicators and displayEffects as props to the child component might be redundant. The child component should no longer need these boolean flags since the data is already filtered based on their values.

Consider removing these props if they're no longer used in the IndicatorEffects component:

  return <IndicatorEffects
    indicators={displayIndicators ? allIndicators : defaultIndicatorsState}
    effects={displayEffects ? effects : []}
-    displayIndicators
-    displayEffects
  />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9c7840 and 56ddf54.

📒 Files selected for processing (1)
  • src/react/IndicatorEffectsProvider.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, files under renderer/ directory must not access the global `bot` variable directly according to .cursor/rules/vars-usage.mdc. The updateNameTagVisibility method in renderer/viewer/three/entities.ts currently violates this rule by accessing bot.teamMap and bot.username. Team information should be passed through entity update events from the world data emitter instead.
Learnt from: zardoy
PR: zardoy/minecraft-web-client#373
File: renderer/viewer/three/entities.ts:1120-1120
Timestamp: 2025-06-23T13:33:14.776Z
Learning: In the minecraft-web-client project, team information for entities should be inlined into entity update events from the world data emitter rather than accessing the global bot object from renderer code. This maintains better separation of concerns between the data layer and renderer.
src/react/IndicatorEffectsProvider.tsx (3)
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-07-02T02:50:46.443Z
Learning: Applies to renderer/**/*.ts : In renderer code (such as in `WorldRendererThree`), use the `playerState` property (e.g., `worldRenderer.playerState.gameMode`) to access player state. The implementation for `playerState` lives in `src/mineflayer/playerState.ts`.
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-07-02T02:50:46.443Z
Learning: Some other global variables that can be used without window prefixes are listed in src/globals.d.ts.
Learnt from: CR
PR: zardoy/minecraft-web-client#0
File: .cursor/rules/vars-usage.mdc:0-0
Timestamp: 2025-07-02T02:50:46.443Z
Learning: Applies to renderer/**/*.ts : In renderer code, all bot/player state and events must be accessed via explicit interfaces, state managers, or passed-in objects, never by referencing `bot` directly.
🧬 Code Graph Analysis (1)
src/react/IndicatorEffectsProvider.tsx (1)
src/react/IndicatorEffects.tsx (1)
  • defaultIndicatorsState (63-71)
🔇 Additional comments (1)
src/react/IndicatorEffectsProvider.tsx (1)

121-122: LGTM! The conditional logic correctly implements the toggle functionality.

The changes properly address the issue where overlay toggles weren't working. The conditional logic ensures that when displayIndicators is false, the component receives defaultIndicatorsState (effectively hiding indicators), and when displayEffects is false, it receives an empty array (hiding effects).

@Phoenix616
Copy link
Author

Actionable comments posted: 0

🧹 Nitpick comments (1)
📜 Review details

Hm, I didn't even notice this. It's weird that this doesn't work. Looking into that.

@Phoenix616
Copy link
Author

Phoenix616 commented Jul 17, 2025

Apparently it's required to explicitly set the values there which is why it didn't work originally. (They were always treated as true instead of the values of the passed parameters)

@zardoy
Copy link
Owner

zardoy commented Jul 18, 2025

yeah, another silly refactor. TYSM

@zardoy zardoy merged commit a8635e9 into zardoy:next Jul 18, 2025
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