Skip to content

데스크톱 좌측 내비게이션 햄버거 토글 추가 - #68

Merged
hellices merged 5 commits into
mainfrom
codex/closes-hellices-devguidesample-67
Sep 14, 2026
Merged

hellices merged 5 commits into
mainfrom
codex/closes-hellices-devguidesample-67

Conversation

@Codex

@Codex Codex AI commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

변경 내용

GitHub Pages 좌측 메뉴를 데스크톱에서 접기/펼치기 할 수 없던 문제를 해결했습니다. 기존 모바일 drawer 동작은 유지하면서, 데스크톱에서만 헤더 햄버거로 좌측 내비게이션 표시를 제어하도록 변경했습니다.

  • 데스크톱 전용 토글 UI

    • 헤더에 .dg-sidebar-toggle 버튼을 주입하고 좌측 내비게이션 토글 동작을 연결했습니다.
    • mkdocs.yml의 extra_javascript에 assets/javascripts/sidebar-toggle.js를 추가했습니다.
  • 상태/접근성 처리

    • 접힘 상태를 <html data-dg-sidebar-collapsed="true|false">로 관리합니다.
    • aria-pressed, aria-label을 상태와 동기화해 스크린리더 의미를 유지합니다.
    • localStorage로 접힘 상태를 유지합니다.
  • 반응형 범위 고정

    • >=1220px에서만 토글 버튼을 표시하고 좌측 사이드바 숨김을 적용합니다.
    • <=1219px에서는 토글 버튼을 강제로 숨겨 모바일 네비게이션과 충돌하지 않도록 했습니다.
function applyState(root, button, storage, collapsed) {
  root.dataset.dgSidebarCollapsed = collapsed ? "true" : "false";
  button.setAttribute("aria-pressed", collapsed ? "true" : "false");
  button.setAttribute("aria-label", collapsed ? "왼쪽 메뉴 펼치기" : "왼쪽 메뉴 접기");
  storage?.setItem("dg-sidebar-collapsed", collapsed ? "true" : "false");
}

공개 문서 체크리스트

  • 사례·가이드·실습·리서치 중 올바른 문서 유형과 폴더를 선택했습니다. (해당 없음: 문서 본문 변경 없음)
  • 필수 front matter와 docs-taxonomy.yml의 분류 값을 사용했습니다. (해당 없음: 문서 메타데이터 변경 없음)
  • Microsoft/Azure 기술 주장을 Microsoft Learn MCP와 verify-with-microsoft-learn skill로 원문까지 확인했습니다. (해당 없음: 기술 주장 변경 없음)
  • 실제 구독·테넌트 ID, 비밀, 내부 URL·IP·호스트명 등 공개 안전성 문제를 제거했습니다.
  • 필요한 경우 현재 가이드와 시점 고정 사례를 분리하고 서로 연결했습니다. (해당 없음: 문서 수명주기 변경 없음)
  • 아래 로컬 검증을 통과했습니다.
python -m pytest tests/docs -q
python scripts/docs/validate_metadata.py
python scripts/docs/validate_sources.py
python scripts/docs/validate_links.py
python scripts/docs/validate_public_safety.py
mkdocs build --strict
python scripts/docs/validate_search_index.py

@Codex Codex AI assigned Codex and hellices Sep 14, 2026
@Codex Codex AI linked an issue Sep 14, 2026 that may be closed by this pull request
Codex AI and others added 2 commits September 14, 2026 02:03
Co-authored-by: hellices <5661904+hellices@users.noreply.github.com>
Co-authored-by: hellices <5661904+hellices@users.noreply.github.com>
@Codex Codex AI changed the title [WIP] Add toggle functionality for hamburger menu 데스크톱 좌측 내비게이션 햄버거 토글 추가 Sep 14, 2026
@Codex
Codex AI requested a review from hellices September 14, 2026 02:07
@hellices
hellices requested a balanced review from Copilot September 14, 2026 02:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Storage 오류 처리, ARIA 의미, CI 테스트 연결 문제를 해결해야 합니다.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

데스크톱에서 좌측 내비게이션을 접고 상태를 유지하는 토글 기능을 추가합니다.

Changes:

  • 반응형 토글 UI와 접힘 스타일 추가
  • 접근성 상태 및 localStorage 동기화 구현
  • Node 기반 동작 테스트 추가
File summaries
File Description
mkdocs.yml 토글 스크립트 등록
docs/assets/stylesheets/extra.css 데스크톱 전용 토글·접힘 스타일
docs/assets/javascripts/sidebar-toggle.js 토글 상태와 저장소 처리
tests/docs/sidebar-toggle.test.cjs 토글 동작 단위 테스트
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +27 to +28
button.setAttribute("aria-pressed", collapsed ? "true" : "false");
button.setAttribute("aria-label", collapsed ? "왼쪽 메뉴 펼치기" : "왼쪽 메뉴 접기");
const mediaQuery = typeof windowRef.matchMedia === "function"
? windowRef.matchMedia(desktopQuery)
: null;
const storage = windowRef.localStorage || null;
@@ -0,0 +1,126 @@
const test = require("node:test");
@hellices

Copy link
Copy Markdown
Owner

@codex[agent] 리뷰 확인해서 수정

Co-authored-by: hellices <5661904+hellices@users.noreply.github.com>
@Codex

Codex AI commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@codex[agent] 리뷰 확인해서 수정

리뷰 지적 사항을 반영했습니다. aria-expanded 기반 토글로 수정하고, localStorage 접근 예외를 방어했으며, sidebar Node 테스트를 pytest 경로에 연결했습니다. 반영 커밋: a96ef2f

@hellices

Copy link
Copy Markdown
Owner

@codex[agent] 그런데 테스트 코드가 이렇게 계속 늘어나는게 맞나? 전체 테스트 코드는 진짜로 필요한 부분만 넣어줘야해. 여기는 문서 레포인데 테스트코드가 늘어나서는 별로 도움이 안돼

Co-authored-by: hellices <5661904+hellices@users.noreply.github.com>
@Codex

Codex AI commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

@codex[agent] 그런데 테스트 코드가 이렇게 계속 늘어나는게 맞나? 전체 테스트 코드는 진짜로 필요한 부분만 넣어줘야해. 여기는 문서 레포인데 테...

불필요하게 늘어난 테스트를 줄였습니다. 별도 pytest 브리지 파일은 삭제하고 기존 JS 테스트 브리지에 통합했으며, sidebar 테스트는 리뷰 지적을 검증하는 핵심 3개 케이스만 남겼습니다. 반영 커밋: a0746a8

@hellices
hellices marked this pull request as ready for review September 14, 2026 05:14
@hellices
hellices merged commit dffa720 into main Sep 14, 2026
1 check 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.

햄버거 메뉴 접기/펼치기 기

3 participants