fix: Improve global window augmentation for tooltips with proper types - #148
Conversation
🦋 Changeset detectedLatest commit: 51daf4e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughRestructures the Window augmentation by moving it to top-level, removes runtime initialization scaffolding in the tooltip component while keeping the global assignment, and adds a VSCode TypeScript formatter override plus a changeset bump. No API surface changes declared. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
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 |
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ode settings for TypeScript formatter
Test ResultsDetails
Suites284 passed, 0 failed, and 0 other
Github Test Reporter by CTRF 💚 🔄 This comment has been updated |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI Agents
In @.changeset/few-eyes-provide.md:
- Line 5: Update the changelog sentence to hyphenate the compound adjective:
replace "user facing changes" with "user-facing changes" in the
.changeset/few-eyes-provide.md entry so the phrase reads "no user-facing
changes, just better types!" to fix hyphenation.
🧹 Nitpick comments (1)
packages/studiocms_ui/src/events.d.ts (1)
1-1: Consider narrowing the scope of the lint suppression.The
biome-ignore-alldirective disables the unused variable check for the entire file. While this is appropriate for ambient declarations and global augmentations, consider using more targeted suppressions if only specific declarations need this treatment. However, given that this file primarily contains global type augmentations, the file-level suppression is reasonable.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.changeset/few-eyes-provide.md.vscode/settings.jsonpackages/studiocms_ui/src/components/Tooltip/tooltip.tspackages/studiocms_ui/src/events.d.ts
💤 Files with no reviewable changes (1)
- packages/studiocms_ui/src/components/Tooltip/tooltip.ts
🧰 Additional context used
🪛 LanguageTool
.changeset/few-eyes-provide.md
[grammar] ~5-~5: Use a hyphen to join words.
Context: ...indow augmentation for tooltips (no user facing changes, just better types!)
(QB_NEW_EN_HYPHEN)
🔇 Additional comments (2)
.vscode/settings.json (1)
49-50: LGTM!The TypeScript-specific formatter override is configured correctly and aligns with the project's use of Biome for formatting.
packages/studiocms_ui/src/events.d.ts (1)
44-54: No action needed—runtime initialization is properly in place.The tooltip component correctly initializes
window.suiandwindow.sui.tooltipsat module scope (lines 396–398), before theloadTooltips()function references them. The initialization uses a safe pattern (window.sui ?? {}) and establishes theinstancesMap, which is then populated whenloadTooltips()executes via theastro:page-loadevent listener. There is no missing initialization scaffolding.Likely an incorrect or invalid review comment.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This pull request makes a small but important fix to the global window augmentation for tooltips in the
@studiocms/uipackage. The change improves TypeScript type safety for globalwindow.suiandwindow.sui.tooltipsusage, but does not affect user-facing behavior.TypeScript type improvements:
@ts-expect-errorcomments and clarified global augmentation forwindow.suiandwindow.sui.tooltipsinpackages/studiocms_ui/src/components/Tooltip/tooltip.ts, resulting in better type safety and maintainability. [1] [2].changeset/few-eyes-provide.mdfile, indicating a patch release for@studiocms/ui.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.