Skip to content

refactor: 1주차 추가 QA#235

Merged
ljh130334 merged 3 commits into
developfrom
qa/jihyeon
Sep 8, 2025
Merged

refactor: 1주차 추가 QA#235
ljh130334 merged 3 commits into
developfrom
qa/jihyeon

Conversation

@ljh130334
Copy link
Copy Markdown
Member

@ljh130334 ljh130334 commented Sep 7, 2025

#️⃣연관된 이슈

#229

📝작업 내용

기록장에서 발생하는 두 가지 사용자 경험 문제를 해결했습니다.

1. 투표 버튼 클릭 시 더보기 메뉴가 열리는 문제 수정
투표 기록에서 투표 옵션을 클릭할 때 이벤트 버블링으로 인해 상위 컨테이너의 클릭 이벤트가 함께 발생하여 더보기 메뉴가 의도치 않게 열리는 문제가 있었습니다. PollRecord 컴포넌트의 handleOptionClick 핸들러에 e.stopPropagation()을 추가하여 이벤트 전파를 차단했습니다.

2. 블라인드 처리된 기록에서 클릭 이벤트가 뒤의 버튼들로 전달되는 문제 수정
블라인드 처리된 기록의 블러 영역을 클릭했을 때, CSS blur 효과만 적용되고 실제 클릭 이벤트는 막히지 않아서 뒤쪽에 있는 좋아요, 댓글, 핀하기 버튼들이 의도치 않게 동작하는 문제가 있었습니다. 이를 해결하기 위해 블라인드 상태일 때 전체 컨테이너 위에 투명한 오버레이를 추가하고, 해당 오버레이에서 클릭 이벤트를 stopPropagation()으로 차단하도록 구현했습니다. 또한 RecordItem 컨테이너의 handleClick 함수에서도 블라인드 상태일 때는 더보기 메뉴가 열리지 않도록 추가 보완했습니다.

3. 기록 작성 페이지의 페이지 입력 필드 길이 개선

Summary by CodeRabbit

  • Bug Fixes
    • 흐림(블러) 상태의 항목에서 클릭이 동작하지 않도록 오버레이로 차단하고 이벤트 전파를 막았습니다.
    • 투표 옵션 클릭 처리 안정성을 높여 의도치 않은 상호작용을 방지했습니다.
    • 흐림 상태에서 좋아요/댓글/고정 등 액션 버튼이 비활성화되도록 정교화했습니다.
  • Style
    • 시각적 블러 대신 오버레이로 상호작용을 제어해 일관성을 개선했습니다.
    • 페이지 범위 입력 필드 폭 계산을 미세 조정해 가독성을 향상했습니다.

@ljh130334 ljh130334 self-assigned this Sep 7, 2025
@ljh130334 ljh130334 added the 🐞 BugFix Something isn't working label Sep 7, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Sep 7, 2025

Walkthrough

PollRecord option click handlers now receive and stop the mouse event. RecordItem introduces a relative container and an overlay to block interactions when shouldBlur is true, removing pointer-events styling from CSS. Clicks on blurred items stop propagation. PageRangeSection input width calc slightly adjusted.

Changes

Cohort / File(s) Summary
RecordItem 인터랙션/오버레이
src/components/memory/RecordItem/RecordItem.tsx, src/components/memory/RecordItem/RecordItem.styled.ts
Container에 position: relative 추가. shouldBlur 시 전체를 덮는 overlay div로 클릭 차단 및 이벤트 stopPropagation. 기존 CSS의 pointer-events 제어 제거. 핸들러들은 shouldBlur 조건에 따라 비활성 처리.
PollRecord 옵션 클릭 처리
src/components/memory/RecordItem/PollRecord.tsx
handleOptionClick에 MouseEvent 인자 추가 및 e.stopPropagation 호출. 옵션 onClick을 (e) => handleOptionClick(e, option)으로 수정. 나머지 투표 로직은 동일.
PageRange 입력 폭 조정
src/components/recordwrite/PageRangeSection.styled.ts
PageInput width 계산식에서 inputLength 계수 8→9로 변경. 기본/기타 스타일은 동일.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant RI as RecordItem
  participant OV as Overlay (shouldBlur)
  participant AC as Actions (like/comment/pin)

  U->>RI: Click on item
  alt shouldBlur = true
    RI->>OV: Render overlay (abs, zIndex 10)
    U-->>OV: Click
    OV-->>RI: stopPropagation()
    note over OV,RI: 아래 컴포넌트로 이벤트 전파 차단
  else shouldBlur = false
    RI-->>RI: handleClick(e)
    RI->>AC: Trigger actions/menus
  end
Loading
sequenceDiagram
  autonumber
  actor U as User
  participant PR as PollRecord
  participant OP as Option Button

  U->>OP: Click option
  OP->>PR: handleOptionClick(e, option)
  PR-->>PR: e.stopPropagation()
  PR->>PR: Guard checks (alreadyVoted, updating, etc.)
  PR->>PR: Proceed with vote update (unchanged flow)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • ho0010

Poem

살포시 덮는 덮개, 블러의 은빛 장막
클릭은 멈추고, 토끼는 깡총깡총 락
투표는 조용히, 이벤트는 고요히
살짝 더 넓어진 페이지의 숨결이
코드엔 발자국, 리뷰엔 당근 한 봉지 🥕

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch qa/jihyeon

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.

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 7, 2025

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

