added recursive hoverover feature for stepper#3586
Merged
RichDom2185 merged 7 commits intomasterfrom Feb 26, 2026
Merged
Conversation
Co-authored-by: Raaghul <Raaghulk04@gmail.com>
RichDom2185
requested changes
Feb 18, 2026
package.json
Outdated
| "@sentry/react": "^10.5.0", | ||
| "@sourceacademy/c-slang": "^1.0.21", | ||
| "@sourceacademy/conductor": "https://github.com/source-academy/conductor.git#0.2.1", | ||
| "@sourceacademy/js-slang": "portal:../js-slang", |
Member
There was a problem hiding this comment.
Revert this change. The package is js-slang, not @sourceacademy/js-slang.
Member
There was a problem hiding this comment.
Revert the changes to this file.
src/styles/_workspace.scss
Outdated
Comment on lines
1493
to
1536
| // CSS for stepper popover box | ||
| .stepper-popover { | ||
| .stepper-display { | ||
| font: 16px / normal 'Inconsolata', 'Consolas', monospace; | ||
| } | ||
|
|
||
| .stepper-literal { | ||
| color: #ff6078; | ||
| } | ||
|
|
||
| .stepper-operator { | ||
| color: #f89210; | ||
| } | ||
|
|
||
| .stepper-identifier { | ||
| color: #f8d871; | ||
| } | ||
|
|
||
| .stepper-conditional-operator { | ||
| color: #ffffff; | ||
| } | ||
|
|
||
| .#{$ns}-code-block { | ||
| .stepper-literal { | ||
| color: #ff6078; | ||
| } | ||
|
|
||
| .stepper-operator { | ||
| color: #f89210; | ||
| } | ||
|
|
||
| .stepper-identifier { | ||
| color: #f8d871; | ||
| } | ||
|
|
||
| .stepper-conditional-operator { | ||
| color: #ffffff; | ||
| } | ||
|
|
||
| .stepper-mu-term { | ||
| font-weight: bold; | ||
| cursor: pointer; | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
Please use CSS modules instead of global styles
| ) { | ||
| function addHovering(preprocessed: React.ReactNode): React.ReactNode { | ||
| const functionDefinition = astToString(node); | ||
| // const functionDefinition = astToString(node); |
Comment on lines
324
to
346
|
|
||
| /** | ||
| * Recursive Hoverover feature | ||
| * muTermStyleWrapper wraps identifiers in the code body with popover | ||
| */ | ||
| const FunctionDefinitionPopoverContent = () => ( | ||
| <div className={classNames('stepper-popover', Classes.DARK)}> | ||
| <div className="stepper-display"> | ||
| <Icon icon="code" /> | ||
| <span>{' Function definition'}</span> | ||
| <pre className={Classes.CODE_BLOCK}> | ||
| <code> | ||
| {renderFunctionArguments(node.params)} | ||
| <span className="stepper-identifier">{' => '}</span> | ||
| {renderNode(node.body, { | ||
| styleWrapper: composeStyleWrapper(styleWrapper, muTermStyleWrapper)!, | ||
| popoverDepth: popoverDepth + 1 | ||
| })} | ||
| </code> | ||
| </pre> | ||
| </div> | ||
| </div> | ||
| ); |
Member
There was a problem hiding this comment.
Don't nest components as this results in highly inefficient code.
Comment on lines
39
to
46
| import { astToString } from 'js-slang/dist/utils/ast/astToString'; | ||
| // import { astToString } from 'js-slang/dist/utils/ast/astToString'; | ||
| import React, { useCallback, useEffect, useState } from 'react'; | ||
| import { useTranslation } from 'react-i18next'; | ||
| import { useDispatch } from 'react-redux'; | ||
|
|
||
| import { beginAlertSideContent } from '../SideContentActions'; | ||
| import { SideContentLocation, SideContentType } from '../SideContentTypes'; | ||
| // import { cons } from 'js-slang/dist/alt-langs/scheme/scm-slang/src/stdlib/base'; |
Member
There was a problem hiding this comment.
Please remove commented code if unused.
017d8d6 to
639ca6d
Compare
Pull Request Test Coverage Report for Build 22253403945Details
💛 - Coveralls |
319bc58 to
639ca6d
Compare
Comment on lines
523
to
530
| return ( | ||
| <span> | ||
| <span className="stepper-operator">{'return '}</span> | ||
| {node.argument && renderNode(node.argument, { styleWrapper: styleWrapper })} | ||
| {node.argument && | ||
| renderNode(node.argument, { styleWrapper: styleWrapper, popoverDepth: popoverDepth })} | ||
| {';'} | ||
| </span> | ||
| ); |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
1a9242d to
5362c9e
Compare
RichDom2185
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Created by :
Raaghul Raaghulk04@gmail.com
Kin Chong wongkinchong75@gmail.com
Recursive Popover and CSS Improvements
Summary
This PR introduces recursive popover support and refines multiple CSS styles to improve clarity, consistency, and overall UI readability. Changes include recursive popover rendering, improved marker styling, cleaner hover behaviour, full function-body highlighting, and refined popover box design.
What’s Changed
Before vs After — Visual Changes
Recursive Popover
Before

After

Improvement
Conditional Marker Styling Fix
Before

After

Improvement
?) markersHoverable Elements — Styling Update
Before — Orange Background

After — Bold Text

Improvement
“Before” Marker Color Change
Before — Orange Marker

After — Red Marker

Improvement
Function Declaration Highlighting
Before — Partial Highlight

After — Full Body Highlight

Improvement
Popover Box CSS Improvements
Before

After

Improvement
Type of Change
Checklist