Skip to content

feat: 북마클릿은 도서관 없이 열고 내 도서관에서 검색 - #84

Merged
afrontend merged 1 commit into
masterfrom
feat/bookmarklet-my-libraries
Nov 11, 2026
Merged

afrontend merged 1 commit into
masterfrom
feat/bookmarklet-my-libraries

Conversation

@afrontend

Copy link
Copy Markdown
Owner

Summary

#83 의 북마클릿은 만들 때 고른 도서관 하나에 고정돼, 도서관을 바꾸면 다시 끌어다 놓아야 했다. 북마클릿은 다른 사이트에서 실행돼 dongne 의 저장값을 못 읽지만, 북마클릿이 연 dongne 탭은 읽을 수 있다. 그래서 도서관은 dongne 이 열릴 때 "내 도서관"으로 정한다. 크롬 확장도 같은 규칙을 쓰면 옵션 페이지 없이 만들 수 있다.

Changes

  • src/utils/bookmarklet.ts: /?title=…&ref=bm 만 넘긴다 (도서관 없음).
  • src/hooks/useSearchManager.ts: 첫 화면에서 ref 가 있고 library 가 없으면
    • 내 도서관(localStorage dlserver-my-libraries, 최대 5곳)이 있으면 그 도서관들을 검색한다.
    • 없으면 제목만 채우고 검색하지 않는다. 전체 1,342곳 검색을 피한다.
    • ref 가 없는 기존 공유 링크, library 가 있는 예전 북마클릿 동작은 그대로다.
  • src/utils/url.ts: getUrlParams 가 ref 도 돌려준다.
  • BookmarkletHelp: 도서관을 고르지 않아도 항상 버튼을 보여 주고, 내 도서관에서 찾는다고 안내한다.
  • README.md 갱신.

Test Plan

  • npm test: 224 통과 (내 도서관 검색·내 도서관 없음·도서관 지정 우선 3건 추가, 북마클릿 테스트 갱신)
  • npm run typecheck 통과
  • 배포 후: 북마클릿을 다시 끌어다 놓고 다른 사이트에서 실행 → 내 도서관 결과가 뜨는지, 시크릿 창(내 도서관 없음)에서는 제목만 채워지는지 확인

- 북마클릿이 도서관을 넣지 않는다. 하나만 끌어다 놓으면 되고 도서관을 바꿔도 다시 만들 필요가 없다
- ref 가 있고 library 가 없으면 전체 대신 내 도서관(최대 5곳)을 검색한다
- 내 도서관이 없으면 제목만 채우고 검색하지 않는다
- 예전 북마클릿(library 포함)은 그대로 그 도서관을 검색한다
@afrontend
afrontend merged commit efd0d44 into master Nov 11, 2026
1 check passed
@afrontend
afrontend deleted the feat/bookmarklet-my-libraries branch November 11, 2026 13:44
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.

1 participant