Project Deployment Preview Comments Updated (UTC)
thip Ready Ready Preview Comment Sep 7, 2025 2:34pm

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: 0

🧹 Nitpick comments (6)
src/components/recordwrite/PageRangeSection.styled.ts (1)

55-56: 입력 시작 시 폭이 placeholder(12px)보다 줄어드는 레이아웃 시프트 발생 가능

inputLength가 1일 때 9px로 줄어 placeholder 12px 대비 시프트가 생깁니다. 최소값을 12로 맞춰주세요.

-    return `${Math.max(9, props.inputLength * 9)}px`;
+    return `${Math.max(12, props.inputLength * 9)}px`;
src/components/memory/RecordItem/PollRecord.tsx (2)

1-1: React 네임스페이스 의존 제거: 이벤트 타입은 명시 import 권장

빌드 설정에 따라 React 네임스페이스 타입 참조가 실패할 수 있습니다. MouseEvent 타입을 명시 import로 전환해 주세요.

-import { useState, useEffect, useRef } from 'react';
+import { useState, useEffect, useRef } from 'react';
+import type { MouseEvent } from 'react';
@@
-  const handleOptionClick = async (e: React.MouseEvent, option: PollOption) => {
+  const handleOptionClick = async (e: MouseEvent, option: PollOption) => {

Also applies to: 70-72


156-161: 중복 방어 로직 정리: overlay + stopPropagation이 있으므로 pointerEvents 강제는 생략 가능

shouldBlur일 때 onClick을 끄고, 상위에서 오버레이가 클릭을 차단하므로 pointerEvents까지 막을 필요는 없어 보입니다. 스타일 간소화로 유지보수성을 높여주세요.

-            style={{ 
-              cursor: shouldBlur ? 'default' : (isVoting ? 'not-allowed' : 'pointer'),
-              opacity: shouldBlur ? 1 : (isVoting ? 0.7 : 1),
-              pointerEvents: shouldBlur ? 'none' : 'auto'
-            }}
+            style={{
+              cursor: shouldBlur ? 'default' : (isVoting ? 'not-allowed' : 'pointer'),
+              opacity: shouldBlur ? 1 : (isVoting ? 0.7 : 1),
+            }}
src/components/memory/RecordItem/RecordItem.tsx (3)

269-275: 블라인드 차단 로직 적절 + 이벤트 타입 import 권장

버블 차단으로 더보기 메뉴 오작동을 막는 방향 좋습니다. 이벤트 타입은 명시 import로 교체해 빌드 환경 의존을 줄이세요.

-import { useState, useCallback } from 'react';
+import { useState, useCallback } from 'react';
+import type { MouseEvent } from 'react';
@@
-  const handleClick = useCallback((e: React.MouseEvent) => {
+  const handleClick = useCallback((e: MouseEvent) => {

312-316: position 중복 선언 제거

Container.styled에서 이미 position: relative를 설정했습니다. inline 스타일의 중복 선언은 제거하는 편이 명확합니다.

-      style={{
-        cursor: 'pointer',
-        position: 'relative',
-      }}
+      style={{
+        cursor: 'pointer',
+      }}

318-333: 오버레이에서 클릭 외 입력도 차단

모바일/데스크톱에서 mousedown/touchstart가 선행될 수 있어 같이 막아두면 안전합니다. 테스트 편의상 data-testid도 부여를 권장합니다.

         <div
           style={{
             position: 'absolute',
             top: 0,
             left: 0,
             right: 0,
             bottom: 0,
             zIndex: 10,
             cursor: 'default',
           }}
-          onClick={(e) => {
+          data-testid="blind-overlay"
+          onClick={(e) => {
             e.stopPropagation();
           }}
+          onMouseDown={(e) => e.stopPropagation()}
+          onTouchStart={(e) => e.stopPropagation()}
         />
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between cae0452 and e0710f2.

📒 Files selected for processing (4)
  • src/components/memory/RecordItem/PollRecord.tsx (2 hunks)
  • src/components/memory/RecordItem/RecordItem.styled.ts (1 hunks)
  • src/components/memory/RecordItem/RecordItem.tsx (2 hunks)
  • src/components/recordwrite/PageRangeSection.styled.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/components/memory/RecordItem/PollRecord.tsx (2)
src/types/memory.ts (1)
  • PollOption (81-88)
src/components/memory/RecordItem/PollRecord.styled.ts (1)
  • PollOption (23-32)
🔇 Additional comments (1)
src/components/memory/RecordItem/RecordItem.styled.ts (1)

8-9: overlay 포지셔닝을 위한 position: relative 추가, 적절합니다

오버레이 절대배치를 위한 상대 기준이 생겨 의도대로 동작할 것입니다. 추가로, Container에 filter가 적용되어 자식(오버레이 포함)도 블러링되는 점은 의도인지 한번 확인 부탁드립니다. 의도와 다르면 블러를 콘텐츠 래퍼로 이동하는 방식을 고려해 주세요.

Copy link
Copy Markdown
Collaborator

@heeeeyong heeeeyong left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~!!

@ljh130334 ljh130334 merged commit 03812ff into develop Sep 8, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 BugFix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants