Skip to content

Conversation

@zhangligei
Copy link
Collaborator

变更内容

  • 新功能
  • 修复 Bug
  • 增强重构
  • 其他(请描述)

简要描述本次 PR 的主要变更内容。

相关 Issue

请关联相关 Issue(如有):#编号

检查清单

默认已勾选,如不满足,请检查。

  • 已在本地测试通过
  • 已补充/更新相关文档
  • 代码风格已经过 pre-commit 钩子检查
  • 非企业版分支
  • 遵循 贡献者文档 中的最佳实践

其他说明

如有特殊说明或注意事项,请补充。

- ♻️ refactor:Create /chat route with HeroParallax component for product showcase
- Add products.ts with Xyzen product data
- Implement chat page layout with animated parallax effect
- Add CTA button linking to Bohrium Xyzen application
- Update Navbar to include Projects menu with 5 ScienceOL products
- Add dark mode styling for better visual appearance
- Integrate React Router with new /chat route in router.tsx
- Create /chat route with HeroParallax component and product carousel
- Add Projects menu to navbar with 5 ScienceOL products (Studio, Xyzen, PROTIUM, Anti, Lab-OS)
- Implement responsive chat page with animated parallax and CTA button
- Add Tutorial menu item linking to documentation
- Create custom useTheme hook integrated with existing UiCore system
- Support dynamic theme switching (system/dark/light modes)
- Merge main branch and resolve conflicts
- Create interactive 3D lab scene using React Three Fiber
- Implement 12+ device components (liquid handler, microscope, centrifuge, AGV robot, etc.)
- Add device detail modal with 3D preview and specifications
- Support device animations and interactive highlighting
- Include device information database
- Update navbar with 3D Lab navigation links
- Enhance scrollbar styling for better UX
Copilot AI review requested due to automatic review settings December 16, 2025 05:15
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @zhangligei, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new 3D laboratory visualization feature for the Xyzen platform, along with theme system improvements across the application. The changes create an interactive 3D scene showcasing laboratory equipment with detailed information modals, while enhancing the existing chat landing page with proper light/dark theme support.

Key Changes:

  • Added a new interactive 3D laboratory page with clickable devices and detailed information modals
  • Implemented a reusable useTheme hook for consistent theme detection across components
  • Enhanced the chat landing page and hero parallax component with dynamic theme-aware styling

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
web/src/router.tsx Added new route for 3D lab page
web/src/hooks/useTheme.ts New custom hook for theme state management with system preference detection
web/src/components/ui/hero-parallax.tsx Integrated theme support for dynamic background and text colors
web/src/app/navbar/Tutorials.tsx Updated tutorial link styling and added i18n support
web/src/app/navbar/Projects.tsx Added 3D lab navigation entries with new Blender icon
web/src/app/navbar/NavbarFullWidth.tsx Enhanced link handling to differentiate internal routes from external URLs
web/src/app/navbar/Navbar.tsx Replaced Tutorial component with inline link implementation
web/src/app/chat/products.ts Updated thumbnail URLs to light-themed versions
web/src/app/chat/page.tsx Integrated theme support for dynamic styling
web/src/app/3D_lab/page.tsx Main 3D lab page component with device interaction logic
web/src/app/3D_lab/styles.css Custom animations and scrollbar styling for 3D lab
web/src/app/3D_lab/deviceInfo.ts Device metadata and information structure
web/src/app/3D_lab/deviceComponents.tsx Reusable 3D device component library
web/src/app/3D_lab/InteractiveLabScene.tsx Main 3D scene setup with interactive devices
web/src/app/3D_lab/DeviceDetailModal.tsx Modal component for displaying device details with 3D preview
web/index.css Global scrollbar styling enhancements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +659 to +668
<ClickableDevice
deviceId="microscope"
position={[0, 0.95, -4.2]}
onDeviceClick={onDeviceClick}
isHighlighted={highlightedDevice === 'microscope'}
isAnimating={animatingDevice === 'microscope'}
disabled={disabled}
>
<Microscope isAnimating={animatingDevice === 'microscope'} />
</ClickableDevice>
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The disabled prop is not being passed to this ClickableDevice. This microscope instance should receive the disabled prop to prevent interaction when a modal is open, consistent with the liquid-handler implementation.

Copilot uses AI. Check for mistakes.
Comment on lines +669 to +688
<ClickableDevice
deviceId="centrifuge"
position={[-1.2, 0.95, -4.2]}
onDeviceClick={onDeviceClick}
isHighlighted={highlightedDevice === 'centrifuge'}
isAnimating={animatingDevice === 'centrifuge'}
disabled={disabled}
>
<Centrifuge isAnimating={animatingDevice === 'centrifuge'} />
</ClickableDevice>
<ClickableDevice
deviceId="centrifuge"
position={[1.2, 0.95, -4.2]}
onDeviceClick={onDeviceClick}
isHighlighted={highlightedDevice === 'centrifuge'}
isAnimating={animatingDevice === 'centrifuge'}
disabled={disabled}
>
<Centrifuge isAnimating={animatingDevice === 'centrifuge'} />
</ClickableDevice>
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The disabled prop is not being passed to these ClickableDevice components. These centrifuge instances should receive the disabled prop to prevent interaction when a modal is open, consistent with the liquid-handler implementation.

