Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/background/listeners/iframeCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,23 @@
iframeId,
) as HTMLIFrameElement;

// ν˜„μž¬ iframeInvisible μƒνƒœ 확인
// ν˜„μž¬ iframeInvisibleκ³Ό iframeHiddenByAltA μƒνƒœ 확인
chrome.storage.local.get(
["iframeInvisible", "iframeHiddenByAltA"],
function (result) {
const isInvisible =

Check warning on line 25 in src/background/listeners/iframeCommandHandler.ts

View workflow job for this annotation

GitHub Actions / lint-and-test

'isInvisible' is assigned a value but never used. Allowed unused vars must match /^_/u
result.iframeInvisible ?? false;
Comment on lines 25 to 26
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

μ‚¬μš©λ˜μ§€ μ•ŠλŠ” λ³€μˆ˜λ₯Ό μ œκ±°ν•˜μ„Έμš”.

정적 뢄석 λ„κ΅¬μ—μ„œ μ§€μ ν•œ λŒ€λ‘œ isInvisible λ³€μˆ˜κ°€ ν• λ‹Ήλ˜μ—ˆμ§€λ§Œ μ‚¬μš©λ˜μ§€ μ•Šκ³  μžˆμŠ΅λ‹ˆλ‹€. 이 λ³€μˆ˜λŠ” μ œκ±°ν•˜κ±°λ‚˜ μ‹€μ œλ‘œ μ‚¬μš©λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€.

-                                const isInvisible =
-                                    result.iframeInvisible ?? false;
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const isInvisible =
result.iframeInvisible ?? false;
// before: retrieved iframeHiddenByAltA flag
const hiddenByAltA =
result.iframeHiddenByAltA ?? false;
// (removed unused `isInvisible` assignment)
if (hiddenByAltA) {
// …rest of your logic here
}
🧰 Tools
πŸͺ› GitHub Check: lint-and-test

[warning] 25-25:
'isInvisible' is assigned a value but never used. Allowed unused vars must match /^_/u

πŸ€– Prompt for AI Agents
In src/background/listeners/iframeCommandHandler.ts around lines 25 to 26, the
variable isInvisible is assigned but never used. Remove the declaration and
assignment of isInvisible to clean up unused code, or if it is intended to be
used later, integrate it properly where needed.

const hiddenByAltA =
result.iframeHiddenByAltA ?? false;

if (existingIframe) {
// iframe이 있으면 μ œκ±°ν•˜κ³  μƒνƒœλ₯Ό true둜 μ„€μ •
existingIframe.remove();
chrome.storage.local.set({
iframeInvisible: true,
iframeHiddenByAltA: false,
iframeHiddenByAltA: true,
});
} else {
// iframe이 μ—†μœΌλ©΄ μƒμ„±ν•˜κ³  μƒνƒœλ₯Ό false둜 μ„€μ •
} else if (!hiddenByAltA) {
// hiddenByAltAκ°€ false일 λ•Œλ§Œ iframe 생성
const iframe =
document.createElement("iframe");
iframe.id = iframeId;
Expand Down
65 changes: 32 additions & 33 deletions src/background/listeners/modalCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export async function handleModalToggle(): Promise<void> {
active: true,
currentWindow: true,
});

if (tabs[0]?.id) {
await chrome.scripting.executeScript({
target: { tabId: tabs[0].id },
Expand All @@ -12,20 +13,23 @@ export async function handleModalToggle(): Promise<void> {
iframeId,
) as HTMLIFrameElement;

if (!iframe) {
// iframeInvisible μƒνƒœ 확인
chrome.storage.local.get(
[
"iframeInvisible",
"iframeHiddenByAltA",
"iframeHiddenByAltV",
],
(result) => {
const isInvisible = result.iframeInvisible ?? false;
const hiddenByAltA =
result.iframeHiddenByAltA ?? false;
// 항상 iframeHiddenByAltA λ¨Όμ € 검사
chrome.storage.local.get(
[
"iframeInvisible",
"iframeHiddenByAltA",
"iframeHiddenByAltV",
],
(result) => {
const isInvisible = result.iframeInvisible ?? false;
const hiddenByAltA = result.iframeHiddenByAltA ?? false;
const hiddenByAltV = result.iframeHiddenByAltV ?? false;

// βœ… Alt+A둜 숨긴 μƒνƒœλ©΄ 아무 λ™μž‘λ„ ν•˜μ§€ μ•ŠμŒ
if (hiddenByAltA) return;

// ALT+V둜 숨긴 κ²½μš°μ—λ§Œ iframe μƒμ„±ν•˜κ³  λͺ¨λ‹¬ λ„μš°κΈ°
if (!iframe) {
// Alt+V둜 μˆ¨κ²¨μ§„ μƒνƒœμΌ λ•Œλ§Œ iframe 생성
if (isInvisible) {
iframe = document.createElement("iframe");
iframe.id = iframeId;
Expand All @@ -52,9 +56,9 @@ export async function handleModalToggle(): Promise<void> {
const handleMessage = function (
event: MessageEvent,
) {
if (event.source !== iframe.contentWindow) {
if (event.source !== iframe.contentWindow)
return;
}

if (event.data.type === "RESIZE_IFRAME") {
if (event.data.isOpen) {
iframe.style.width = "100%";
Expand All @@ -74,11 +78,13 @@ export async function handleModalToggle(): Promise<void> {
handleMessage,
);
document.body.appendChild(iframe);

chrome.storage.local.set({
iframeInvisible: false,
iframeHiddenByAltA: false,
iframeHiddenByAltV: true,
});

iframe.onload = function () {
if (iframe.contentWindow) {
iframe.contentWindow.postMessage(
Expand All @@ -88,20 +94,13 @@ export async function handleModalToggle(): Promise<void> {
}
};
}
},
);
} else {
if (iframe.contentWindow) {
iframe.contentWindow.postMessage(
{ type: "TOGGLE_MODAL" },
"*",
);

chrome.storage.local.get(
["iframeHiddenByAltV"],
(result) => {
const hiddenByAltV =
result.iframeHiddenByAltV ?? false;
} else {
// iframe이 이미 μ‘΄μž¬ν•  λ•Œ
if (iframe.contentWindow) {
iframe.contentWindow.postMessage(
{ type: "TOGGLE_MODAL" },
"*",
);

if (hiddenByAltV) {
iframe.remove();
Expand All @@ -111,10 +110,10 @@ export async function handleModalToggle(): Promise<void> {
iframeHiddenByAltV: false,
});
}
},
);
}
}
}
}
},
);
},
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const ReviewSummaryComponent = ({
isDarkMode ? "text-grayscale-100" : "text-grayscale-900"
} text-center py-10`}
>
λΆˆλŸ¬μ˜€λŠ”μ€‘μž…λ‹ˆλ‹€...
리뷰λ₯Ό λΆˆλŸ¬μ˜€λŠ” μ€‘μž…λ‹ˆλ‹€. μž μ‹œλ§Œ κΈ°λ‹€λ €μ£Όμ„Έμš”.
</div>
);
}
Expand Down
1 change: 1 addition & 0 deletions src/components/sidebar/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export function Sidebar({
keywords: [],
}
}
isLoading={!reviewSummary}
/>
);
default:
Expand Down
Loading