← Back to Pull requests

interactive playground #171

Closed
unknown closed this pull request without merging on Aug 06, 2025 16:54 UTC
View on GitHub
unknown unknown commented on Aug 03, 2025 08:32 UTC
Author

#170

Closes #XX
<!-- Replace XX with the actual issue number if available -->

Description

This PR adds a fully functional Interactive Code Playground to the LearnHub platform.
The playground allows users to write, test, and preview HTML, CSS, and JavaScript code live in the browser.
Key features include real-time live preview, Monaco editor integration, localStorage-based save/load, download/export functionality, and clipboard sharing.
The playground is fully responsive, supports dark mode, and ensures secure code execution via sandboxed iframes.

Main Highlights:

-Main Component: src/components/CodePlayground/index.tsx
-Styling: src/components/CodePlayground/CodePlayground.css

  • Template System: src/components/CodePlayground/Template.tsx

  • Documentation:

  • - /docs/code-playground-demo.md
    - /docs/web-development/playground.md
    - Integrated into main landing page /docs/index.md

    Dependencies Added:


  • @monaco-editor/react – For syntax highlighting and code editor integration
  • Type of PR

  • Feature enhancement

  • Bug fix

  • Documentation update

  • Other (specify): _______________
  • Screenshots / videos (if applicable)


    before
    <img width="1917" height="885" alt="image" src="https://github.com/user-attachments/assets/3f5f667a-785e-4f77-8048-f25a393f9bc5" />
    after
    <img width="1915" height="887" alt="image" src="https://github.com/user-attachments/assets/6e5b2ec7-bb60-4c28-ad89-d3fdfcd959f7" />

    playground feature

    <img width="1157" height="685" alt="image" src="https://github.com/user-attachments/assets/7a5269dd-9da5-4c66-99a6-ede1856b8ea1" />

    video of added feature

    https://github.com/user-attachments/assets/87ab0374-f644-4fc3-9ba6-79c67a89beef

    Checklist:

  • I have made this change from my own.

  • I have mentioned the issue number in my Pull Request.

  • I have gone through the CONTRIBUTING.md file before contributing.

  • I have performed a self-review of my own code.

  • I have commented my code, particularly in hard-to-understand areas.

  • I have made corresponding changes to the documentation.

  • My changes generate no new warnings.

  • I have tested the changes thoroughly before submitting this pull request.

  • I have provided relevant issue numbers and screenshots after making the changes.
  • Diff: 300 lines (+225 / -75) across 3 files Reviewer: ROKUMATE Review duration: 4822m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 300 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.341
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #171"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.1% (MEDIUM) · Higher = larger blast radius
    40.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.8% · Safe to merge
    15.8%