Skip to content

SCRUM-265 design: add note search screen#32

Open
gdaegeun539 wants to merge 5 commits intoproject-lyrics:developfrom
gdaegeun539:feature/SCRUM-265-note-search-screen
Open

SCRUM-265 design: add note search screen#32
gdaegeun539 wants to merge 5 commits intoproject-lyrics:developfrom
gdaegeun539:feature/SCRUM-265-note-search-screen

Conversation

@gdaegeun539
Copy link
Copy Markdown
Member

@gdaegeun539 gdaegeun539 commented Apr 9, 2026

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines

What kind of change does this PR introduce?

Select your one and delete others

  • Implement design

What is the current behavior?

You can also link to an open issue here

곡을 통해 노트를 검색하는 화면이 구현되지 않은 상태입니다.

What is the new behavior (if this is a feature change)?

  • 곡을 통해 노트를 검색하는 화면을 구현합니다.
    • 화면만 구현합니다. 뷰모델 없음, 기능 미연결

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

No breaking changes

ScreenShots (If needed)

Screen_Recording_20260410_001331_Feelin.mp4

Summary by CodeRabbit

Release Notes

  • New Features
    • Added note search screen with text input field for searching.
    • Displays search results in a scrollable list with infinite-scroll pagination support.
    • Pull-to-refresh functionality to reload results.
    • Search queries include 1-second debounce to optimize performance.
    • Loading indicators and error messages for user feedback.
    • Music items in results are now interactive and clickable.

@gdaegeun539 gdaegeun539 self-assigned this Apr 9, 2026
@gdaegeun539 gdaegeun539 added the design 디자인 관련 수정 label Apr 9, 2026
@gdaegeun539
Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

📝 Walkthrough

Walkthrough

The changes refactor the note search feature by relocating NoteSearchScreen to a new note/search/ directory structure and implementing a complete search experience with debounced keyword input, infinite-scroll pagination, pull-to-refresh, and dedicated state management infrastructure. The MusicComponent is enhanced with optional click handling support.

Changes

Cohort / File(s) Summary
Navigation Update
app/src/main/java/com/lyrics/feelin/navigation/FeelinNavHost.kt
Import path updated to reflect relocated NoteSearchScreen from note/ to note/search/ package.
UI Component Enhancement
app/src/main/java/com/lyrics/feelin/presentation/view/component/music/MusicComponent.kt
Added optional onClick callback parameter; enabled clickable behavior with interaction-driven state changes (background color swap and pressed feedback) for SearchList and SearchNoteByMusic states; updated text alignment from centered to start-aligned, added single-line text truncation with ellipsis for song/artist names; restructured layout with weighted wrappers and adjusted spacing.
NoteSearchScreen Reorganization
app/src/main/java/com/lyrics/feelin/presentation/view/note/NoteSearchScreen.kt, app/src/main/java/com/lyrics/feelin/presentation/view/note/search/NoteSearchScreen.kt
Removed old placeholder implementation; added new comprehensive search screen with debounced search input flow (1000ms debounce, duplicate elimination), infinite-scroll pagination (prefetch at 8 items from end), pull-to-refresh capability, and status-driven UI rendering (loading spinner, error state, results list with in-list pagination indicator).
State Management Infrastructure
app/src/main/java/com/lyrics/feelin/presentation/view/note/search/NoteSearchViewState.kt, app/src/main/java/com/lyrics/feelin/presentation/view/note/search/NoteSearchViewModel.kt
Added screen and list-level status enums; created NoteSearchViewState data class with factory methods for lifecycle state transitions; introduced NoteSearchViewModel managing initial load, keyword-based search filtering (case-insensitive across song title and artist name), pagination with 8-item page size, and refresh operations with 500ms delay simulation.

Sequence Diagram

