Skip to content

feat: 도서관 좌석 현황 확인 및 예약 바로가기#60

Merged
Turtle-Hwan merged 11 commits intoTurtle-Hwan:mainfrom
nahyeongjin1:feat/library-seats-info
Jan 21, 2026
Merged

feat: 도서관 좌석 현황 확인 및 예약 바로가기#60
Turtle-Hwan merged 11 commits intoTurtle-Hwan:mainfrom
nahyeongjin1:feat/library-seats-info

Conversation

@nahyeongjin1
Copy link
Copy Markdown
Contributor

Summary

Test plan

  • eCampus 로그인 정보 등록 후 좌석 현황이 표시되는지 확인
  • 열람실 클릭 시 예약 페이지로 이동하는지 확인
  • 새로고침 버튼 동작 확인

Known Limitations

  • 도서관 웹사이트 자동 로그인은 SPA 인증 구조로 인해 지원하지 않음 (아마도...?)
  • 예약 페이지에서 사용자가 직접 로그인 필요

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @nahyeongjin1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 사용자가 건국대학교 도서관 열람실의 실시간 좌석 현황을 편리하게 확인할 수 있도록 새로운 기능을 도입합니다. 기존 eCampus 로그인 정보를 활용하여 도서관 시스템에 자동으로 인증하고, 웹사이트에서 예약 페이지로 바로 이동할 수 있는 기능을 제공하여 사용자 편의성을 높였습니다. 이를 통해 사용자는 별도의 로그인 과정 없이 빠르게 도서관 좌석 정보를 확인하고 예약할 수 있습니다.

Highlights

  • 도서관 좌석 현황 기능 추가: 실험실(Labs) 기능에 건국대학교 도서관 열람실의 실시간 좌석 현황을 조회할 수 있는 기능이 추가되었습니다.
  • 예약 페이지 바로가기: 각 열람실의 좌석 현황을 클릭하면 해당 열람실의 예약 페이지로 바로 이동할 수 있습니다.
  • eCampus 로그인 정보 활용: 사용자가 저장한 eCampus 로그인 정보를 활용하여 도서관 시스템에 자동으로 인증하고, 웹사이트에서도 로그인 상태가 유지되도록 쿠키를 설정합니다.
  • 크롬 확장 프로그램 권한 업데이트: 도서관 시스템과의 연동을 위해 cookies 권한과 library.konkuk.ac.kr 호스트 권한이 manifest.json에 추가되었습니다.
  • 도서관 API 통합 모듈 구현: 도서관 로그인, 좌석 현황 조회, 쿠키 관리 등을 위한 새로운 API 연동 함수들이 src/apis/external/library.ts 파일에 구현되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 도서관 열람실 좌석 현황 조회 및 예약 바로가기 기능을 추가하는군요. 전반적으로 기능 구현이 잘 이루어졌습니다. manifest.json에 필요한 권한을 추가하고, 도서관 API와 연동하기 위한 로직을 src/apis/external/library.ts에 잘 분리하셨습니다. 또한, LibrarySeatSection 컴포넌트를 통해 UI에 상태를 잘 표시하고 있습니다. 몇 가지 코드 개선 사항을 제안드립니다. API 연동 부분의 하드코딩된 값과 중복 코드, 그리고 디버깅용 로그에 대한 수정이 필요해 보입니다. 자세한 내용은 각 파일의 주석을 확인해주세요.

Comment thread src/apis/external/library.ts Outdated
Comment thread src/apis/external/library.ts Outdated
Comment thread src/apis/external/library.ts Outdated
Comment thread src/components/Labs/LibrarySeatSection.tsx Outdated
- Extract magic numbers to named constants (COOKIE_IS_PASSWORD_EXPIRED, COOKIE_CHECKSUM)
- Simplify response handling with early return pattern
- Remove debug console.log statements
- Fix redundant setIsLoading call in LibrarySeatSection
Copy link
Copy Markdown
Owner

@Turtle-Hwan Turtle-Hwan left a comment

Choose a reason for hiding this comment

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

와아 귀한 기능 기여 감사해요~!
저도 추가하고 싶었는데 시간이 없었는데 잘 해주셨네요!

