-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor/#002 리스트 가상화 #15
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
Merged
The head ref may contain hidden characters: "refactor/#002-\uB9AC\uC2A4\uD2B8-\uAC00\uC0C1\uD654"
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
67c0f71
chore: react-virtual 라이브러리 설치
pipisebastian e8e241d
refactor: 블럭 선택 로직 수정
pipisebastian 176c954
refactor: 필요없는 css 제거
pipisebastian ff1d422
feat: 리스트 가상화 적용
pipisebastian 6917fe1
feat: setCaretPosition 함수 안쓰는 linkedList 제거
pipisebastian d651fde
Merge branch 'dev' of https://github.com/boostcampwm-2024/refactor-we…
pipisebastian 2c87c69
refactor: 사용하지 않는 import 제거
pipisebastian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,9 @@ import { | |
| } from "./Block.style"; | ||
|
|
||
| interface BlockProps { | ||
| virtualIndex: number; | ||
| virtualStart: number; | ||
| virtualRef: (node: Element | null | undefined) => void; | ||
| testKey: string; | ||
| id: string; | ||
| block: CRDTBlock; | ||
|
|
@@ -71,6 +74,9 @@ interface BlockProps { | |
| } | ||
| export const Block: React.FC<BlockProps> = memo( | ||
| ({ | ||
| virtualIndex, | ||
| virtualRef, | ||
| virtualStart, | ||
| testKey, | ||
| id, | ||
| block, | ||
|
|
@@ -280,7 +286,6 @@ export const Block: React.FC<BlockProps> = memo( | |
|
|
||
| useEffect(() => { | ||
| if (blockRef.current) { | ||
| console.log(block.crdt.serialize()); | ||
| setInnerHTML({ element: blockRef.current, block }); | ||
| } | ||
| }, [getTextAndStylesHash(block)]); | ||
|
|
@@ -296,7 +301,20 @@ export const Block: React.FC<BlockProps> = memo( | |
| return ( | ||
| // TODO: eslint 규칙을 수정해야 할까? | ||
| // TODO: ol일때 index 순서 처리 | ||
| <div data-testid={testKey} style={{ position: "relative" }}> | ||
| <div | ||
| data-testid={testKey} | ||
| data-id={id} | ||
| data-index={virtualIndex} | ||
| key={virtualIndex} | ||
| ref={virtualRef} | ||
| style={{ | ||
| position: "absolute", | ||
| top: 0, | ||
| left: 0, | ||
| width: "100%", | ||
| transform: `translateY(${virtualStart}px)`, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 해당 start를 통해 어디에 위치시킬지 보여줍니다! |
||
| }} | ||
| > | ||
| {showTopIndicator && <Indicator />} | ||
| <motion.div | ||
| ref={setNodeRef} | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
data-id는 caretUtil에서 특정 block을 찾기위해 넣어줬습니다.
data-index는 tanstack virtual 라이브러리에서 data-index를 기준으로 요소를 찾더라구요! 그래서 무조건 필요한 값입니다
key도 tanstack virtual 라이브러리에서 필요한 값입니다!