Skip to content

Conversation

@young-jin-son
Copy link
Collaborator

@young-jin-son young-jin-son commented Jul 17, 2025

Issue Number

close #311

As-Is

  • 알림 기능이 남아있었음

To-Be

  • 기획 변경에 따라 알림 기능을 더이상 사용하지 않아 비활성화함

Check List

  • 테스트가 전부 통과되었나요?
  • 모든 commit이 push 되었나요?
  • merge할 branch를 확인했나요?
  • Assignee를 지정했나요?
  • Label을 지정했나요?

Test Screenshot

(Optional) Additional Description

Summary by CodeRabbit

  • Refactor
    • Removed all notification permission handling and the associated modal from the main page. No other features or UI elements were affected.

@young-jin-son young-jin-son self-assigned this Jul 17, 2025
@young-jin-son young-jin-son added refactor 코드 리팩토링 (기능은 그대로인데, 코드 개선, 폴더 변경, 변수명/함수명 수정) FE 프론트엔드 작업 labels Jul 17, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 17, 2025

Walkthrough

The code removes all logic related to notification permission handling and the associated modal from the MainPage component. This includes commenting out relevant imports, state variables, handler functions, hook usage, and conditional rendering of the modal. No other component logic or UI elements are changed.

Changes

File(s) Change Summary
frontend/src/pages/MainPage/index.tsx Removed all notification permission handling and modal logic; commented out related imports, state, hooks, and JSX.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant MainPage

    User->>MainPage: Visits page
    Note over MainPage: Notification permission logic and modal are not triggered
    MainPage-->>User: Renders page without notification-related UI
Loading

Assessment against linked issues

Objective Addressed Explanation
Remove notification feature (#311)

Possibly related PRs

Suggested reviewers

  • rbgksqkr

Poem

A bunny hopped through code so bright,
Removing popups left and right.
No more alerts to interrupt the day—
The MainPage is now clear, hooray!
With every hop, the clutter's gone,
Leaving only code to build upon.
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

Copy link
Contributor

@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: 1

🧹 Nitpick comments (3)
frontend/src/pages/MainPage/index.tsx (3)

11-11: Consider removing commented imports instead of keeping them.

The commented imports for useNotificationPermission and HomeModal are no longer used. Consider removing these lines entirely rather than commenting them out to keep the codebase clean.

-// import useNotificationPermission from '@/hooks/useNotificationPermission';
-// import HomeModal from '@/pages/PlanPage/components/HomeModal';

Also applies to: 14-14


18-18: Remove commented notification-related code.

The commented code blocks for modal state management and notification permission handling are no longer needed. Consider removing these commented sections to improve code readability and maintainability.

-  // const [isModalOpen, setModalOpen] = useState(false);
-
-  // const handleOpenModal = () => {
-  //   setModalOpen(true);
-  // };
-
-  // const { requestPermission, permission, setPermission } =
-  //   useNotificationPermission(handleOpenModal);
-
-  // const handleCloseModal = () => {
-  //   setModalOpen(false);
-  //   if (permission === 'default') {
-  //     setPermission('denied');
-  //   }
-  // };
-
-  // const handleConfirmModal = () => {
-  //   requestPermission();
-  //   handleCloseModal();
-  // };

Also applies to: 20-25, 27-37


98-110: Remove commented JSX for modal rendering.

The commented JSX for the HomeModal component should be removed to keep the render method clean and avoid confusion.

-      {/* {isModalOpen && (
-        <HomeModal
-          title="알림 설정"
-          content={[
-            '이동 시간이 끝나기 전에',
-            '알림으로 리마인드를 받아보세요! 🚀',
-            '놓치지 않게 도와드려요.',
-          ]}
-          close={handleCloseModal}
-          onConfirm={handleConfirmModal}
-          confirmText="알림 설정"
-        />
-      )} */}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8bbcbc6 and 37b31ec.

📒 Files selected for processing (1)
  • frontend/src/pages/MainPage/index.tsx (3 hunks)

import Header from '@/components/Header';
import SearchAddress from '@/components/SearchAddress';
import useNotificationPermission from '@/hooks/useNotificationPermission';
// import useNotificationPermission from '@/hooks/useNotificationPermission';
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify that notification-related dependencies can be removed.

Since the notification functionality has been disabled, check if the useNotificationPermission hook and HomeModal component are used elsewhere in the codebase. If not, consider removing these files and their dependencies.

Also applies to: 14-14


🏁 Script executed:

#!/bin/bash
# Description: Check if notification-related components are used elsewhere in the codebase
# Expected: No usage found, indicating these can be safely removed

echo "Checking usage of useNotificationPermission hook:"
rg -n "useNotificationPermission" --type tsx --type ts

echo -e "\nChecking usage of HomeModal component:"
rg -n "HomeModal" --type tsx --type ts

echo -e "\nChecking if these files exist and can be removed:"
fd "useNotificationPermission" --type f
fd "HomeModal" --type f

Length of output: 647


🏁 Script executed:

#!/bin/bash
# Retry searching without relying on ripgrep’s built-in file types

echo "Searching for useNotificationPermission references in .ts/.tsx files:"
rg -n "useNotificationPermission" --glob "*.ts" --glob "*.tsx" || true

echo -e "\nSearching for HomeModal references in .ts/.tsx files:"
rg -n "HomeModal" --glob "*.ts" --glob "*.tsx" || true

Length of output: 2132


Remove unused notification hook and retain HomeModal

The useNotificationPermission hook is only referenced in commented lines and isn’t used anywhere else. You should:

  • Delete frontend/src/hooks/useNotificationPermission.ts
  • Remove the commented import and invocation in frontend/src/pages/MainPage/index.tsx (lines 11 & 25)

The HomeModal component is still actively used throughout the app and must stay:

  • frontend/src/pages/PlanPage/index.tsx (import & usage at line 57)
  • frontend/src/pages/PlanPage/components/HomeModal/index.tsx
  • frontend/src/pages/PlanPage/components/PlanHeader/index.tsx
  • frontend/src/components/Button/DeleteAccountButton/index.tsx
  • frontend/src/components/Button/LogoutButton/index.tsx
  • Additionally, if you intend to render HomeModal in MainPage (line 99), re-enable its import at line 14.
🤖 Prompt for AI Agents
In frontend/src/pages/MainPage/index.tsx at lines 11 and 25, remove the
commented import and invocation of the unused useNotificationPermission hook.
Also, delete the file frontend/src/hooks/useNotificationPermission.ts entirely.
Ensure that the HomeModal component remains intact and imported where it is
actively used, and if you want to render HomeModal in MainPage at line 99,
re-enable its import at line 14.

@young-jin-son young-jin-son merged commit ed10e55 into develop Jul 17, 2025
3 checks passed
@young-jin-son young-jin-son deleted the refactor/#311 branch July 17, 2025 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FE 프론트엔드 작업 refactor 코드 리팩토링 (기능은 그대로인데, 코드 개선, 폴더 변경, 변수명/함수명 수정)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] 알림 기능 제거

2 participants