@nahyeongjin1 몇 가지 수정 사항 남겨두었는데 확인 부탁드려요~

Comment thread public/manifest.json Outdated
Comment thread src/apis/external/library.ts Outdated
Comment thread src/components/Labs/LibrarySeatSection.tsx Outdated
@nahyeongjin1
Copy link
Copy Markdown
Contributor Author

nahyeongjin1 commented Jan 21, 2026

자동 로그인 시도 히스토리 정리:

  1. 초기 접근: Background Script에서 직접 처리
  • chrome.scripting.executeScript로 도서관 페이지에 스크립트 주입 시도
  • 문제: 일반 world에서는 페이지의 앱 컨텍스트에 접근 불가
  1. Page Context에서 실행 (world: "MAIN")
  • world: "MAIN" 옵션으로 페이지 컨텍스트에서 직접 로그인 API 호출
  • 결과: API 로그인 성공 ("로그인되었습니다.")
  1. 쿠키 & localStorage 설정
  • chrome.cookies.set()으로 KONKUK_PYXIS3 쿠키 설정
  • localStorage.setItem()으로 isAuthenticated: true 설정
  • 결과: 둘 다 설정 성공 확인 (alert로 검증)
  1. 페이지 리로드 후 이동
  • 로그인 후 location.reload()로 SPA가 인증 상태 인식하게 시도
  • 리로드 완료 후 예약 페이지로 location.href 이동
  • 결과: 여전히 로그인 페이지로 리다이렉트

실패 원인 분석 (아마도)

SPA의 인증은 클라이언트(쿠키/localStorage) + 서버 세션 조합으로 동작.
클라이언트에서 쿠키를 설정해도 서버 측 세션이 해당 브라우저 탭과 연결되지 않아 인증 실패.

@Turtle-Hwan
Copy link
Copy Markdown
Owner

자동 로그인 시도 히스토리 정리:

  1. 초기 접근: Background Script에서 직접 처리
  • chrome.scripting.executeScript로 도서관 페이지에 스크립트 주입 시도
  • 문제: 일반 world에서는 페이지의 앱 컨텍스트에 접근 불가
  1. Page Context에서 실행 (world: "MAIN")
  • world: "MAIN" 옵션으로 페이지 컨텍스트에서 직접 로그인 API 호출
  • 결과: API 로그인 성공 ("로그인되었습니다.")
  1. 쿠키 & localStorage 설정
  • chrome.cookies.set()으로 KONKUK_PYXIS3 쿠키 설정
  • localStorage.setItem()으로 isAuthenticated: true 설정
  • 결과: 둘 다 설정 성공 확인 (alert로 검증)
  1. 페이지 리로드 후 이동
  • 로그인 후 location.reload()로 SPA가 인증 상태 인식하게 시도
  • 리로드 완료 후 예약 페이지로 location.href 이동
  • 결과: 여전히 로그인 페이지로 리다이렉트

실패 원인 분석 (아마도)

SPA의 인증은 클라이언트(쿠키/localStorage) + 서버 세션 조합으로 동작.
클라이언트에서 쿠키를 설정해도 서버 측 세션이 해당 브라우저 탭과 연결되지 않아 인증 실패.

추측이지만 chrome.cookies 로 설정했을 때의 origin(크롬 확장)과 실제 사이트에서 받은 쿠키의 origin이 달라서일수도 있을 거 같아요

service worker에서 하거나 실제로 탭을 잠깐 켰다가 로그인 관련 요청만 보내고 탭 끄는 방식도 전에 고민은 해봤었네요.

Copy link
Copy Markdown
Owner

@Turtle-Hwan Turtle-Hwan left a comment

Choose a reason for hiding this comment

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

깔끔하네요 수정까지 고생하셨습니다!!

@Turtle-Hwan Turtle-Hwan merged commit c995a7c into Turtle-Hwan:main Jan 21, 2026
1 check passed
@nahyeongjin1
Copy link
Copy Markdown
Contributor Author

종종 쓰고 싶은 기능 있으면 기여하겠습니당 👍

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.

[FEAT] 도서관 남은 좌석 확인 및 예약 바로가기

2 participants