Skip to content

Feature/fix notification UI#19

Merged
hyunjung-choi merged 8 commits intodevelopfrom
feature/fix-notification-ui
Jul 1, 2025
Merged

Feature/fix notification UI#19
hyunjung-choi merged 8 commits intodevelopfrom
feature/fix-notification-ui

Conversation

@hyunjung-choi
Copy link
Copy Markdown
Member

@hyunjung-choi hyunjung-choi commented Jul 1, 2025

PULL REQUEST

Description

  • Fix UI
  • Implement allSelect and delete mode

ScreenShots

Summary by CodeRabbit

  • New Features

    • Added multi-select functionality for notifications, allowing users to select multiple notifications at once.
    • Introduced a delete mode with options to select all, delete selected notifications, or cancel selection.
    • Added the ability to mark selected notifications as read.
  • Improvements

    • Enhanced the notification list UI to reflect selection states and updated toolbar actions for easier management.

@hyunjung-choi hyunjung-choi self-assigned this Jul 1, 2025
@hyunjung-choi hyunjung-choi added feat 새로운 기능 chore 그 외 자잘한 수정 labels Jul 1, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 1, 2025

Walkthrough

The NotificationScreen composable was updated to introduce a multi-select delete mode for notifications. The notification list now supports mutable state, allowing dynamic updates. New UI controls enable selecting, deselecting, deleting, and marking notifications as read. NotificationItemData was extended with a selection property, and a redundant composable was removed.

Changes

File(s) Change Summary
.../NotificationScreen.kt Added multi-select delete mode, mutable notification list, selection logic, new UI controls, and helper composable for top app bar actions. Removed NotificationItemProduction composable. Extended NotificationItemData with isSelected property.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant NotificationScreen
    participant NotificationList

    User->>NotificationScreen: Tap delete icon
    NotificationScreen->>NotificationScreen: Toggle delete mode

    User->>NotificationScreen: Select/deselect notifications
    NotificationScreen->>NotificationList: Update isSelected state

    User->>NotificationScreen: Tap "Select All"
    NotificationScreen->>NotificationList: Select/deselect all notifications

    User->>NotificationScreen: Tap "Delete"
    NotificationScreen->>NotificationList: Remove selected notifications
    NotificationScreen->>NotificationScreen: Exit delete mode
    NotificationScreen->>User: Invoke onDeletePressed callback

    User->>NotificationScreen: Tap "Cancel"
    NotificationScreen->>NotificationList: Clear selections
    NotificationScreen->>NotificationScreen: Exit delete mode

    User->>NotificationScreen: Tap "Read"
    NotificationScreen->>NotificationList: Mark selected as read
    NotificationScreen->>NotificationList: Clear selection and priority flags
Loading

Poem

🐇
A tap, a tick, a list anew,
Select and swipe—goodbye to you!
Delete or read, the choice is clear,
With nimble paws, we manage here.
Notifications hop away,
As rabbits tidy up the day!


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between be426f8 and 217cfdd.

📒 Files selected for processing (1)
  • notification/presentation/src/main/java/com/hyunjung/notification/presentation/NotificationScreen.kt (10 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • notification/presentation/src/main/java/com/hyunjung/notification/presentation/NotificationScreen.kt
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
✨ Finishing Touches
  • 📝 Generate Docstrings

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

@hyunjung-choi hyunjung-choi linked an issue Jul 1, 2025 that may be closed by this pull request
2 tasks
Copy link
Copy Markdown

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

🧹 Nitpick comments (2)
notification/presentation/src/main/java/com/hyunjung/notification/presentation/NotificationScreen.kt (2)

60-61: Consider lifting state to a ViewModel for better architecture.

Managing notification items and delete mode state directly in the composable violates the separation of concerns principle. This makes the UI harder to test and reuse.

Consider moving the state management to a ViewModel:

+@HiltViewModel
+class NotificationViewModel @Inject constructor(
+    private val notificationRepository: NotificationRepository
+) : ViewModel() {
+    private val _notificationItems = MutableStateFlow<List<NotificationItemData>>(emptyList())
+    val notificationItems = _notificationItems.asStateFlow()
+    
+    private val _isDeleteMode = MutableStateFlow(false)
+    val isDeleteMode = _isDeleteMode.asStateFlow()
+    
+    fun toggleDeleteMode() { ... }
+    fun deleteSelectedItems() { ... }
+    fun toggleItemSelection(index: Int) { ... }
+}

339-352: Make the bold text pattern configurable.

The boldPart is hardcoded to a specific string, making this function work only for that exact content.

Make the function more flexible by accepting a pattern or using a more generic approach:

-@Composable
-private fun createAnnotatedString(content: String) = buildAnnotatedString {
-    append(content)
-
-    val boldPart = "D-3 [목요일] 리자이드 양주점"
-    val startIndex = content.indexOf(boldPart)
-    if (startIndex >= 0) {
-        addStyle(
-            style = SpanStyle(fontWeight = FontWeight.Bold),
-            start = startIndex,
-            end = startIndex + boldPart.length
-        )
-    }
-}
+@Composable
+private fun createAnnotatedString(
+    content: String,
+    boldPattern: Regex = Regex("D-\\d+ \\[.*?\\] [^,]+")
+) = buildAnnotatedString {
+    append(content)
+    
+    boldPattern.find(content)?.let { matchResult ->
+        addStyle(
+            style = SpanStyle(fontWeight = FontWeight.Bold),
+            start = matchResult.range.first,
+            end = matchResult.range.last + 1
+        )
+    }
+}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a44465f and be426f8.

📒 Files selected for processing (1)
  • notification/presentation/src/main/java/com/hyunjung/notification/presentation/NotificationScreen.kt (9 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
notification/presentation/src/main/java/com/hyunjung/notification/presentation/NotificationScreen.kt (1)
notification/presentation/src/main/java/com/hyunjung/notification/presentation/component/NotificationToggleItem.kt (2)
  • NotificationActiveToggleItem (81-120)
  • NotificationToggleItem (122-180)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

@hyunjung-choi hyunjung-choi merged commit 1552eac into develop Jul 1, 2025
2 checks passed
@hyunjung-choi hyunjung-choi deleted the feature/fix-notification-ui branch July 1, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore 그 외 자잘한 수정 feat 새로운 기능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Notification UI

1 participant