Skip to content

Conversation

@HI-JIN2
Copy link
Member

@HI-JIN2 HI-JIN2 commented Jan 26, 2026

Summary

notification 퍼미션 허용시에만 토스트 뜨도록 수정합니다
단순 알림 토글 on/off에는 토스트 X

Describe your changes

Issue

To reviewers

@HI-JIN2 HI-JIN2 self-assigned this Jan 26, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @HI-JIN2, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 알림 권한과 관련된 토스트 메시지 표시 방식을 개선합니다. 이전에는 초기 권한 요청 시와 앱 내 알림 스위치를 토글할 때 토스트 메시지가 표시되었습니다. 이번 변경을 통해 토스트 메시지는 사용자가 시스템 설정을 통해 권한을 부여하거나 거부하는 등 실제 알림 권한 상태가 변경될 때만 표시되도록 하여, 보다 집중적이고 방해받지 않는 사용자 경험을 제공합니다.

Highlights

  • 토스트 메시지 표시 로직 개선: 알림 권한 요청 및 앱 내 알림 스위치 토글 시 불필요하게 표시되던 토스트 메시지를 제거했습니다.
  • 외부 권한 변경 감지: 시스템 설정 등 외부에서 알림 권한 상태가 변경되었을 때 이를 감지하고, 변경된 경우에만 토스트 메시지를 표시하도록 새로운 로직을 추가했습니다.
  • 뷰모델 알림 상태 동기화: 알림 권한 변경에 따라 myPageViewModel의 알림 상태가 정확하게 업데이트되도록 보장합니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 알림 권한 상태가 변경될 때만 토스트 메시지를 표시하도록 로직을 수정합니다. 기존에 권한 요청 결과나 알림 스위치 토글 시에 매번 표시되던 토스트를 제거하고, onResume에서 권한 상태 변화를 감지하여 처리하는 방식으로 변경되었습니다. 전반적으로 PR의 목적에 맞게 잘 수정되었으나, 코드의 안정성과 유지보수성을 높이기 위해 몇 가지 개선점을 제안합니다. lastNotificationPermissionState의 초기화 위치를 생명주기에 더 안전한 곳으로 옮기고, DateTimeFormatter를 상수로 만들어 재사용하는 것을 고려해 주세요.

Comment on lines +109 to +112
// 초기 권한 상태 저장 (처음 로드될 때만)
if (lastNotificationPermissionState == null) {
lastNotificationPermissionState = checkNotificationPermission(requireContext())
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

render 함수는 UI 상태를 렌더링하는 역할에 집중하는 것이 좋습니다. lastNotificationPermissionState와 같은 상태를 초기화하는 로직은 onViewCreated와 같은 생명주기 콜백으로 옮기는 것이 코드 구조상 더 명확하고 안정적입니다. render 함수는 비동기적으로 여러 번 호출될 수 있어, 여기에 초기화 로직이 있으면 예상치 못한 동작을 유발할 수 있습니다. onViewCreated는 뷰가 생성될 때 한 번만 호출되므로 초기화에 더 적합한 위치입니다.

Comment on lines +231 to +232
val nowDatetime = LocalDateTime.now()
val formattedDate = nowDatetime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

DateTimeFormatter 객체는 생성 비용이 있고 스레드에 안전하므로, 매번 새로 생성하기보다는 companion object에 상수로 만들어 재사용하는 것이 성능에 더 효율적입니다. 또한, 날짜 포맷 패턴을 상수로 관리하면 코드의 가독성과 유지보수성도 향상됩니다.

companion object {
    private val DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")
}

// ...
val formattedDate = LocalDateTime.now().format(DATE_TIME_FORMATTER)

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