Skip to content
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

인프라 이전 공지 내림 #426

Merged
merged 1 commit into from
Nov 11, 2024
Merged

인프라 이전 공지 내림 #426

merged 1 commit into from
Nov 11, 2024

Conversation

leeminhee119
Copy link
Member

@leeminhee119 leeminhee119 commented Nov 11, 2024

�인프라 이전 공지 내림


🏄🏼‍♂️‍ Summary (요약)

  • 공지 내림
  • 채널톡 내정보에서만 뜨도록 원상복구

🫨 Describe your Change (변경사항)

🧐 Issue number and link (참고)

📚 Reference (참조)

Summary by CodeRabbit

  • New Features

    • Enhanced logic for displaying the Channel button based on the current path.
  • Bug Fixes

    • Removed unused components and functions, streamlining the layout.
  • Refactor

    • Updated import statements and cleaned up the GlobalLayout component for improved functionality.

@leeminhee119 leeminhee119 self-assigned this Nov 11, 2024
Copy link

vercel bot commented Nov 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
layer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 11, 2024 2:29am

Copy link

coderabbitai bot commented Nov 11, 2024

Walkthrough

The changes involve modifications to the GlobalLayout component in apps/web/src/layout/GlobalLayout.tsx. Key updates include the activation of the useLocation hook from react-router-dom, the removal of the SHEET_ID constant, and the deletion of the openBottomSheet function from the useEffect hook. Additionally, the previously commented-out logic for displaying the Channel button based on the current path is now implemented. The Announcement component and its associated props are removed, while the overall structure remains largely unchanged.

Changes

File Path Change Summary
apps/web/src/layout/GlobalLayout.tsx - Updated import statements to include useLocation.
- Removed SHEET_ID constant.
- Eliminated openBottomSheet function call from useEffect.
- Implemented logic for Channel button visibility based on location changes.
- Removed Announcement component and its props.

Poem

In the layout where rabbits play,
Changes hop in a bright new way.
With buttons that show, and some that hide,
Our code now dances, full of pride.
Goodbye to the old, hello to the new,
A joyful leap for the team, it's true! 🐇✨


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?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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

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

🧹 Outside diff range and nitpick comments (2)
apps/web/src/layout/GlobalLayout.tsx (2)

23-29: Consider adding error handling for ChannelService calls.

While the implementation is correct, adding try-catch blocks would make it more robust against potential runtime errors.

Consider wrapping the service calls with error handling:

  useEffect(() => {
    if (location.pathname.startsWith(PATHS.myInfo())) {
-     ChannelService.showChannelButton();
+     try {
+       ChannelService.showChannelButton();
+     } catch (error) {
+       console.error('Failed to show channel button:', error);
+     }
    } else {
-     ChannelService.hideChannelButton();
+     try {
+       ChannelService.hideChannelButton();
+     } catch (error) {
+       console.error('Failed to hide channel button:', error);
+     }
    }
  }, [location]);

Infrastructure notice has been successfully removed, but Announcement component still exists

The infrastructure notice was successfully removed from GlobalLayout.tsx, but I found that the Announcement component still exists in the codebase at apps/web/src/component/announcement/Announcement.tsx. While this component might be used for other purposes, it's worth noting that:

  • The component is still present but appears to be unused in GlobalLayout
  • The component uses cookies to track visibility state
  • There are other notice-related features in the app (like NoticePage) but they serve different purposes (e.g., general notices in the myInfo section)
🔗 Analysis chain

Line range hint 1-58: Verify the infrastructure notice visibility.

The changes correctly implement the PR objective by removing the infrastructure notice from the global layout while maintaining the Channel button visibility in the myInfo section only.

Let's verify no other instances of the infrastructure notice exist:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining references to infrastructure notices
rg -i "infra|notice|announcement|공지" --type tsx --type ts

Length of output: 87


Script:

#!/bin/bash
# Search for any remaining references to infrastructure notices with correct file extensions
rg -i "infra|notice|announcement|공지" -t ts -t tsx

# Also search for any components named Announcement or Notice
ast-grep --pattern 'const $_ = $$$' -l typescript | xargs rg -i "announcement|notice" -A 2 -B 2

Length of output: 714


Script:

#!/bin/bash
# Search for any remaining references to infrastructure notices using ripgrep
rg -i "(infra|notice|announcement|공지)" --type=typescript

# Search for Announcement component imports
rg -i "import.*announcement" --type=typescript

# Search for Notice component imports
rg -i "import.*notice" --type=typescript

Length of output: 255


Script:

#!/bin/bash
# Find all TypeScript and TSX files first
fd -e ts -e tsx | xargs rg -i "(infra|notice|announcement|공지)"

# Search for component definitions or imports
fd -e ts -e tsx | xargs rg -i "^(import|export).*\b(announcement|notice)\b" -A 1

Length of output: 4613

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 9dae7e8 and 88b08f7.

📒 Files selected for processing (1)
  • apps/web/src/layout/GlobalLayout.tsx (1 hunks)
🔇 Additional comments (2)
apps/web/src/layout/GlobalLayout.tsx (2)

3-3: LGTM! Import changes are appropriate.

The added imports support the new Channel button visibility logic.

Also applies to: 5-5


16-16: LGTM! Proper hook initialization.

The useLocation hook is correctly initialized at the component's top level.

Copy link
Member

@klmhyeonwoo klmhyeonwoo left a comment

Choose a reason for hiding this comment

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

LGTV 📺

@leeminhee119 leeminhee119 merged commit f008858 into main Nov 11, 2024
5 checks passed
@leeminhee119 leeminhee119 deleted the chore/420/announce1109 branch November 11, 2024 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants