Skip to content

#99 fix: UI/UX 개선#107

Merged
suminb99 merged 6 commits intodevelopfrom
fix/99-ui-cleanup
Mar 27, 2026
Merged

#99 fix: UI/UX 개선#107
suminb99 merged 6 commits intodevelopfrom
fix/99-ui-cleanup

Conversation

@suminb99
Copy link
Copy Markdown
Contributor

@suminb99 suminb99 commented Mar 27, 2026

⚙️ Related ISSUE Number

Related #99



📄 Work Description

  • 로그인 화면 레이아웃 개선 (noScroll, 이미지 교체)
  • Button 컴포넌트 onMouseEnter, onMouseLeave 적용
  • 코드 메세지에 syntax-highlighter 적용



📷 Screenshot



💬 To Reviewers



🔗 Reference

@suminb99 suminb99 self-assigned this Mar 27, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
snow-code-client Ready Ready Preview, Comment Mar 27, 2026 1:44am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a305961b-2455-411d-ae64-ccfaa39c0bd1

📥 Commits

Reviewing files that changed from the base of the PR and between a01488d and fb89e91.

📒 Files selected for processing (1)
  • src/pages/common/LandingPage.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/pages/common/LandingPage.tsx

📝 Walkthrough

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 채팅 메시지의 코드에 구문 강조 표시 추가
  • UI/UX 개선

    • 랜딩 페이지의 레이아웃 및 애니메이션 최적화
    • 사용자 입력 페이지의 UI 요소 위치 및 크기 조정
    • 버튼 마우스 인터랙션 반응성 강화

Walkthrough

SVG를 React 컴포넌트로 전환하고 버튼에 마우스 이벤트 핸들러를 추가했으며, 코드 메시지에 대해 react-syntax-highlighter를 사용한 신택스 하이라이팅을 적용했습니다. 페이지 레이아웃 및 로고 호버 애니메이션도 조정되었습니다. (50단어 이내)

Changes

Cohort / File(s) Summary
의존성 추가
package.json
react-syntax-highlighter v^16.1.1 및 타입 @types/react-syntax-highlighter v^15.5.13 추가.
UI 컴포넌트 확장
src/shared/ui/button/Button.tsx
ButtonProps에 onMouseEnter, onMouseLeave optional props 추가 및 button 엘리먼트에 이벤트 연결.
페이지 레이아웃 조정
src/pages/common/LandingPage.tsx, src/pages/common/UserIdInputPage.tsx
SVG import를 ?react로 변경해 React 컴포넌트로 렌더링, 루트 컨테이너 높이 제약 제거, 버튼/아이콘 위치·크기·스타일 조정, 로고 호버 애니메이션 변경.
채팅 메시지 렌더링
src/widgets/chat-message-panel/ui/ChatMessagePanel.tsx
messageType === 'CODE' 분기 추가: Prism oneDark 테마로 react-syntax-highlighter 사용(언어 python, 인라인 스타일 지정). 일반 텍스트 메시지 구조는 유지되나 일부 클래스/포맷 정리.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

🎨 ui, 🐞 bugFix

Suggested reviewers

  • JiiminHa

검토 팁(짧게): Button에 추가된 마우스 이벤트는 문서화된 시그니처와 일관되게 사용하세요(예: MDN mouse events: https://developer.mozilla.org/docs/Web/API/Element/mouseenter_event). ChatMessagePanel의 하이라이터 스타일은 모바일 가로 오버플로우를 고려해 테스트 권장합니다. 칭찬: UI 상호작용 세심하게 정리했네요 — 깔끔합니다.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경 사항의 주요 내용과 관련이 있습니다. UI/UX 개선은 로그인 화면 레이아웃, 버튼 이벤트, 코드 신택스 하이라이터 추가 등의 변경사항을 포괄합니다.
Description check ✅ Passed PR 설명이 변경 사항과 관련이 있습니다. 로그인 화면 레이아웃 개선, Button 컴포넌트 이벤트 추가, 신택스 하이라이터 적용 등 실제 변경사항을 명시하고 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/99-ui-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
src/pages/common/LandingPage.tsx (1)

72-72: arbitrary value 사용 이유가 있나요?

text-[33px]는 arbitrary value입니다. 디자인 시스템에서 정확히 33px가 필요한 것인지, 아니면 가장 가까운 Tailwind 기본값(text-3xl = 30px 또는 text-4xl = 36px)을 사용할 수 있는지 확인해보세요.

디자인 일관성을 위해 가능하면 Tailwind의 기본 타이포그래피 스케일을 사용하는 것이 좋습니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/common/LandingPage.tsx` at line 72, The span currently uses an
arbitrary font-size class "text-[33px]" (see the span with class
'text-black-primary text-[33px] font-semibold leading-[150%]'); replace this
arbitrary value with the nearest Tailwind typography token (e.g., text-3xl or
text-4xl) and adjust the line-height class (replace leading-[150%] with the
closest Tailwind leading token like leading-tight/leading-snug/leading-normal)
so the element uses the design system scale instead of a hardcoded pixel value.
src/widgets/chat-message-panel/ui/ChatMessagePanel.tsx (1)

3-4: 코드 블록 렌더링을 위한 하이라이터는 지연 로딩을 권장합니다

현재 코드는 SyntaxHighlighter를 최상단에서 eagerly import하고 있지만, message.messageType === 'CODE'일 때만 사용됩니다. react-syntax-highlighter는 unpacked 상태로 1.5MB 규모이므로, 필요할 때만 로드하면 초기 번들을 줄일 수 있습니다.

다음과 같이 개선할 수 있습니다:

  • PrismAsyncLight 사용: 공식 async 빌드로 필요한 언어만 동적으로 로드
  • React.lazy + Suspense로 코드 블록 렌더링 컴포넌트 분리: 초기 로드 시 해당 컴포넌트는 제외

참고: React lazy 패턴, Vite 동적 임포트, react-syntax-highlighter 비동기 빌드

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/widgets/chat-message-panel/ui/ChatMessagePanel.tsx` around lines 3 - 4,
The file eagerly imports Prism SyntaxHighlighter even though it's only used when
message.messageType === 'CODE', inflating the bundle; change
ChatMessagePanel.tsx to lazy-load the highlighter: create a separate CodeBlock
component (or lazy-load the existing render branch) that imports
react-syntax-highlighter's async build (PrismAsyncLight) and required languages
via dynamic import, then use React.lazy + Suspense to load that component only
for CODE messages; update the branch that checks message.messageType === 'CODE'
to render the lazy CodeBlock component so the heavy dependency is not included
in the initial bundle.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 48: The dependency `@types/react-syntax-highlighter`@15.5.13 is
incompatible with react-syntax-highlighter@16.x; update package.json to resolve
the mismatch by either removing the outdated `@types` entry, upgrading/locking
react-syntax-highlighter to a compatible v15.x, or adding a temporary
override/resolution (or local d.ts) for `@types/react-syntax-highlighter` to avoid
TS errors; if you choose a short-term workaround, annotate problematic
imports/usages with // `@ts-ignore` or explicit type assertions until the official
`@types` (see issue `#439`) or an in-repo type definition replaces it—look for the
package name "react-syntax-highlighter" and "@types/react-syntax-highlighter" in
package.json to apply the change.

In `@src/pages/common/LandingPage.tsx`:
- Line 65: The Tailwind classes in LandingPage.tsx's className (`w-100`,
`duration-800`, `scale-115`) are not in the default scale—replace them with
Tailwind arbitrary-value syntax: use w-[100px] (or w-[100%] if you intended full
width), duration-[800ms], and scale-[1.15] in the className expression that
builds the container (keep the conditional on hover !== 'none' but switch the
scale token to scale-[1.15]).

