Skip to content

Conversation

@NCookies
Copy link
Collaborator

@NCookies NCookies commented Jul 7, 2025

Summary by CodeRabbit

  • New Features
    • 문제 설명 영역에 문제 관련 이미지를 동적으로 표시하는 기능이 추가되었습니다. 문제 데이터에 이미지가 포함된 경우 이미지를 보여주고, 없을 경우 이미지를 숨깁니다.

@NCookies NCookies self-assigned this Jul 7, 2025
@NCookies NCookies added bug Something isn't working enhancement New feature or request labels Jul 7, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 7, 2025

Walkthrough

문제 설명 영역에 문제 이미지를 동적으로 표시할 수 있도록 HTML 요소가 추가되고, JavaScript의 loadProblem 함수가 수정되었습니다. 문제 데이터에 이미지 URL이 존재하면 이미지를 보여주고, 없으면 숨깁니다. 다른 UI나 로직에는 변화가 없습니다.

Changes

파일/경로 변경 요약
src/main/resources/templates/test-submit.html 문제 이미지 표시용 HTML 요소 추가, loadProblem 함수 내 이미지 동적 표시/숨김 로직 반영

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Browser
    participant Server

    User->>Browser: 페이지 로드 또는 문제 선택
    Browser->>Server: 문제 데이터 요청
    Server-->>Browser: 문제 데이터 응답 (imageUrl 포함 가능)
    Browser->>Browser: loadProblem(data)
    alt imageUrl 존재
        Browser->>Browser: 이미지 요소 src 설정 및 표시
    else imageUrl 없음
        Browser->>Browser: 이미지 요소 숨김
    end
Loading

Possibly related PRs

Suggested labels

documentation

Suggested reviewers

  • Kimminu7
  • chat26666

Poem

🐇
문제에 사진이 첨부돼
토끼도 깡총, 눈이 번쩍!
이미지가 있으면 짠—하고,
없으면 살짝 숨겨줘요.
코드도, 화면도 한층 더
풍성해진 오늘의 변화!
🖼️✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@chat26666 chat26666 merged commit 17f3609 into dev Jul 7, 2025
1 of 2 checks passed
@chat26666 chat26666 deleted the fix/submit-image branch July 7, 2025 16:39
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2ef0a49 and 3849050.

📒 Files selected for processing (1)
  • src/main/resources/templates/test-submit.html (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
src/main/resources/templates/test-submit.html (1)
Learnt from: thezz9
PR: ezcode-my/backend#73
File: src/main/resources/templates/submit-test.html:135-135
Timestamp: 2025-06-18T11:41:58.457Z
Learning: src/main/resources/templates/submit-test.html 파일은 테스트용 파일로, isCorrect 값의 하드코딩은 의도적이며 사용자가 UI 요소를 통해 정답/오답 상태를 선택할 수 있도록 개선 예정입니다.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build

Comment on lines +940 to +945
if (data.imageUrl) {
probImageEl.src = data.imageUrl;
probImageEl.style.display = 'block';
} else {
probImageEl.style.display = 'none';
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

이미지 표시/숨김 로직 보완 제안

  1. src를 조건부로 설정하지 않으면 직전 문제의 이미지가 캐시된 채 남아있을 수 있습니다.
  2. 래퍼(prob-image-wrapper)도 함께 토글해야 레이아웃 공백이 사라집니다.
-if (data.imageUrl) {
-    probImageEl.src = data.imageUrl;
-    probImageEl.style.display = 'block';
-} else {
-    probImageEl.style.display = 'none';
-}
+if (data.imageUrl) {
+    probImageEl.src = data.imageUrl;
+    probImageEl.alt = `${data.title} 이미지`;
+    probImageEl.parentElement.style.display = 'block';
+} else {
+    probImageEl.removeAttribute('src');
+    probImageEl.parentElement.style.display = 'none';
+}
📝 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
if (data.imageUrl) {
probImageEl.src = data.imageUrl;
probImageEl.style.display = 'block';
} else {
probImageEl.style.display = 'none';
}
if (data.imageUrl) {
probImageEl.src = data.imageUrl;
probImageEl.alt = `${data.title} 이미지`;
probImageEl.parentElement.style.display = 'block';
} else {
probImageEl.removeAttribute('src');
probImageEl.parentElement.style.display = 'none';
}
🤖 Prompt for AI Agents
In src/main/resources/templates/test-submit.html around lines 940 to 945, the
current logic only toggles the image element's display but does not clear the
src attribute when no imageUrl is present, which can cause the previous image to
remain cached and visible. Also, the wrapper element with class
'prob-image-wrapper' is not toggled, leaving unwanted layout space. To fix this,
clear the probImageEl.src when data.imageUrl is absent and toggle the display
style of both probImageEl and its wrapper element accordingly to fully hide or
show the image and remove layout gaps.

Comment on lines +819 to +822
<div id="prob-image-wrapper">
<img id="prob-image" src="" alt="문제 이미지" style="max-width: 100%; height: auto;" />
</div>

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

문제 이미지가 토글 탭 외부에 위치하여 항상 표시되는 문제

prob-image-wrapperdescription-content div 밖에 배치되어 있어, 사용자가 토론글 탭으로 전환해도 이미지가 계속 노출됩니다. 의도대로라면 문제 설명과 함께 숨겨져야 합니다.

-        </div> <!-- #discussion-content 종료 -->
-
-        <div id="prob-image-wrapper">
-            <img id="prob-image" src="" alt="문제 이미지" style="max-width: 100%; height: auto;" />
-        </div>
+        </div> <!-- #discussion-content 종료 -->
+
+        <!-- description-content 내부로 이동 -->
+        <div id="prob-image-wrapper" class="left-content active" style="margin-top:12px;">
+            <img id="prob-image" src="" alt="문제 이미지" style="max-width:100%;height:auto;display:none;" />
+        </div>

이렇게 옮기면 탭 전환 로직(.left-content.active)에 따라 이미지도 자연스럽게 토글됩니다.
추가로 display:none을 초기값으로 주어 첫 로드 시 깜빡임을 방지할 수 있습니다.

🤖 Prompt for AI Agents
In src/main/resources/templates/test-submit.html around lines 819 to 822, the
prob-image-wrapper div is placed outside the description-content div, causing
the problem image to always be visible even when switching to the discussion
tab. Move the prob-image-wrapper div inside the description-content div so that
it toggles visibility along with the problem description. Also, set its initial
CSS display property to none to prevent flickering on page load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants