Skip to content

feat: 컴포넌트 문서 페이지 공통 레이아웃 구현 - #109

Open
hyoseong1994 wants to merge 5 commits into
mainfrom
22-docs-layout
Open

feat: 컴포넌트 문서 페이지 공통 레이아웃 구현#109
hyoseong1994 wants to merge 5 commits into
mainfrom
22-docs-layout

Conversation

@hyoseong1994

@hyoseong1994 hyoseong1994 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

DS-04 시안을 기반으로 컴포넌트 문서 페이지의 공통 레이아웃 골격을 구현했습니다. 모든 문서 페이지가 동일한 3단 레이아웃(사이드바 · 본문 · 목차)을 공유하도록, 페이지마다 레이아웃을 반복 구현하지 않게 했습니다.

본문 콘텐츠(Props 표 · 라이브 데모 · 사용 가이드 등)는 플레이스홀더로 두었고, 실제 콘텐츠는 children 슬롯으로 주입하는 후속 작업에서 채웁니다.

테스팅

  • docsNav, DocsToc, useActiveTocId, useHashFocus, useMediaQuery, scrollSmoothly 단위 테스트 추가 — vitest 전체 통과
  • Preview URL에서 데스크톱 / 태블릿 / 모바일 폭별 레이아웃, 사이드바 아코디언, 검색, 목차 활성 항목, 이전/다음 이동 확인

체크 리스트

  • 코드 리뷰를 요청하기 전에 반드시 CI가 통과하는지 확인해주세요.
  • Cloudflare Preview URL에서 수정한 내용이 의도대로 잘 동작하는지 확인해 주세요.

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Ready
View logs
daleui 82803a6 Commit Preview URL Jul 29 2026, 05:34 AM

Highlight the toc entry matching the scroll position, scroll smoothly to
the clicked entry and move focus to its heading.

The active item is computed from heading positions instead of
IntersectionObserver, because sections taller than the viewport leave
gaps where no heading intersects. Positions are read once per frame and
cached so React's snapshot checks do not force synchronous layout.

Anchor scrolling is performed by react-router's ScrollRestoration after
commit, so scroll-behavior stays smooth until the scroll settles. While
it settles the destination stays highlighted instead of sweeping through
the sections in between.
@hyoseong1994
hyoseong1994 marked this pull request as ready for review July 29, 2026 06:19
@hyoseong1994
hyoseong1994 requested a review from a team as a code owner July 29, 2026 06:19

@SimYunSup SimYunSup left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

고생하셨습니다!

const [pinnedTocId, setPinnedTocId] = useState<string>();
const closeDrawer = () => setIsDrawerOpen(false);
const styles = docsLayout();
const isTocVisible = useMediaQuery(TOC_MEDIA_QUERY);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

별로 필요없는 코드라고 생각됩니다.
이유: 모바일에서의 계산하지 않는 것이 주 요인인데 과도한 측정이라고 생각됩니다.

Comment thread src/hooks/useHashFocus.ts
}
}

/** 해시가 가리키는 요소로 포커스를 옮겨, 다음 Tab이 링크 목록에 머물지 않게 합니다. */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

native hash를 사용하지 않는 이유라도 있을까요?

Comment on lines +82 to +92
{isDrawerOpen && (
<Box className={styles.drawerRoot} onClick={closeDrawer}>
<Box className={styles.drawerScrim} />
<Box
as="aside"
role="dialog"
aria-modal="true"
aria-label="문서 목차"
onClick={(event) => event.stopPropagation()}
className={styles.drawer}
>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

drawer open 되면 본 내용이 스크롤 안되게 해야 할 것 같습니다.


describe("DOCS_SEARCH_INDEX", () => {
it("모든 문서에 카테고리를 채운다", () => {
expect(DOCS_SEARCH_INDEX).toHaveLength(DOCS_FLAT_ITEMS.length);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

무조건 참인 것 같습니다.

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.

컴포넌트 문서 페이지 레이아웃 구현 (DS-04 시안 기반)

2 participants