Copilot uses AI. Check for mistakes.
name: 'Anti',
description: '用于实验室模拟的3D数字孪生平台',
href: `/deepmd-kit`,
href: `/3D_lab`,
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The route path "/3D_lab" is inconsistent with other naming conventions in the file. This same path is also used in Projects.tsx (line 168, 182). If the route path is changed, ensure all references are updated accordingly.

Copilot uses AI. Check for mistakes.
className={`inline-flex items-center gap-x-1 text-sm font-semibold leading-6 text-neutral-900 focus:outline-none dark:text-neutral-100 ${'hover:text-indigo-600 dark:hover:text-indigo-500'}`}
href="https://docs.sciol.ac.cn"
>
<span>{t('navbar.tutorial')}</span>
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing translation fallback value. The t function call on line 44 doesn't provide a default fallback value, unlike line 76 in Tutorials.tsx which uses t('navbar.tutorial','Tutorial'). For consistency and to ensure text is displayed if the translation key is missing, add a fallback: t('navbar.tutorial', 'Tutorial').

Suggested change
<span>{t('navbar.tutorial')}</span>
<span>{t('navbar.tutorial', 'Tutorial')}</span>

Copilot uses AI. Check for mistakes.
Comment on lines +615 to +624
<ClickableDevice
deviceId="centrifuge"
position={[-4.5, 0.95, -1.2]}
onDeviceClick={onDeviceClick}
isHighlighted={highlightedDevice === 'centrifuge'}
isAnimating={animatingDevice === 'centrifuge'}
disabled={disabled}
>
<Centrifuge isAnimating={animatingDevice === 'centrifuge'} />
</ClickableDevice>
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The disabled prop is not being passed to ClickableDevice components for centrifuge and microscope instances. While the liquid-handler at line 553-564 correctly passes the disabled prop, multiple other ClickableDevice instances (lines 568-577, 585-602, 603-612, 615-624, 630-647, 659-668, 669-678, 679-688, 702-714, 715-727) are missing this prop. This means these devices will remain interactive even when a modal is open, which is inconsistent with the intended behavior.

Copilot uses AI. Check for mistakes.
Comment on lines +568 to +577
<ClickableDevice
deviceId="centrifuge"
position={[1.5, 0.95, 0.6]}
onDeviceClick={onDeviceClick}
isHighlighted={highlightedDevice === 'centrifuge'}
isAnimating={animatingDevice === 'centrifuge'}
disabled={disabled}
>
<Centrifuge isAnimating={animatingDevice === 'centrifuge'} />
</ClickableDevice>
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The disabled prop is not being passed to this ClickableDevice. This centrifuge instance should receive the disabled prop to prevent interaction when a modal is open, consistent with the liquid-handler implementation.

Copilot uses AI. Check for mistakes.
Comment on lines +108 to +125
<button
onClick={() => setShowDeviceList(false)}
className="text-neutral-500 hover:text-neutral-700 dark:hover:text-neutral-300"
>
<svg
className="w-5 h-5"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M6 18L18 6M6 6l12 12"
/>
</svg>
</button>
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing accessible label for the close button. Screen reader users won't know what this button does. Add an aria-label attribute: aria-label="关闭设备列表" or wrap the button content with descriptive text.

Copilot uses AI. Check for mistakes.
{
name:'3D Lab',
description: '展示3D实验室的实验仪器和场景',
href: `/3D_lab`,
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The route path "/3D_lab" is inconsistent with other naming conventions in the file. This same path is also used in Projects.tsx (line 168, 182). If the route path is changed, ensure all references are updated accordingly.

Copilot uses AI. Check for mistakes.
};

export const Header = () => {
export const Header = ({isDark}:{isDark: boolean}) => {
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Header component parameter formatting is inconsistent. The parameter should have proper spacing: ({ isDark }: { isDark: boolean }) instead of ({isDark}:{isDark: boolean}).

Suggested change
export const Header = ({isDark}:{isDark: boolean}) => {
export const Header = ({ isDark }: { isDark: boolean }) => {

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +18
// const Tutorial = Tutorial as React.ComponentType<{
// index: number;
// activeMenuItem: number | null;
// setActiveMenuItem: React.Dispatch<React.SetStateAction<number | null>>;
// open: boolean;
// setOpen: React.Dispatch<React.SetStateAction<boolean>>;
// }>;
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an inconsistency in the commented-out code. Line 12 names the variable "Tutorial" but line 13's comment refers to it as "Tutorial" in the type annotation. The original import was "Tutorial" (line 10), so the commented code should maintain this name consistently throughout.

Copilot uses AI. Check for mistakes.
@zhangligei zhangligei closed this Dec 16, 2025
@zhangligei zhangligei reopened this Dec 16, 2025
@zhangligei zhangligei closed this Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants