Skip to content

fix: add tooltip and clearer terminal text for non-JS languages in Practice Sandbox#492

Open
Xenon010101 wants to merge 1 commit into
algoscope-hq:mainfrom
Xenon010101:fix/bug-477-sandbox-nonjs-execution
Open

fix: add tooltip and clearer terminal text for non-JS languages in Practice Sandbox#492
Xenon010101 wants to merge 1 commit into
algoscope-hq:mainfrom
Xenon010101:fix/bug-477-sandbox-nonjs-execution

Conversation

@Xenon010101
Copy link
Copy Markdown
Contributor

@Xenon010101 Xenon010101 commented May 30, 2026

Description

The CodeEditor component already disabled the Run Code button for non-JavaScript languages (showing 'Coming Soon' text). However, it was missing a tooltip explaining why the button is disabled, and the terminal placeholder text assumed JavaScript only.

Changes

  • Added a itle attribute to the Run Code button when a non-JS language is selected, explaining that execution is currently only supported for JavaScript
  • Updated the terminal placeholder text in PracticePage to clarify that Python, Java, and C++ execution is coming soon

Related Issue

Fixes #477

Summary by CodeRabbit

  • New Features
    • Run button now displays a tooltip indicating execution limitations when using non-JavaScript languages.
    • Terminal console empty state now provides clearer guidance to select JavaScript and run code, with a note about upcoming Python, Java, and C++ support.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 30, 2026

Deploy Preview for astounding-nougat-da0f6a ready!

Name Link
🔨 Latest commit b6489ee
🔍 Latest deploy log https://app.netlify.com/projects/astounding-nougat-da0f6a/deploys/6a1a961a5882dc00089af8d3
😎 Deploy Preview https://deploy-preview-492--astounding-nougat-da0f6a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

@Xenon010101 is attempting to deploy a commit to the adityapaul2603-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 30, 2026

📝 Walkthrough

Walkthrough

This PR addresses the issue where non-JavaScript languages (Python, Java, C++) were throwing syntax errors when users attempted execution. Both the Run button and Terminal now provide clear UI feedback that JavaScript-only execution is currently supported, with other languages noted as coming soon.

Changes

JavaScript-only Execution Feedback

Layer / File(s) Summary
JavaScript-only execution feedback
src/components/CodeEditor.jsx, src/components/PracticePage.jsx
Run button conditionally shows a "JavaScript-only" tooltip when non-JavaScript languages are selected, and Terminal's empty-state message now instructs users to select JavaScript and notes that Python/Java/C++ execution is coming soon.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding a tooltip to the Run button and clarifying terminal text for non-JavaScript languages.
Description check ✅ Passed The description adequately explains what changed and why, though it lacks complete sections like Release Notes, Testing/Verification, and UI Evidence as specified in the template.
Linked Issues check ✅ Passed The PR implements Solution B from issue #477 by adding a tooltip explaining execution limitations and updating terminal placeholder text to inform users about language support status.
Out of Scope Changes check ✅ Passed All changes align directly with issue #477: tooltip and placeholder text updates provide graceful UI feedback for non-JS languages without introducing unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Algorithm Complexity ✅ Passed PR contains only UI/UX changes (tooltip and terminal messages for non-JS languages); no algorithm implementations exist to verify complexity against.
Conventional Commits ✅ Passed PR title and commit message follow conventional commits standard: "fix: add tooltip and clearer terminal text for non-JS languages in Practice Sandbox" uses valid "fix" type with clear description.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/CodeEditor.jsx (1)

158-158: 💤 Low value

Optional: Consider an accessible tooltip for better UX.

The native title attribute works but isn't keyboard-accessible and has poor screen reader support. For a more accessible experience, you could add an aria-label or use a proper tooltip component (e.g., Radix UI, Headless UI).

Why this matters: Users navigating via keyboard won't see the explanation, and screen reader users may miss it entirely. Since you're teaching DSA concepts, accessibility helps all learners engage with your tool.

That said, the current implementation is functional for most users, so this is purely a nice-to-have improvement.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/CodeEditor.jsx` at line 158, The title attribute on the
element in CodeEditor.jsx (title={!isJavaScript ? 'Code execution is currently
only supported for JavaScript' : ''}) is not sufficiently accessible; replace or
augment it by adding an accessible alternative such as an aria-label or
aria-describedby when isJavaScript is false, or hook up a proper tooltip
component (e.g., Radix/Headless tooltip) and expose its content via aria
attributes so keyboard and screen-reader users can access the same message;
update the element where title is set and ensure the logic still uses the
isJavaScript condition to show/hide the message.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/components/CodeEditor.jsx`:
- Line 158: The title attribute on the element in CodeEditor.jsx
(title={!isJavaScript ? 'Code execution is currently only supported for
JavaScript' : ''}) is not sufficiently accessible; replace or augment it by
adding an accessible alternative such as an aria-label or aria-describedby when
isJavaScript is false, or hook up a proper tooltip component (e.g.,
Radix/Headless tooltip) and expose its content via aria attributes so keyboard
and screen-reader users can access the same message; update the element where
title is set and ensure the logic still uses the isJavaScript condition to
show/hide the message.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: a89ea06c-2c45-4166-bd33-bd634c7c9d2d

📥 Commits

Reviewing files that changed from the base of the PR and between 9f6f2f6 and b6489ee.

📒 Files selected for processing (2)
  • src/components/CodeEditor.jsx
  • src/components/PracticePage.jsx

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.

Sandbox Execution of Python, Java, and C++ Throws JS Syntax Errors

1 participant