feat: add live speed control and sorting step explanations#865
Open
TrendMYX wants to merge 1 commit into
Open
Conversation
|
@TrendMYX is attempting to deploy a commit to the alienx99 Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
π Pull Request
β Repository Support
Have you starred the repository?
π Description
What does this PR do?
This PR improves the sorting visualizer learning experience by adding live
animation speed updates and a detailed step explanation panel.
Users can now adjust animation speed while a sorting algorithm is already
running, without stopping or restarting the visualization. The PR also adds a
learning panel that explains the active algorithm, current highlighted values,
decision rule, highlight meaning, algorithm walkthrough, and next step in a
compact L-shaped layout around the visualization.
Related Issue(s):
Relates to sorting visualizer learning experience and animation controls
π Type of Change
Please delete options that are not relevant:
π οΈ Changes Made
Core Changes
Detailed Changes
delayRefsupport so sortingdelays can read the latest speed value during an active visualization run.
the sorting controller, runner, shared sorting controls, and all visualized
sorting algorithms.
buttons enabled during sorting so users can change animation delay in real
time.
that describes the active algorithm, highlighted values, decision rule,
highlight meaning, algorithm walkthrough, and next step.
visualization using a compact L-shaped layout, with the current step on the
side and detailed learning sections below.
explanation behavior.
Files Modified
SortVision/src/algorithms/types.ts- AddedSortDelayRefand updatedsorting algorithm types to support live delay references.
SortVision/src/algorithms/sleep.ts- UpdateddelayStepto read thelatest delay from
delayRef.currentwhile waiting.SortVision/src/algorithms/bubbleSort.ts- Passed live delay referencesinto visualization delays.
SortVision/src/algorithms/bucketSort.ts- Passed live delay referencesinto visualization delays.
SortVision/src/algorithms/heapSort.ts- Passed live delay references intovisualization delays.
SortVision/src/algorithms/insertionSort.ts- Passed live delay referencesinto visualization delays.
SortVision/src/algorithms/mergeSort.ts- Passed live delay references intovisualization delays.
SortVision/src/algorithms/quickSort.ts- Passed live delay references intovisualization delays.
SortVision/src/algorithms/radixSort.ts- Passed live delay references intovisualization delays.
SortVision/src/algorithms/selectionSort.ts- Passed live delay referencesinto visualization delays.
SortVision/src/algorithms/sleep.test.ts- Added coverage for updated delaybehavior.
SortVision/src/components/panels/config/SpeedControl.tsx- Allowed speedcontrols to remain usable during active sorting.
SortVision/src/components/panels/ConfigPanel/ConfigPanel.tsx- Added thestep explanation panel to the sorting visualizer layout.
SortVision/src/components/sortingVisualizer/SortingControls.tsx- Passedthe live speed reference into algorithm runners.
SortVision/src/components/sortingVisualizer/hooks/useSortingController.tsspeedRefwith the latest selected speed.SortVision/src/components/sortingVisualizer/hooks/useSortingRunner.ts-Passed
speedRefthrough start and test-all sorting flows.SortVision/src/components/sortingVisualizer/stepExplanation.ts- Addedexplanation generation logic for supported sorting algorithms.
SortVision/src/components/sortingVisualizer/components/ StepExplanationPanel.tsx- Added the learning UI panel for current step andalgorithm guidance.
SortVision/src/components/sortingVisualizer/stepExplanation.test.ts-Added tests for step explanation output.
π― Sorting Algorithms (if applicable)
Algorithm(s) affected:
Algorithm improvements:
π§ͺ Testing
Manual Testing
Test Cases
Testing Checklist
β‘ Performance Impact
π Dependencies
New Dependencies Added
dependency-name@versiondependency-name@versionBreaking Changes
β Checklist
Code Quality
Git Hygiene
Project Specific