Skip to content

feat: except for the TinyRobot page, other pages have hidden playground buttons#94

Open
wuyiping0628 wants to merge 2 commits intodevfrom
wyp/playground-0311
Open

feat: except for the TinyRobot page, other pages have hidden playground buttons#94
wuyiping0628 wants to merge 2 commits intodevfrom
wyp/playground-0311

Conversation

@wuyiping0628
Copy link
Collaborator

@wuyiping0628 wuyiping0628 commented Mar 12, 2026

Summary by CodeRabbit

  • Style

    • Code playground play icon visibility is now controlled by page: hidden by default and shown only on the designated route (tiny-robot).
  • Bug Fixes

    • Improved behavior when navigating pages to ensure image zoom instances are cleaned up and re-initialized correctly.

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 21ea7acc-8cce-4156-9e59-c67b2c588da5

📥 Commits

Reviewing files that changed from the base of the PR and between e862212 and ab6f11d.

📒 Files selected for processing (1)
  • .vitepress/theme/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • .vitepress/theme/index.ts

Walkthrough

Renames and types the internal medium-zoom instance, adds route-aware logic that toggles the hide-code-playground class on the document body based on whether the route path includes tiny-robot, and adds CSS to hide the playground play icon when that class is present.

Changes

Cohort / File(s) Summary
Theme behavior & zoom typing
.vitepress/theme/index.ts
Imported Zoom type from medium-zoom; renamed zommzoom with type `Zoom
Playground icon styling
.vitepress/theme/style.css
Added rule to hide the code playground play icon when body.hide-code-playground is present: .lucide.lucide-play-icon.lucide-play { display: none !important; }.

Sequence Diagram(s)

sequenceDiagram
    participant Router
    participant ThemeInit as Theme Init
    participant MediumZoom as medium-zoom
    participant DOM as document.body

    Router->>ThemeInit: route change / initial run
    ThemeInit->>MediumZoom: if existing -> cleanup zoom instance
    ThemeInit->>MediumZoom: create new zoom instance (assign to `zoom`)
    ThemeInit->>DOM: if path includes "tiny-robot" -> remove `hide-code-playground`
    ThemeInit->>DOM: else -> add `hide-code-playground`
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A rabbit nudges zoom awake,
It watches routes for robots' sake,
If tiny-robot hops in view,
The play icon peeks out anew—
CSS hides, then shows—hip, hop, hooray! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: hiding playground buttons on all pages except TinyRobot, which matches the implementation of adding the hide-code-playground class conditionally.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wyp/playground-0311

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

Comment @coderabbitai help to get the list of available commands and usage tips.

gimmyhehe
gimmyhehe previously approved these changes Mar 12, 2026
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.

3 participants