-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(view): fix verticalClusterList issues and refactor detail component #154
Conversation
<div className="divider" /> | ||
<div className="text"> | ||
<strong>{authorLength}</strong> authors |{" "} | ||
<strong>{commitLength}</strong> commits | <strong>{fileLength}</strong>{" "} | ||
changed files | <strong className="insertions">{insertions}</strong>{" "} | ||
additions and <strong className="deletions">{deletions}</strong>{" "} | ||
deletions codes | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 완전 깔끔해져서 보기 좋아요~👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와 리뷰 엄청 빠르시네요...
} | ||
} | ||
|
||
.detail-commit_item_container { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 이부분 비롯해 전반적인 class 네이밍 .detial-commit__item-container
와 같이 바꿔주실 수 있으신가요?
제가 수정했는데 변경 사항이 많다보니 영후님이 먼저 반영해주시는 게 좋을 것 같습니다~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BEM 룰 때문일까요 @__@?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵~!
export const useResizeObserver = ( | ||
ref: RefObject<HTMLDivElement>, | ||
selectedData: SelectedDataProps | ||
) => { | ||
const [height, setHeight] = useState(0); | ||
|
||
useEffect(() => { | ||
let RO: ResizeObserver | null = new ResizeObserver((entries) => { | ||
if (!Array.isArray(entries)) { | ||
return; | ||
} | ||
const { contentRect } = entries[0]; | ||
setHeight(contentRect.height); | ||
}); | ||
|
||
if (ref.current) { | ||
RO.observe(ref.current); | ||
} | ||
|
||
return () => { | ||
if (RO) { | ||
RO.disconnect(); | ||
RO = null; | ||
} | ||
}; | ||
}, [ref.current, selectedData]); | ||
|
||
return [height]; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍👍👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와 이 부분 하셨군요 ! 감사합니다 ㅎㅎ
와 사진 추가해주신 거 뒤늦게 보았는데 2,4,5 부분 정말 좋네요~~👍👍👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제 부분은 제대로 합쳐진 것 같습니다 ! 고생하셨습니다 !! LGTM ㅎㅎ
export const useResizeObserver = ( | ||
ref: RefObject<HTMLDivElement>, | ||
selectedData: SelectedDataProps | ||
) => { | ||
const [height, setHeight] = useState(0); | ||
|
||
useEffect(() => { | ||
let RO: ResizeObserver | null = new ResizeObserver((entries) => { | ||
if (!Array.isArray(entries)) { | ||
return; | ||
} | ||
const { contentRect } = entries[0]; | ||
setHeight(contentRect.height); | ||
}); | ||
|
||
if (ref.current) { | ||
RO.observe(ref.current); | ||
} | ||
|
||
return () => { | ||
if (RO) { | ||
RO.disconnect(); | ||
RO = null; | ||
} | ||
}; | ||
}, [ref.current, selectedData]); | ||
|
||
return [height]; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와 이 부분 하셨군요 ! 감사합니다 ㅎㅎ
color: $white; | ||
} | ||
|
||
.summary:hover { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 이 부분 summary 안으로 &:hover 이렇게 넣어주실 수 있으실까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jejecrunch 저거 제가 안에 넣어서 하려고 했는데, SUMMARY 의 자식 요소들 각각만 파란색으로 배경색이 보이더라고요. summary 리스트 아이템 각각이 파란색 배경으로 보이는게 아니라요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다 ! 감사합니다 ㅎㅎ
CI 오류 해결하시고 기한님도 확인해주시면 바로 합쳐도 괜찮을 것 같습니다 ! detail hook에서 에러 나는 것 같습니다 ㅜㅜ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AS-IS | TO-BE |
---|---|
![]() |
![]() |
ClusterGraph에 가변 길이를 적용함에 따라 발생하는 transition 문제가 존재합니다. Detail 컴포넌트를 summary_detail_container(이하 container) 로만 감싸게 되면, container는 transition이 발생하는 element이기 때문에 height 가 transition이 시작될 때 height가 가변적으로 변경됩니다. 이 때, resizeObserver는 애니메이션이 발생하는 element를 height가 바뀔 때마다 감지하게 되고, 그 결과로 위의 AS-IS와 같은 Graph의 떨림이 발생합니다. 그렇기 때문에 container와 Detail 컴포넌트 사이에 height 값이 변경되지 않는(애니메이션이 없는) div 태그를 추가하여 resizeObserver가 단 한 번만 height의 변경을 감지할 수 있도록 수정해야할 것 같습니다. 영후님 PR 머지해주시면 제가 후속 작업 이어서 진행해보도록 하겠습니다 ! 리뷰 부분은 지금 반영하지 않으셔도 됩니다 :)
</button> | ||
{cluster.clusterId === clusterIds && ( | ||
<div className="summary_detail_container" ref={ref}> | ||
<Detail selectedData={selectedData} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기서 div 태그와 Detail 태그 사이에 div 태그를 하나 추가하여 transition이 발생하지 않는 태그에 ref를 걸어야 transition이 그나마 나아질 것 같습니다 ..! (자세한 내용은 코멘트를 참조해주세요)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
또한, 사이에 추가되는 div 태그에 max-height: 280px을 걸어줘야 280px 이상으로 graph가 늘어나는 상황이 발생하지 않겠습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 구현에서 놓친 부분인 것 같습니다. 리뷰 감사드립니당. ㅠㅠ
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
margin-top: 14px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분 margin-top에서 padding-top으로 바꿔야 아래에서 언급한 div 태그와 Detail 태그 사이에 들어가는 div 태그가 밀리지 않습니다 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추후 반영하도록 하겠습니다. 감사합니당!
이 부분 머지해주시면 제가 수정해 올리겠습니다~! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와우!! 엄청 디테일이 좋아지는 것 같습니다.
덧: commit id (hash)는 6자리면 충분할 것 같아요!
와,, 정말 많이 배우고 갑니다.. 훌륭하세요 !!! |
build 에러 수정해 올려놓았습니다(a0f597c) |
Related Issue
📌 Key Changes
1. 시간을 보여주기 위한 함수 및 폴더 추가(08d5bd7)
2. detail 컴포넌트 추가적인 정보 추가(919a030)
3. collapsible 을 판단할 수 있는 마커 추가 (bde9696)
4. authors, commits, changed files, changed line of codes에 대한 정보 간략화 (4ad24a4)
5. 가시성 향상 (5907153)
6. Detail 컴포넌트 고정된 높이에서 가변 높이로 변경 (7271096)
📌 To Reviwers