Fix visualizer layout issues and refactor App.jsx architecture#36
Draft
Fix visualizer layout issues and refactor App.jsx architecture#36
Conversation
Co-authored-by: Prajwal-k-tech <69136413+Prajwal-k-tech@users.noreply.github.com>
Co-authored-by: Prajwal-k-tech <69136413+Prajwal-k-tech@users.noreply.github.com>
Co-authored-by: Prajwal-k-tech <69136413+Prajwal-k-tech@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Find and fix bugs, (Some bugs I've noticed are the components in search visualizers are only taking half the width)
Optimize the css, there's a lot of use of common.css but I believe the workflow should have the visualizers components in jsx then the c...
Fix visualizer layout issues and refactor App.jsx architecture
Aug 18, 2025
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.
This PR addresses several critical issues with the DSA Website's architecture and user interface:
Issues Fixed
1. Visualizer Width Problem
The search, graph, and greedy algorithm visualizers were constrained to only 50% of the available width due to a
grid-template-columns: 1fr 1frlayout. This cramped the visualization space and made it difficult to see complex algorithms clearly.Before: Visualization area took 50% width
After: Visualization area takes 66% width (2fr vs 1fr for code panel)
2. App.jsx Architectural Problems
The main App component had grown to 650+ lines and contained embedded business logic for linked list pages, violating separation of concerns principles.
Before:
After:
3. CSS Import Chaos
App.jsx was importing 23 CSS files globally, creating potential style conflicts and violating component encapsulation.
Before: 23 global CSS imports in App.jsx
After: 2 essential global imports, with components managing their own styles
Changes Made
File Structure Improvements
Created a new
src/features/linkedList/pages/directory with extracted page components:DoublyLinkedListPage.jsxSinglyLinkedListPage.jsxCircularLinkedListPage.jsxindex.js(export aggregator)Layout Fixes
Updated grid layouts in visualizer templates:
SearchVisualizerTemplate.cssGraphVisualizerTemplate.cssGreedyVisualizerTemplate.cssChanged from
grid-template-columns: 1fr 1frtogrid-template-columns: 2fr 1frto give visualizations more space.CSS Architecture
Removed 21 CSS imports from App.jsx, leveraging the fact that components already import their own styles. This follows React best practices and eliminates potential style conflicts.
Impact
All changes are backward compatible and preserve existing functionality while significantly improving code organization and user experience.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.