-
Notifications
You must be signed in to change notification settings - Fork 131
NEW Add support for React UI modding! #457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughIntroduces an injectable UI system via Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~35 minutes Areas requiring extra attention:
Possibly related PRs
Suggested labels
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (32)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| }, []) | ||
| useEffect(() => { | ||
| // watchedModalsFromHooks.add(modal) | ||
| watchedModalsFromHooks.value.push(modal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Duplicate modal push causes entries to appear twice
The useIsModalActive hook now pushes the modal value twice to watchedModalsFromHooks.value — once in the useMemo callback (line 23) and again in the newly uncommented useEffect callback (line 26). The old code had the useEffect push commented out. While the cleanup filter removes all matching entries on unmount, during the component's mounted lifetime each modal appears twice in the array. This could cause issues if any code iterates over or counts the watched modals.
Note
Adds an extendable React UI modding system (with injectable components and wrapper registration) and updates the app to load/await mods; also moves connection state into global UI state and makes minor renderer/UI tweaks.
react/extendableSystemwithwithInjectableUiHOC,InjectUiPlace, error-boundary wrapping, andwindow.builtinComponentsexposure.window.mcraft.uiAPI toregisteredReactWrappers: Record<place, Record<id, FC>>andregisterReactWrapper(place, id, component).hadReactUiRegisteredand activation viahadModsActivated; load parent-frame mods; expose React/Valtio to mods.withInjectableUiand refactor to*Base+ default export across many files (e.g.,MainMenu*,AppStatus*,Chat*,CreateWorld,ServersList,Singleplayer,Button,Input,Select,Slider,Scoreboard,ArmorBar,BossBarOverlay,DebugOverlay,DiveTransition,Title,Screenwith newScreenDirtBg).reactUi: wrap rootAppand re-render keyed byhadReactUiRegistered.MainMenuRenderApp: hide until FS ready and mods activated.utilsApp: trackwatchedModalsFromHooksglobally.miscUiState.hadConnectedand use it instead of local state inindex.tsfor disconnect cleanup and login tracking.worldrendererThree: storesectionKeyon created section objects for easier lookup.DiveTransitionanimation handling tweak; minor className additions inSlider;Singleplayeruses injectableScreenDirtBg.Written by Cursor Bugbot for commit 69f0a98. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
New Features
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.