-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add cover image edge curl option #119
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe changes introduce a new setting, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Plugin
participant GoogleBooksApi
User->>Plugin: 설정 변경 (enableCoverImageEdgeCurl)
Plugin->>GoogleBooksApi: 인스턴스화 (enableCoverImageEdgeCurl)
GoogleBooksApi->>GoogleBooksApi: 커버 이미지 URL 생성
GoogleBooksApi-->>Plugin: URL 반환
Plugin-->>User: 업데이트된 커버 이미지 표시
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- README.md (2 hunks)
- src/apis/base_api.ts (1 hunks)
- src/apis/google_books_api.test.ts (2 hunks)
- src/apis/google_books_api.ts (3 hunks)
- src/settings/settings.ts (5 hunks)
Additional comments not posted (13)
src/apis/base_api.ts (1)
22-22
: LGTM!
GoogleBooksApi
생성자에settings.enableCoverImageEdgeCurl
매개변수를 추가하여 커버 이미지 가장자리 컬 기능에 대한 제어를 허용하는 변경 사항을 승인합니다. 이 변경으로 인해GoogleBooksApi
의 구성 가능성이 향상되었습니다.src/apis/google_books_api.ts (4)
11-11
: 생성자 서명 변경이 잘 구현되었습니다!새로운 boolean 매개변수
enableCoverImageEdgeCurl
이 추가되었고, 매개변수 이름이 의도를 잘 설명하고 있습니다.
103-107
:setCoverImageEdgeCurl
메서드가 잘 구현되었습니다!URL과 boolean 플래그를 받아서, 플래그가 false인 경우 URL에서 edge curl 매개변수를 제거하는 로직이 잘 구현되었습니다.
68-68
:coverUrl
속성 변경이 잘 구현되었습니다!
extractBasicBookInfo
메서드의coverUrl
속성이 이제setCoverImageEdgeCurl
메서드를 사용하고 있으며,enableCoverImageEdgeCurl
플래그가 올바르게 전달되고 있습니다.
69-69
:coverSmallUrl
속성 변경이 잘 구현되었습니다!
extractBasicBookInfo
메서드의coverSmallUrl
속성이 이제setCoverImageEdgeCurl
메서드를 사용하고 있으며,enableCoverImageEdgeCurl
플래그가 올바르게 전달되고 있습니다.src/apis/google_books_api.test.ts (3)
52-52
: LGTM!코드 변경 사항이 승인되었습니다.
111-114
: LGTM!코드 변경 사항이 승인되었습니다.
116-122
: LGTM!코드 변경 사항이 승인되었습니다.
README.md (1)
130-132
: 문서 개선 사항이 잘 반영되었습니다!새로운 "Cover Image Edge Curl" 섹션은 Google Books API와 관련된 기능을 명확하게 설명하고 있습니다. 이 섹션은 API가 기본적으로 이미지 썸네일에 "페이지 컬" 효과를 적용하며, 사용자에게 이 효과를 비활성화할 수 있는 옵션을 제공한다는 점을 명시하고 있습니다. 이러한 정보의 추가는 책 표지 이미지의 시각적 표현과 사용자가 이를 수정할 수 있는 방법에 대해 사용자에게 알려줌으로써 문서를 개선합니다.
src/settings/settings.ts (4)
35-35
: 코드 변경 사항이 승인되었습니다.
BookSearchPluginSettings
인터페이스에 새로운 boolean 속성enableCoverImageEdgeCurl
을 추가하는 것은 올바르고 일관성 있는 변경입니다.
56-56
: 코드 변경 사항이 승인되었습니다.
DEFAULT_SETTINGS
상수에 기본값true
로enableCoverImageEdgeCurl
속성을 추가하는 것은 올바르고 일관성 있는 변경입니다.
167-168
: 코드 변경 사항이 승인되었습니다.새로운 변수
coverImageEdgeCurlToggleSetting
을 선언하고,serviceProvider
에 따라 토글 설정을 표시/숨기기 위한 새로운 함수hideCoverImageEdgeCurlToggle
과showCoverImageEdgeCurlToggle
을 추가하는 것은 올바른 변경입니다.toggleServiceProviderExtraSettings
함수도serviceProvider
에 따라 새로운 함수를 호출하도록 업데이트되었습니다. 코드는 기존 패턴과 명명 규칙을 따르고 있습니다.Also applies to: 185-194, 202-202, 206-206
283-291
: 코드 변경 사항이 승인되었습니다.새로운 설정
coverImageEdgeCurlToggleSetting
을 이름, 설명, 토글과 함께 인스턴스화하여 커버 이미지의 가장자리 컬 효과를 활성화/비활성화할 수 있도록 하는 것은 올바른 변경입니다. 토글 값은 플러그인 설정의enableCoverImageEdgeCurl
속성을 기반으로 설정되며, 토글 값이 변경되면 플러그인 설정의enableCoverImageEdgeCurl
속성이 업데이트됩니다. 이 설정은 플러그인 설정의enableCoverImageEdgeCurl
속성과 적절하게 연결되어 있습니다.
Thank you!!! |
Thanks for this plugin!
This PR adds a new check box to the settings to enable or disable the (rather unfortunate) "page curl" effect that's added by default to the bottom-right of cover images from the Google Books API.
The new setting:
Sample cover with setting enabled:
Sample cover with setting disabled:
The default is "enabled" so as not to change the plugin's existing behavior. (Though I'd argue that "disabled" might be a better default since the effect is so middling.)
The PR includes new tests for the feature, and implements conditional rendering for the option in the settings page since it does not apply when Naver is the API source.
Implementation notes:
The implementation for conditional rendering of the settings entry is a bit verbose, but matches the plugin's existing approach.
The plugin's existing settings menu item titles are inconsistently cased, and don't follow the Obsidian style guide, but I followed the "Title Case" precedent used by other image-related settings.
The new setting is ordered before the "Enable Cover Image Save" setting since it applies to the template values of both
{{coverUrl}}
and{{localCoverImage}}
.Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes