Skip to content

Add a Python/ML code playground and an AI-coding resources hub - #58

Merged
samanyugoyal2010 merged 9 commits into
codewpurpose:mainfrom
srivibhavpadakandla:python-ml-playground
Oct 11, 2026
Merged

samanyugoyal2010 merged 9 commits into
codewpurpose:mainfrom
srivibhavpadakandla:python-ml-playground

Conversation

@srivibhavpadakandla

@srivibhavpadakandla srivibhavpadakandla commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Split out of #57 (as requested) and branched off main, so it can be reviewed and merged on its own.

What's in it

Code playground — /playground

  • Real Python in the browser with Pyodide 0.27.7, running in a Web Worker and loaded lazily (nothing is fetched until the first Run)
  • NumPy, pandas, scikit-learn and matplotlib load on import; figures render as images
  • Stop button plus a 30s limit for runaway code, friendly tracebacks with a hint and the line number, eight starters (including an iris classifier and a plot)
  • Share puts the code in the URL hash only; nothing is sent anywhere
  • input() takes answers up front (true pausing needs cross-origin isolation headers)

Run buttons in lessons

  • Python code blocks (.py or "Python" labels) get a Run button that opens an editable inline runner under the block
  • REPL (>>>), terminal and traceback blocks are excluded; the ML scaling.py excerpt is opted out because it can't run on its own

AI-coding resources — /resources/ai-coding

  • Tool picks with official links (no prices), 8 copyable prompts that teach rather than answer, a healthy AI workflow, safety tips, and a glossary

Also

  • Both pages added to the header's More menu, the footer's Learn column and the sitemap, each with its own share image
  • About: Vibhav's bio reflects his role

Relationship to #57

Split out of #57 and now updated on top of it (#57 is merged). The one expected overlap, CodeBlock.tsx, is resolved: it's the redesigned block plus the Run button. The playground and resources pages use the redesign's motion components again, and the temporary tools.css is gone since main has those styles.

Checks

npm run lint, typecheck, learn:check and next build pass. Verified in the browser: starters including NumPy run, Run buttons appear on Python lesson blocks, and the resources page's copy buttons are styled.

🤖 Generated with Claude Code

srivibhavpadakandla and others added 2 commits October 10, 2026 15:51
Split out of codewpurpose#57 so the redesign can be reviewed on its own. Built on main:
- /playground: run real Python in the browser with Pyodide 0.27.7 in a Web
  Worker (lazy, nothing fetched until Run). NumPy, pandas, scikit-learn and
  matplotlib load on import; figures render as PNGs. Stop and a 30s limit
  restart runaway code; friendly tracebacks; eight starters; Share encodes
  the code in the URL hash only. input() takes answers up front.
- Lessons: Python code blocks (.py or "Python" labels) get a Run button with
  an inline runner; REPL/traceback blocks and the ML scaling excerpt are
  excluded.
- /resources/ai-coding: tool picks with official links (no prices),
  copyable prompts that teach rather than answer, a healthy AI workflow,
  safety tips and a glossary.
- Both pages in the header's More menu, the footer's Learn column, the
  sitemap, and with their own share images.
- About: Vibhav's bio reflects his role.

Independent of codewpurpose#57: plain elements stand in for the redesign's motion
components, and src/lib/og-image.tsx, src/lib/stats.ts and the copy-button
styles are byte-identical to codewpurpose#57's, so either PR can land first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moves them into src/components/playground/tools.css, imported by the
components that use them, so this PR and codewpurpose#57 don't both append to the end
of globals.css and conflict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 10, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Shreyan Mitra's projects Team on Vercel.

A member of the Team first needs to authorize it.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 31 files

Confidence score: 3/5

  • If worker creation throws in python-runtime.ts, run() leaves the runner active and never calls onEnd, so it can stay locked permanently. Catch the startup failure and finish the run as unavailable.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/components/playground/python-runtime.ts">

<violation number="1" location="src/components/playground/python-runtime.ts:68">
P2: If worker creation throws, `run()` leaves `active` set and never calls `onEnd`, so the runner stays permanently locked. Catch startup failures and finish the run as unavailable.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread src/app/playground/page.tsx Resolved
Comment thread src/app/resources/ai-coding/page.tsx Resolved
Comment thread src/components/playground/examples.ts Resolved
Comment thread src/components/playground/examples.ts Resolved
Comment thread src/lib/stats.ts Resolved
@samanyugoyal2010

Copy link
Copy Markdown
Contributor

@srivibhavpadakandla Could you fix the merge conflicts?

srivibhavpadakandla and others added 7 commits October 10, 2026 16:21
codewpurpose#57 landed, so this branch now builds on the redesign:
- CodeBlock: the redesigned block plus the Run button (the expected
  overlap, resolved).
- The playground and resources pages get their React Bits motion back
  (BlurText, SpotlightCard, GlareHover, Magnet, Koda's TypeLine).
- tools.css is removed; main's globals.css already has those styles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
@samanyugoyal2010
samanyugoyal2010 merged commit de748d8 into codewpurpose:main Oct 11, 2026
2 of 3 checks passed
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.

2 participants