Repository navigation
feat: 북마클릿은 도서관 없이 열고 내 도서관에서 검색 - #84
Merged
Merged
Conversation
- 북마클릿이 도서관을 넣지 않는다. 하나만 끌어다 놓으면 되고 도서관을 바꿔도 다시 만들 필요가 없다 - ref 가 있고 library 가 없으면 전체 대신 내 도서관(최대 5곳)을 검색한다 - 내 도서관이 없으면 제목만 채우고 검색하지 않는다 - 예전 북마클릿(library 포함)은 그대로 그 도서관을 검색한다
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
#83 의 북마클릿은 만들 때 고른 도서관 하나에 고정돼, 도서관을 바꾸면 다시 끌어다 놓아야 했다. 북마클릿은 다른 사이트에서 실행돼 dongne 의 저장값을 못 읽지만, 북마클릿이 연 dongne 탭은 읽을 수 있다. 그래서 도서관은 dongne 이 열릴 때 "내 도서관"으로 정한다. 크롬 확장도 같은 규칙을 쓰면 옵션 페이지 없이 만들 수 있다.
Changes
src/utils/bookmarklet.ts:/?title=…&ref=bm만 넘긴다 (도서관 없음).src/hooks/useSearchManager.ts: 첫 화면에서ref가 있고library가 없으면localStoragedlserver-my-libraries, 최대 5곳)이 있으면 그 도서관들을 검색한다.ref가 없는 기존 공유 링크,library가 있는 예전 북마클릿 동작은 그대로다.src/utils/url.ts:getUrlParams가ref도 돌려준다.BookmarkletHelp: 도서관을 고르지 않아도 항상 버튼을 보여 주고, 내 도서관에서 찾는다고 안내한다.README.md갱신.Test Plan
npm test: 224 통과 (내 도서관 검색·내 도서관 없음·도서관 지정 우선 3건 추가, 북마클릿 테스트 갱신)npm run typecheck통과