In `@src/widgets/chat-message-panel/ui/ChatMessagePanel.tsx`:
- Around line 84-99: The CODE branch hardcodes language='python' causing wrong
highlighting; update MessageItem in ChatMessagePanel.tsx to detect language from
the message (either add a language field to the chat message model or implement
a parseCodeBlock helper) and pass that into SyntaxHighlighter; specifically, add
a parseCodeBlock(content: string) function that extracts fenced-code language
and code (falling back to {language:'text', code: content}), compute parsedCode
= message.messageType === 'CODE' ? parseCodeBlock(message.content) : null, then
change SyntaxHighlighter props to language={parsedCode?.language ?? 'text'} and
render parsedCode?.code ?? message.content instead of the hardcoded 'python' and
message.content.

---

Nitpick comments:
In `@src/pages/common/LandingPage.tsx`:
- Line 72: The span currently uses an arbitrary font-size class "text-[33px]"
(see the span with class 'text-black-primary text-[33px] font-semibold
leading-[150%]'); replace this arbitrary value with the nearest Tailwind
typography token (e.g., text-3xl or text-4xl) and adjust the line-height class
(replace leading-[150%] with the closest Tailwind leading token like
leading-tight/leading-snug/leading-normal) so the element uses the design system
scale instead of a hardcoded pixel value.

In `@src/widgets/chat-message-panel/ui/ChatMessagePanel.tsx`:
- Around line 3-4: The file eagerly imports Prism SyntaxHighlighter even though
it's only used when message.messageType === 'CODE', inflating the bundle; change
ChatMessagePanel.tsx to lazy-load the highlighter: create a separate CodeBlock
component (or lazy-load the existing render branch) that imports
react-syntax-highlighter's async build (PrismAsyncLight) and required languages
via dynamic import, then use React.lazy + Suspense to load that component only
for CODE messages; update the branch that checks message.messageType === 'CODE'
to render the lazy CodeBlock component so the heavy dependency is not included
in the initial bundle.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b5f193cf-b572-490f-883d-a047cf9c4e67

📥 Commits

Reviewing files that changed from the base of the PR and between 788985f and a01488d.

⛔ Files ignored due to path filters (3)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src/assets/svg/arrowleftIcon.svg is excluded by !**/*.svg
  • src/assets/svg/arrowrightIcon.svg is excluded by !**/*.svg
📒 Files selected for processing (5)
  • package.json
  • src/pages/common/LandingPage.tsx
  • src/pages/common/UserIdInputPage.tsx
  • src/shared/ui/button/Button.tsx
  • src/widgets/chat-message-panel/ui/ChatMessagePanel.tsx

Comment thread package.json
"@types/node": "^24.2.1",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@types/react-syntax-highlighter": "^15.5.13",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Does react-syntax-highlighter@16.1.1 include built-in TypeScript types, and if not, which @types/react-syntax-highlighter version is recommended for it?

💡 Result:

No, react-syntax-highlighter@16.1.1 does not include built-in TypeScript types. The official npm page and README explicitly recommend installing the separate @types/react-syntax-highlighter package as a dev dependency to prevent TypeScript or ESLint errors. The latest version of @types/react-syntax-highlighter is 15.5.13 (last updated May 2024), which is commonly used with v16.x (e.g., in real-world package.json examples with react-syntax-highlighter ^16.1.0). While @types versions lag behind (no updates since v15 despite v16 releases in 2025-2026), it remains the recommended and compatible option per official docs. GitHub issues confirm ongoing reliance on external types without built-in support added.

Citations:


🌐 Web query:

react-syntax-highlighter 16.x와 @types/react-syntax-highlighter 15.x 호환성 공식 문서 확인

💡 Result:

react-syntax-highlighter 16.x와 @types/react-syntax-highlighter 15.x는 공식적으로 호환되지 않습니다. 공식 npm 페이지와 GitHub README(2026년 2월 v16.1.1 업데이트 기준)에서 TypeScript 사용자에게 @types/react-syntax-highlighter를 설치하라고 권장하지만, @types 패키지의 최신 버전은 15.5.13(2024년 5월)으로 16.x의 변경사항(refractor v5 업그레이드 등)을 반영하지 않습니다. GitHub 이슈 #439(2021년~)에서 types 동기화 요청이 open 상태이며, 16.x 릴리스 노트나 CHANGELOG에 types 업데이트 언급이 없습니다. 따라서 TypeScript 오류(예: 새로운 테마/props 누락, import 경로 변경)가 발생할 수 있으며, 임시 workaround나 types 업데이트 대기를 권장합니다.

Citations:


@types/react-syntax-highlighter 버전을 병합 전에 반드시 재검토하세요

Line 48의 @types/react-syntax-highlighter@15.5.13react-syntax-highlighter@16.x는 공식적으로 호환되지 않습니다. @types 패키지가 2024년 5월 이후 업데이트되지 않은 반면, v16.x에서는 refractor v5 업그레이드 등 주요 변경사항이 있었기 때문입니다. 이로 인해 타입 정의 누락, props 불일치, import 경로 오류 등의 TypeScript 컴파일 오류가 발생할 수 있습니다.

권장 방안:

  • GitHub issue #439(타입 동기화 요청)에서 @types 업데이트 진행 상황 확인
  • 단기: @ts-ignore 또는 type assertion으로 임시 대응
  • 장기: 공식 @types 업데이트 대기 또는 자체 타입 정의 고려

참고: react-syntax-highlighter/react-syntax-highlighter#439

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 48, The dependency
`@types/react-syntax-highlighter`@15.5.13 is incompatible with
react-syntax-highlighter@16.x; update package.json to resolve the mismatch by
either removing the outdated `@types` entry, upgrading/locking
react-syntax-highlighter to a compatible v15.x, or adding a temporary
override/resolution (or local d.ts) for `@types/react-syntax-highlighter` to avoid
TS errors; if you choose a short-term workaround, annotate problematic
imports/usages with // `@ts-ignore` or explicit type assertions until the official
`@types` (see issue `#439`) or an in-repo type definition replaces it—look for the
package name "react-syntax-highlighter" and "@types/react-syntax-highlighter" in
package.json to apply the change.

Comment thread src/pages/common/LandingPage.tsx Outdated
alt='로고'
className='w-full h-full transition-all duration-300'
/>
className={`relative w-100 flex-center transition-all duration-800 ${hover !== 'none' ? 'scale-115' : ''}`}>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Tailwind 설정에서 커스텀 duration, scale 값 확인

# tailwind.config 파일 찾기 및 내용 확인
fd -e js -e ts -e mjs -e cjs "tailwind.config" --exec cat {}

# CSS 파일에서 커스텀 테마 확인 (Tailwind v4 `@theme` 사용 시)
fd -e css -g "*.css" --exec grep -l "@theme" {} \; | head -5 | xargs -I {} sh -c 'echo "=== {} ===" && cat {}'

Repository: 2025-snowCode/snowCode-Client

Length of output: 2871


🏁 Script executed:

# Check the specific file and line mentioned in the review
cat -n src/pages/common/LandingPage.tsx | sed -n '60,70p'

Repository: 2025-snowCode/snowCode-Client

Length of output: 480


🏁 Script executed:

# Look for any tailwind.config.js, tailwind.config.ts, or tailwind.config.mjs files
fd -type f "tailwind.config" -o -name "tailwind.config.*"

Repository: 2025-snowCode/snowCode-Client

Length of output: 243


🏁 Script executed:

# Search for any custom duration or scale definitions in the codebase
rg "duration-|scale-" --type js --type ts --type css | head -30

Repository: 2025-snowCode/snowCode-Client

Length of output: 1522


🏁 Script executed:

# Check if there are any build files or output showing Tailwind class validation
fd "tailwind" --type f -x grep -l "duration-800\|scale-115" {}

Repository: 2025-snowCode/snowCode-Client

Length of output: 55


🏁 Script executed:

# Double-check if w-100 is a standard Tailwind width value by looking at usage patterns
rg "w-\[" --max-count 10

Repository: 2025-snowCode/snowCode-Client

Length of output: 1553


🏁 Script executed:

# Verify that w-100 appears elsewhere in the codebase (to understand if it's a pattern)
rg "w-100|h-150"

Repository: 2025-snowCode/snowCode-Client

Length of output: 461


Tailwind 임의 값(arbitrary value) 문법으로 수정하세요.

라인 65의 세 클래스가 모두 Tailwind CSS 기본 스케일에 포함되지 않는 값입니다:

  • w-100: 표준 너비 값이 아님
  • duration-800: 기본값은 75, 100, 150, 200, 300, 500, 700, 1000
  • scale-115: 기본값은 0, 50, 75, 90, 95, 100, 105, 110, 125, 150

프로젝트에 이 값들을 정의하지 않았으므로, Tailwind v4의 임의 값 문법을 사용해서 명시적으로 작성하세요:

수정 제안
- className={`relative w-100 flex-center transition-all duration-800 ${hover !== 'none' ? 'scale-115' : ''}`}
+ className={`relative w-[100px] flex-center transition-all duration-[800ms] ${hover !== 'none' ? 'scale-[1.15]' : ''}`}

참고: Tailwind CSS - Arbitrary values, Transition Duration

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
className={`relative w-100 flex-center transition-all duration-800 ${hover !== 'none' ? 'scale-115' : ''}`}>
className={`relative w-[100px] flex-center transition-all duration-[800ms] ${hover !== 'none' ? 'scale-[1.15]' : ''}`}>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/common/LandingPage.tsx` at line 65, The Tailwind classes in
LandingPage.tsx's className (`w-100`, `duration-800`, `scale-115`) are not in
the default scale—replace them with Tailwind arbitrary-value syntax: use
w-[100px] (or w-[100%] if you intended full width), duration-[800ms], and
scale-[1.15] in the className expression that builds the container (keep the
conditional on hover !== 'none' but switch the scale token to scale-[1.15]).

Comment on lines +84 to +99
{message.messageType === 'CODE' ? (
<div className='max-w-xs rounded-2xl overflow-hidden text-sm'>
<SyntaxHighlighter
style={oneDark}
PreTag='div'
language='python'
customStyle={{
margin: 0,
borderRadius: '1rem',
fontSize: '0.75rem',
padding: '0.75rem 1rem',
maxWidth: '100%',
overflowX: 'auto',
}}>
{message.content}
</SyntaxHighlighter>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether chat message model already has language metadata.
rg -n "messageTypeSchema|chatMessageSchema|language" src/entities/chat/model/schemas.ts src/entities/chat/model/useChatSocket.ts src/widgets/chat-message-panel/ui/ChatMessagePanel.tsx

Repository: 2025-snowCode/snowCode-Client

Length of output: 852


🏁 Script executed:

# Check the full chatMessageSchema structure
cat -n src/entities/chat/model/schemas.ts | head -70

Repository: 2025-snowCode/snowCode-Client

Length of output: 2416


🏁 Script executed:

# Search for any language detection or parsing logic in the codebase
rg -n "parseCodeBlock|language|markdown|fenced|code.*language" src/entities/ src/widgets/chat-message-panel/ -A 3

Repository: 2025-snowCode/snowCode-Client

Length of output: 1002


🏁 Script executed:

# Search for examples of CODE type messages or how they are formatted
rg -n "messageType.*CODE\|message.content\|CODE.*message" src/ -B 2 -A 2 | head -80

Repository: 2025-snowCode/snowCode-Client

Length of output: 55


🏁 Script executed:

# Check test files for message examples
fd -t f "\.test\.\|\.spec\." src/ | xargs rg -l "CODE\|SyntaxHighlighter" 2>/dev/null || echo "No test files found"

Repository: 2025-snowCode/snowCode-Client

Length of output: 92


🏁 Script executed:

# View the full ChatMessagePanel.tsx component to understand the message flow
wc -l src/widgets/chat-message-panel/ui/ChatMessagePanel.tsx

Repository: 2025-snowCode/snowCode-Client

Length of output: 131


🏁 Script executed:

# Check the content around the problematic code
sed -n '75,110p' src/widgets/chat-message-panel/ui/ChatMessagePanel.tsx

Repository: 2025-snowCode/snowCode-Client

Length of output: 1184


🏁 Script executed:

# Search for where CODE messages are created or sent
rg -n "messageType.*=.*CODE\|CODE.*message\|type.*CODE" src/ -B 3 -A 3 | head -100

Repository: 2025-snowCode/snowCode-Client

Length of output: 55


CODE 메시지 언어가 Python으로 고정되어 있어 다른 언어의 구문 강조가 정확하지 않습니다

현재 src/entities/chat/model/schemas.tschatMessageSchema에는 언어 정보 필드가 없으며, 라인 89에서 language='python'이 하드코딩되어 있습니다. 이로 인해 JavaScript, TypeScript, Java 등 다른 언어로 작성된 코드도 모두 Python 규칙으로 렌더링됩니다.

메시지 스키마에 언어 필드를 추가하거나, 최소한 마크다운 fenced code 형식(\``language)으로 감싸진 코드 블록을 파싱하는 폴백을 구현하세요. 그렇지 않으면 text`를 기본값으로 사용하는 것이 좋습니다.

관련 자료:

🔧 제안 패치 (fenced code 언어 폴백)
+function parseCodeBlock(content: string): {language: string; code: string} {
+  const match = content.match(/^```([\w+-]+)?\n([\s\S]*?)```$/);
+  if (!match) return {language: 'text', code: content};
+  return {
+    language: (match[1] || 'text').toLowerCase(),
+    code: match[2],
+  };
+}
+
 function MessageItem({
   message,
   isMine,
   isFirstInGroup,
   isLastInGroup,
   opponentId,
 }: MessageItemProps) {
+  const parsedCode =
+    message.messageType === 'CODE' ? parseCodeBlock(message.content) : null;
+
   return (
       {message.messageType === 'CODE' ? (
         <div className='max-w-xs rounded-2xl overflow-hidden text-sm'>
           <SyntaxHighlighter
             style={oneDark}
             PreTag='div'
-            language='python'
+            language={parsedCode?.language ?? 'text'}
             customStyle={{
               margin: 0,
               borderRadius: '1rem',
               fontSize: '0.75rem',
               padding: '0.75rem 1rem',
               maxWidth: '100%',
               overflowX: 'auto',
             }}>
-            {message.content}
+            {parsedCode?.code ?? message.content}
           </SyntaxHighlighter>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/widgets/chat-message-panel/ui/ChatMessagePanel.tsx` around lines 84 - 99,
The CODE branch hardcodes language='python' causing wrong highlighting; update
MessageItem in ChatMessagePanel.tsx to detect language from the message (either
add a language field to the chat message model or implement a parseCodeBlock
helper) and pass that into SyntaxHighlighter; specifically, add a
parseCodeBlock(content: string) function that extracts fenced-code language and
code (falling back to {language:'text', code: content}), compute parsedCode =
message.messageType === 'CODE' ? parseCodeBlock(message.content) : null, then
change SyntaxHighlighter props to language={parsedCode?.language ?? 'text'} and
render parsedCode?.code ?? message.content instead of the hardcoded 'python' and
message.content.

@suminb99 suminb99 merged commit 504216a into develop Mar 27, 2026
5 checks passed
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.

1 participant