Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
2d8cda6
feat: Add side navigation component and toggle
cursoragent Nov 6, 2025
7ac0503
Refactor: Move SideNavButton definition
cursoragent Nov 6, 2025
cbf3f4c
Refactor SideNavigation to use OutlineButton and window.open
cursoragent Nov 6, 2025
af1e767
Feat: Speed up side navigation transitions
cursoragent Nov 6, 2025
839f6ec
Feat: Add opening/closing animation speed to SideNavigation
cursoragent Nov 6, 2025
20e74de
Refactor SideNavigation animation logic
cursoragent Nov 6, 2025
8f84b77
Refactor SideNavigation footer styling
cursoragent Nov 6, 2025
9fea95d
feat: Add "New" text to new config button
cursoragent Nov 6, 2025
dffb8cb
Fix: Add semicolon to OutlineIconButton gap style
cursoragent Nov 6, 2025
dee4f7e
feat: Add resizable side navigation panel
cursoragent Nov 6, 2025
7ae9d93
Refactor: Replace react-split with ResizablePanel component
cursoragent Nov 6, 2025
e0b9e8c
Refactor: Improve resizable panel border and handle styling
cursoragent Nov 6, 2025
5923f8f
Checkpoint before follow-up message
cursoragent Nov 6, 2025
5c54c1d
Refactor: Improve resizable panel handle appearance and interaction
cursoragent Nov 6, 2025
cfeb655
Increase resizable panel handle size
cursoragent Nov 6, 2025
a6e05a3
Refactor ResizablePanel styling and resize handle
cursoragent Nov 6, 2025
87144d8
Refactor: Improve resizable panel hover styles
cursoragent Nov 6, 2025
3d2f9fe
Feat: Add shadow to resize handle for better visibility
cursoragent Nov 6, 2025
cbecbc6
Feat: Add opacity to resize handle for better visibility
cursoragent Nov 6, 2025
ebb7ce3
Refactor: Darken background color to #2a2a2a
cursoragent Nov 6, 2025
906f245
Refactor: Reduce resize handle width to 3px
cursoragent Nov 6, 2025
a73a9d6
Refactor: Improve ResizablePanel resize handle appearance
cursoragent Nov 6, 2025
a1b7f69
Fix: Use ::after pseudo-element for resize handle indicator
cursoragent Nov 6, 2025
39afb58
Refactor: Enhance resize handle hover effects and transition properties
ceoloide Nov 7, 2025
5efa7da
Refactor: Adjust initial widths and resizing constraints for panels
ceoloide Nov 7, 2025
215a358
feat: Add wrapper for setting preview and hiding downloads
cursoragent Nov 7, 2025
998360f
Refactor: Add Preview type and update state typing
cursoragent Nov 7, 2025
1a1cd62
Fix: Only hide downloads panel on mobile
cursoragent Nov 7, 2025
821dfc0
feat: Add mobile editor and responsive layout
cursoragent Nov 7, 2025
63e6a19
Refactor: Move configContext initialization
cursoragent Nov 7, 2025
cfc7477
Refactor: Make ResizablePanel full width on mobile
cursoragent Nov 7, 2025
c2cfbde
Refactor: Improve mobile layout and panel behavior
cursoragent Nov 7, 2025
82a4ccc
Fix: Simplify display logic for mobile editor and settings panel
ceoloide Nov 7, 2025
e62f915
Refactor Input component styles for improved appearance
cursoragent Nov 7, 2025
83d2ec0
Refactor GenOption to use Material Design switch
cursoragent Nov 7, 2025
0870792
Refactor: Align switch to the right in GenOption
cursoragent Nov 7, 2025
02c7bdc
Refactor: Improve layout of OptionContainer and GenOption
cursoragent Nov 7, 2025
5567846
Refactor: Use styled-components for InjectionEditor layout
cursoragent Nov 7, 2025
b3ddf8f
Remove margin-bottom from MobileEditorHeader
cursoragent Nov 7, 2025
820152d
Adjust settings width and disable KiCad preview download
cursoragent Nov 7, 2025
be8bc41
feat: Hide settings button on new page
cursoragent Nov 7, 2025
d28e9c3
Refactor: Move share functionality to Header component
cursoragent Nov 7, 2025
79fe0fa
Refactor: Remove redundant archive download button
cursoragent Nov 7, 2025
7b207a9
Refactor: Group header buttons and remove mobile archive button
cursoragent Nov 7, 2025
3b8adb2
feat: Hide 'New' text on small screens
cursoragent Nov 7, 2025
426910f
Fix invalid `::` syntax for `hover`
ceoloide Nov 7, 2025
680173c
Refactor: Extract maxWidth calculation into a helper function
cursoragent Nov 7, 2025
afdd7f8
Refactor ResizablePanel to use inline style for width
cursoragent Nov 7, 2025
992a0f9
Refactor: Remove unused mobile editor state management
ceoloide Nov 7, 2025
53bbc49
Refactor: Use $ prefix for styled-component props
cursoragent Nov 7, 2025
ae4ed68
Refactor: Update AGENTS.md with styled-components and resizable panel…
cursoragent Nov 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ This project is a React-based web interface for the [Ergogen](https://github.com
- Tests should be robust and user-centric. Prefer selecting elements by user-facing attributes (like accessible name, text, or role) over implementation details (like class names or DOM structure). Use `data-testid` for elements where no other stable, user-facing selector is available.
- **Centralized Theming**: All colors and other theme-related properties (e.g., font sizes, spacing) should be centralized in `src/theme/theme.ts`. Components should import and use variables from this theme file instead of using hardcoded values.
- **Styled Components for Styling**: All styling, including global styles, should be managed using `styled-components`. Global styles should be defined in a `GlobalStyle` component to ensure consistency and encapsulation within the React component architecture, avoiding the use of separate CSS files like `index.css`.
- **Styled-components Transient Props**: When passing props to styled-components that are only used for styling and should not be passed to the DOM, prefix them with `$` (e.g., `$isVisible`, `$isDragging`). This prevents React warnings about unrecognized props on DOM elements.
- **Styled-components Performance**: For frequently changing values (e.g., width during drag operations), use inline styles via the `style` prop instead of CSS template literals. This prevents styled-components from generating excessive classes and avoids performance warnings. Example: Instead of `width: ${props.$width}px` in the template, pass `style={{ width: `${width}px` }}` to the component.

## Development environment

Expand Down Expand Up @@ -148,6 +150,31 @@ The project follows the principles of **Atomic Design** to structure its React c

This structure promotes reusability and a clear separation of concerns, making it easier to develop and test components in isolation.

## Resizable Panels

The application uses a custom `ResizablePanel` component (`src/molecules/ResizablePanel.tsx`) for creating resizable split-panel layouts. This component replaced the `react-split` library to provide more control over styling and behavior.

### Features

- **Drag-to-resize**: Supports both mouse and touch interactions for resizing
- **Flexible constraints**: Supports `minWidth`, `maxWidth` (as pixels, percentages, or numbers), and `initialWidth`
- **Side-aware**: Can be configured as a left or right panel with appropriate handle positioning
- **Performance optimized**: Uses inline styles for width to avoid generating excessive CSS classes during resize operations

### Usage

The `ResizablePanel` component is used throughout the application for:
- **Config panel**: Left-side panel containing the configuration editor
- **Downloads panel**: Right-side panel containing the file downloads list
- **Settings panel**: Left-side panel containing options and injections list

### Implementation Details

- Width is managed via React state and updated during drag operations
- Maximum width calculation handles percentage strings (e.g., `"70%"`), pixel strings (e.g., `"600px"`), and numeric values
- On mobile devices (≤639px), panels automatically expand to 100% width and resize handles are hidden
- The resize handle includes visual feedback with hover effects and a gap effect using `box-shadow`

## Web Workers

The application offloads long-running, computationally intensive tasks to Web Workers to prevent the main UI thread from freezing. This ensures the user interface remains responsive while processing complex keyboard layouts or generating 3D models.
Expand Down Expand Up @@ -350,7 +377,7 @@ The share system provides comprehensive error handling:
- Preserves existing injections not in the shared config
- **`src/molecules/ShareDialog.tsx`**: Dialog component for displaying and copying share links
- **`src/App.tsx`**: Handles initial hash fragment loading and hash change events
- **`src/Ergogen.tsx`**: Contains share button and triggers the share dialog
- **`src/atoms/Header.tsx`**: Contains the share button and share functionality. The share button is visible on the main page (`/`) but hidden on the Welcome page (`/new`). It's also visible on mobile devices.

### Future Enhancements

Expand Down Expand Up @@ -413,12 +440,14 @@ Proposed Fix: I will break down the runGeneration function into several smaller,

### [TASK-004] Replace Resizable Panel Library

**Context:** The application currently uses an unspecified or custom implementation for resizable panels. The user has expressed a desire to switch to a more robust and feature-rich solution, specifically `react-resizable-panels`, to better emulate the UI behavior of modern editors like VS Code.
**Context:** The application currently uses a custom `ResizablePanel` component (`src/molecules/ResizablePanel.tsx`) that replaced `react-split`. The user previously expressed interest in switching to `react-resizable-panels` for a more robust solution, but the custom implementation has been working well and provides good control over styling and behavior.

**Status:** The custom `ResizablePanel` component is currently in use and documented in AGENTS.md. This task can be considered low priority unless specific limitations are encountered.

**Task:** Replace the existing resizable panel implementation throughout the application with `react-resizable-panels`. This will involve:
**Task (if needed):** If migration to `react-resizable-panels` is desired, this would involve:

1. Adding `react-resizable-panels` as a project dependency.
2. Identifying all components that use the current resizable panel system.
2. Identifying all components that use the current `ResizablePanel` component.
3. Refactoring these components to use the `PanelGroup`, `Panel`, and `PanelResizeHandle` components from the new library.
4. Ensuring that the new implementation is styled consistently with the application's theme and provides a smooth, VS Code-like user experience.
5. Verifying that all related functionality, including E2E tests, remains intact after the migration.
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</style>
</head>

<body style="background: #2d2d2d;">
<body style="background: #2a2a2a;">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="%PUBLIC_URL%/dependencies/maker.js"></script>
Expand Down
6 changes: 6 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Welcome from './pages/Welcome';
import Header from './atoms/Header';
import LoadingBar from './atoms/LoadingBar';
import Banners from './organisms/Banners';
import SideNavigation from './molecules/SideNavigation';
import ConfigContextProvider, {
useConfigContext,
} from './context/ConfigContext';
Expand Down Expand Up @@ -221,6 +222,11 @@ const AppContent = () => {
data-testid="loading-bar"
/>
<Banners />
<SideNavigation
isOpen={configContext?.showSideNav ?? false}
onClose={() => configContext?.setShowSideNav(false)}
data-testid="side-navigation"
/>
<PageWrapper>
<Routes>
<Route
Expand Down
Loading