C버튼으로 채팅 바로가기#8
Draft
emptycan1010 wants to merge 24 commits into
Draft
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds a global “C” key shortcut to focus and select the chat textarea.
- Introduces a new utility (
keyboard.ts) to detect key presses and focus the chat input. - Registers the keyboard utility in the content script entrypoint.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/utils/keyboard.ts | Implements keydown listener for ‘c’/’C’ to focus chat |
| src/entrypoints/content/index.tsx | Imports the keyboard utility for side effects |
Comments suppressed due to low confidence (2)
src/utils/keyboard.ts:5
- [nitpick] The function name
focusTargetis generic. Consider renaming it tofocusChatInputfor clearer intent.
function focusTarget (): void {
src/utils/keyboard.ts:25
- The new keyboard shortcut behavior isn’t covered by tests. Consider adding unit or integration tests for the keydown handler to ensure it focuses the chat input correctly.
window.addEventListener('keydown', (e: KeyboardEvent) => {
| // 이미 다른 입력 필드에 커서가 있으면 무시 | ||
| if (isTypingInEditable()) return | ||
| // 단독 'c' 키 확인 | ||
| if (e.key === 'c' || e.key === 'C') { |
There was a problem hiding this comment.
You can simplify case handling by using e.key.toLowerCase() === 'c', which covers both 'c' and 'C'.
Suggested change
| if (e.key === 'c' || e.key === 'C') { | |
| if (e.key.toLowerCase() === 'c') { |
Owner
|
기존에 사용하고 있는 hook을 이용한 구현이 필요해보입니다. |
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.
No description provided.