Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions pages/src/assets/icons/apple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions pages/src/assets/icons/linux.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions pages/src/assets/icons/windows.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions pages/src/components/HeroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import ErrorBoundary from './ErrorBoundary';
import npmIcon from '../assets/icons/npm.svg';
import brewIcon from '../assets/icons/brew.svg';
import macportsIcon from '../assets/icons/macports.svg';
import appleIcon from '../assets/icons/apple.svg';
import linuxIcon from '../assets/icons/linux.svg';
import windowsIcon from '../assets/icons/windows.svg';
import copyIcon from '../assets/icons/icon-copy.svg';
import chevronDownIcon from '../assets/icons/icon-chevron-down.svg';

Expand Down Expand Up @@ -135,6 +138,9 @@ interface InstallChannel {
const INSTALL_CHANNELS: InstallChannel[] = [
{ key: 'npm', labelKey: 'hero.installNpm', cmd: 'npm i -g @alibaba-group/open-code-review', icons: [npmIcon], primary: true },
{ key: 'brew', labelKey: 'hero.installBrew', cmd: 'brew install open-code-review', icons: [brewIcon], primary: true },
{ key: 'macos', labelKey: 'hero.installMacOS', cmd: 'curl -fsSL https://open-codereview.ai/install.sh | sh', icons: [appleIcon], primary: false },
{ key: 'linux', labelKey: 'hero.installLinux', cmd: 'curl -fsSL https://open-codereview.ai/install.sh | sh', icons: [linuxIcon], primary: false },
{ key: 'windows', labelKey: 'hero.installWindows', cmd: 'irm https://open-codereview.ai/install.ps1 | iex', icons: [windowsIcon], primary: false },
Comment on lines +141 to +143

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maintainability · medium
Hardcoded URLs: The installation URLs (https://open-codereview.ai/install.sh and https://open-codereview.ai/install.ps1) are hardcoded business-related strings that should be extracted to a constants or configuration file. This violates the coding standard that prohibits hardcoded URL paths.

Additionally, these URLs appear in multiple places throughout the codebase (documentation files, README files), creating maintenance burden. If the domain or path changes, you would need to update many files.

Recommendation: Create a constants file (e.g., src/constants/install.ts) to centralize these URLs:

export const INSTALL_URLS = {
  SHELL_SCRIPT: 'https://open-codereview.ai/install.sh',
  POWERSHELL_SCRIPT: 'https://open-codereview.ai/install.ps1',
};

Then reference them in the install channels:

{ key: 'macos', ..., cmd: `curl -fsSL ${INSTALL_URLS.SHELL_SCRIPT} | sh`, ... }
{ key: 'windows', ..., cmd: `irm ${INSTALL_URLS.POWERSHELL_SCRIPT} | iex`, ... }

{ key: 'macports', labelKey: 'hero.installMacPorts', cmd: 'sudo port install open-code-review', icons: [macportsIcon], primary: false },
];

Expand Down Expand Up @@ -246,7 +252,7 @@ const HeroSection: React.FC = () => {
minHeight: isMobile ? 600 : isTablet ? 700 : 680,
paddingBottom: isMobile ? 60 : 80,
position: 'relative',
overflow: 'hidden',
overflow: 'visible',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
Expand Down Expand Up @@ -432,13 +438,13 @@ const HeroSection: React.FC = () => {
style={{
position: 'absolute',
top: '100%',
right: 0,
left: 0,
marginTop: 8,
background: 'rgba(26,26,26,0.92)',
backdropFilter: 'blur(12px)',
border: '1px solid rgba(255,255,255,0.15)',
borderRadius: 8,
padding: 4,
padding: '8px 4px',
zIndex: 200,
minWidth: 200,
}}
Expand Down
3 changes: 3 additions & 0 deletions pages/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export const en = {
'hero.installNpm': 'npm',
'hero.installBrew': 'Homebrew',
'hero.installMacPorts': 'MacPorts',
'hero.installMacOS': 'MacOS',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style · low
Minor branding nit: Apple's official styling is "macOS" (lowercase 'm', uppercase 'OS'). Consider using "macOS" for consistency with Apple's branding convention.

Suggestion:

Suggested change
'hero.installMacOS': 'MacOS',
'hero.installMacOS': 'macOS',

'hero.installLinux': 'Linux',
'hero.installWindows': 'Windows',
'hero.installMore': 'More',
'hero.allInstallOptions': 'All install options',

Expand Down
3 changes: 3 additions & 0 deletions pages/src/i18n/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export const ja: TranslationKeys = {
'hero.installNpm': 'npm',
'hero.installBrew': 'Homebrew',
'hero.installMacPorts': 'MacPorts',
'hero.installMacOS': 'MacOS',
'hero.installLinux': 'Linux',
'hero.installWindows': 'Windows',
'hero.installMore': 'その他',
'hero.allInstallOptions': 'すべてのインストール方法',

Expand Down
3 changes: 3 additions & 0 deletions pages/src/i18n/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export const ru: TranslationKeys = {
'hero.installNpm': 'npm',
'hero.installBrew': 'Homebrew',
'hero.installMacPorts': 'MacPorts',
'hero.installMacOS': 'MacOS',
'hero.installLinux': 'Linux',
'hero.installWindows': 'Windows',
'hero.installMore': 'Ещё',
'hero.allInstallOptions': 'Все способы установки',

Expand Down
3 changes: 3 additions & 0 deletions pages/src/i18n/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export const zh: TranslationKeys = {
'hero.installNpm': 'npm',
'hero.installBrew': 'Homebrew',
'hero.installMacPorts': 'MacPorts',
'hero.installMacOS': 'MacOS',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style · low
Apple's official branding for the operating system is "macOS" (lowercase 'm', uppercase 'OS'). Using "MacOS" is inconsistent with Apple's standard naming convention. This applies across all four language files (en, ja, ru, zh).

Suggestion:

Suggested change
'hero.installMacOS': 'MacOS',
'hero.installMacOS': 'macOS',

'hero.installLinux': 'Linux',
'hero.installWindows': 'Windows',
'hero.installMore': '更多',
'hero.allInstallOptions': '全部安装方式',

Expand Down
Loading