Fix: theme correction in iframe and remove tabs bar dropdown#1102
Fix: theme correction in iframe and remove tabs bar dropdown#1102ShinichiShi wants to merge 1 commit into
Conversation
✅ Deploy Preview for circuitverse ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughThe PR addresses two bugs from issue Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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.
🧹 Nitpick comments (1)
src/pages/embed.vue (1)
196-198: 💤 Low valueConsider narrowing the type for array query params.
route.query[key]can bestring | string[] | undefined, but the function casts directly tostring. If a query param appears multiple times (e.g.,?theme=a&theme=b), the value would be an array at runtime, causing string comparisons to silently fail.For embed URLs this is unlikely since they're programmatically constructed, but a defensive fix would handle it:
Suggested improvement
function queryParam(key: string): string | null { - return (route.query[key] as string) || urlParams.get(key) || null + const val = route.query[key] + const routeVal = Array.isArray(val) ? val[0] : val + return routeVal || urlParams.get(key) || null }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3f573a78-6aea-4c08-ace9-0ca90828043f
📒 Files selected for processing (2)
src/components/TabsBar/TabsBar.vuesrc/pages/embed.vue

Fixes #1101
Describe the changes you have made in this PR -
This PR fixes both the issue and also adds some improvements to the URL parsing
Screenshots of the UI changes (If any) -
Code Understanding and AI Usage
Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?
If you used AI assistance:
Explain your implementation approach:
Embed URL query params
(?theme=, ?clock_time=, etc.)were read fromroute.querywhich is empty at mount time when Embed is rendered via v-if (not ). Fixed with URLSearchParams fallback.Theme not applying: updateThemeForStyle(undefined) returned early silently as it used to be undefined. Added null guard.
Tabs bar chevron toggle (collapse/expand) was visible in embed, which is now conditional, only seen when it is not embed view
Checklist before requesting a review
Note: Please check Allow edits from maintainers if you would like us to assist in the PR.
Summary by CodeRabbit
Refactor
Style