Repository navigation
feat: Add createKeplerTheme - #712
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Kepler package gains two new configuration options: ChangesTheme Customization and Modal Portal Targeting
Sequence Diagram(s)sequenceDiagram
participant App
participant createKeplerSlice
participant KeplerProvider
participant KeplerMapContainer
participant StyledThemeProvider as ThemeProvider
App->>createKeplerSlice: {keplerTheme, modalPortalTarget}
createKeplerSlice->>createKeplerSlice: store keplerTheme and modalPortalTarget in initial state
App->>KeplerProvider: render
KeplerProvider->>createKeplerSlice: select state.kepler.keplerTheme
KeplerProvider->>KeplerProvider: resolvedTheme = keplerTheme ?? darkTheme
KeplerProvider->>StyledThemeProvider: resolvedTheme
App->>KeplerMapContainer: render
KeplerMapContainer->>createKeplerSlice: select state.kepler.modalPortalTarget
KeplerMapContainer->>KeplerMapContainer: modalPortalNode = 'body' ? document.body : containerNode
KeplerMapContainer->>KeplerMapContainer: modalContainerFields(modalPortalNode)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2fafb15b8d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b3940a5aa
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/kepler/src/components/KeplerMapContainer.tsx`:
- Around line 158-163: The assignment of modalPortalNode dereferences
document.body without checking if the document global exists, which causes
failures in SSR and test environments. Guard the document.body access by
checking if typeof document is defined and not undefined before attempting to
access it; if document is unavailable, fall back to using containerNode
regardless of the modalPortalTarget value.
In `@packages/kepler/src/index.ts`:
- Line 81: The export statement at line 81 in packages/kepler/src/index.ts is
exposing darkTheme, which is a SQLRooms-specific preset theme, as a stable
top-level API export. This reduces the composability of the kepler package for
other consumers. Remove darkTheme from the export statement and keep only
createKeplerTheme exported. If related theme types or utilities need to be
exported, export only the generic, composable ones that are not app-specific.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ca940080-6d7f-49e1-99b3-eeba0dc34c94
📒 Files selected for processing (5)
packages/kepler/src/KeplerSlice.tspackages/kepler/src/components/KeplerMapContainer.tsxpackages/kepler/src/components/KeplerProvider.tsxpackages/kepler/src/index.tspackages/kepler/src/styles/theme.ts
Summary by CodeRabbit
createKeplerTheme()withKeplerThemeOverrides, and exposeddarkThemefor consistent theming.modalPortalTarget(supports rendering modals in the container or atdocument.body).KeplerModalPortalTarget,KeplerThemeOverrides,KeplerGLBasicProps, plus theme utilities for easier configuration.darkTheme).createKeplerSlice()customization example and notes to reflect the new options.