feat: add support for dual frontend (JS and React) in the CCW application

- Updated CLI to include `--frontend` option for selecting frontend type (js, react, both).
- Modified serve command to start React frontend when specified.
- Implemented React frontend startup and shutdown logic.
- Enhanced server routing to handle requests for both JS and React frontends.
- Added workspace selector component with i18n support.
- Updated tests to reflect changes in header and A2UI components.
- Introduced new Radix UI components for improved UI consistency.
- Refactored A2UIButton and A2UIDateTimeInput components for better code clarity.
- Created migration plan for gradual transition from JS to React frontend.
This commit is contained in:
catlog22
2026-01-31 16:46:45 +08:00
parent 345437415f
commit 35f9116cce
13 changed files with 798 additions and 96 deletions

View File

@@ -162,12 +162,20 @@ describe('Header Component - i18n Tests', () => {
expect(brandLink).toBeInTheDocument();
});
it('should display project path when provided', () => {
it('should render workspace selector when project path is provided', () => {
render(<Header projectPath="/test/path" />);
// Should show the path indicator
const pathDisplay = screen.getByTitle('/test/path');
expect(pathDisplay).toBeInTheDocument();
// Should render the workspace selector button with aria-label
const workspaceButton = screen.getByRole('button', { name: /workspace selector/i });
expect(workspaceButton).toBeInTheDocument();
});
it('should not render workspace selector when project path is empty', () => {
render(<Header projectPath="" />);
// Should NOT render the workspace selector button
const workspaceButton = screen.queryByRole('button', { name: /workspace selector/i });
expect(workspaceButton).not.toBeInTheDocument();
});
});