sequenceDiagram
    participant User
    participant Screen as NoteSearchScreen
    participant ViewModel as NoteSearchViewModel
    participant StateFlow as StateFlow
    participant LazyColumn as LazyColumn

    User->>Screen: Trigger initial composition
    Screen->>ViewModel: loadInitialNotes()
    ViewModel->>ViewModel: Load dummy dataset, emit LOADING state
    ViewModel->>StateFlow: Update to SUCCESS_LOAD with results
    StateFlow-->>Screen: Emit updated viewState
    Screen->>LazyColumn: Render MusicComponent items

    User->>Screen: Type search keyword
    Screen->>Screen: Debounce input (1000ms, distinctUntilChanged)
    Screen->>ViewModel: searchNotes(keyword)
    ViewModel->>ViewModel: Filter results, emit LOADING state
    ViewModel->>StateFlow: Update to SUCCESS_LOAD with filtered results
    StateFlow-->>Screen: Emit updated viewState
    Screen->>LazyColumn: Re-render filtered items

    User->>LazyColumn: Scroll near end (prefetch threshold)
    LazyColumn->>Screen: Trigger onLoadNextPage
    Screen->>ViewModel: loadNextPage()
    ViewModel->>ViewModel: Emit NEW_PAGE_LOADING, append next page
    ViewModel->>StateFlow: Update results + hasNextPage
    StateFlow-->>Screen: Emit updated viewState
    Screen->>LazyColumn: Append new items to list

    User->>Screen: Pull to refresh
    Screen->>ViewModel: refresh()
    ViewModel->>ViewModel: Reset and reload initial data
    StateFlow-->>Screen: Emit refreshed viewState
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 Hops through the code with glee,
Notes now search where they should be!
Pages flip with graceful flow,
Debounced input steals the show—
From nested paths to organized repos,
Our search ascends to greater heights!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'SCRUM-265 design: add note search screen' directly and clearly summarizes the main change: implementing a new Note Search screen UI for the application.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@app/src/main/java/com/lyrics/feelin/presentation/view/note/search/NoteSearchScreen.kt`:
- Around line 123-126: The FeelinTopAppBarWithBack in NoteSearchScreen currently
has a no-op onBackClick; either remove/hide the back affordance when this screen
is a main-tab root or propagate a real navigation handler: modify
NoteSearchScreen to accept a navigation callback (e.g., onBack or navController)
and pass it into FeelinTopAppBarWithBack's onBackClick, or conditionally set
showBack=false when this destination is the tab root; update the
NoteSearchScreen composable signature and call sites accordingly and ensure
FeelinTopAppBarWithBack receives the actual onBackClick lambda or is rendered
without the back button.
- Around line 91-99: The function NoteSearchScreenContent currently requires a
non-null onMusicClick causing callers to pass an empty lambda and MusicComponent
to render as interactive; change the parameter signature onMusicClick:
(MusicComponentData.SearchNoteByMusic) -> Unit to nullable onMusicClick:
((MusicComponentData.SearchNoteByMusic) -> Unit)? (keep the name), update any
invocation sites inside NoteSearchScreenContent to only call
onMusicClick?.invoke(...) (or pass it directly to MusicComponent so it receives
null), and update callers to pass null instead of {} so MusicComponent sees a
null onClick and renders non-interactive.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eb38f0ca-9d6f-478b-bcf2-0c768a87e82c

📥 Commits

Reviewing files that changed from the base of the PR and between ef72f7c and 5b4194f.

📒 Files selected for processing (6)
  • app/src/main/java/com/lyrics/feelin/navigation/FeelinNavHost.kt
  • app/src/main/java/com/lyrics/feelin/presentation/view/component/music/MusicComponent.kt
  • app/src/main/java/com/lyrics/feelin/presentation/view/note/NoteSearchScreen.kt
  • app/src/main/java/com/lyrics/feelin/presentation/view/note/search/NoteSearchScreen.kt
  • app/src/main/java/com/lyrics/feelin/presentation/view/note/search/NoteSearchViewModel.kt
  • app/src/main/java/com/lyrics/feelin/presentation/view/note/search/NoteSearchViewState.kt
💤 Files with no reviewable changes (1)
  • app/src/main/java/com/lyrics/feelin/presentation/view/note/NoteSearchScreen.kt

Comment on lines +123 to +126
FeelinTopAppBarWithBack(
title = "노트 검색",
showDivider = false,
onBackClick = { /* TODO: 이전화면 라우팅*/ }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Wire the back button or remove it for now.

The UI renders a back affordance, but the current handler is a no-op TODO. If this destination is a main-tab root, hide the back arrow; otherwise pass a real onBackClick from navigation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/main/java/com/lyrics/feelin/presentation/view/note/search/NoteSearchScreen.kt`
around lines 123 - 126, The FeelinTopAppBarWithBack in NoteSearchScreen
currently has a no-op onBackClick; either remove/hide the back affordance when
this screen is a main-tab root or propagate a real navigation handler: modify
NoteSearchScreen to accept a navigation callback (e.g., onBack or navController)
and pass it into FeelinTopAppBarWithBack's onBackClick, or conditionally set
showBack=false when this destination is the tab root; update the
NoteSearchScreen composable signature and call sites accordingly and ensure
FeelinTopAppBarWithBack receives the actual onBackClick lambda or is rendered
without the back button.

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

Labels

design 디자인 관련 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant