Skip to content

포커싱 검색 결과 화면에 더보기 기능을 추가한다#82

Merged
komodgn merged 4 commits intodevelopfrom
feature/#81
Jan 13, 2026
Merged

포커싱 검색 결과 화면에 더보기 기능을 추가한다#82
komodgn merged 4 commits intodevelopfrom
feature/#81

Conversation

@komodgn
Copy link
Owner

@komodgn komodgn commented Jan 13, 2026

Summary by CodeRabbit

  • New Features

    • Added "More" button to search result categories, enabling users to expand categories and view additional photos on demand.
    • Search results now display a curated preview of photos per category with the ability to load more results for a better browsing experience.
  • UI Improvements

    • Enhanced image preview display with visual placeholders during loading.

✏️ Tip: You can customize this high-level summary in your review settings.

카테고리별 더보기

- 이미지 컴포넌트를 프리뷰에서 확인할 수 있도록 로컬 모드일 때만 배경색을 반환하는 확장 함수 구현
- 검색 결과에서 "더보기" 클릭 시 카테고리별 데이터 확인 가능
- 카테고리 태그 포맷팅 처리 위치 변경 (Mapper -> UI)
@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

This pull request introduces a "load more" feature for search results, renames the GraphDetailScreen parameter from imageUriString to entityName, and updates related call sites. Additionally, it adds a new Modifier preview placeholder extension and adjusts category display formatting.

Changes

Cohort / File(s) Summary
Modifier extension
core/common/src/main/java/com/metasearch/android/core/common/extensions/ModifierExt.kt
Adds new previewPlaceholder composable extension to render background color only in inspection mode.
Graph repository API
core/data/api/src/main/java/com/metasearch/android/core/data/api/repository/GraphRepository.kt
Parameter renamed from imageUriString to entityName in getDetailGraphWebViewUrl function signature.
Graph repository implementation
core/data/impl/src/main/java/com/metasearch/android/core/data/impl/repository/GraphRepositoryImpl.kt
Implementation updated to accept entityName, encodes it with URLEncoder, constructs URL directly; removes prior URI parsing logic.
Response mapping
core/data/impl/src/main/java/com/metasearch/android/core/data/impl/mapper/ResponseToModel.kt
Changes category separator from space to comma+space; removes hashtag prefix from common photo group label.
Navigation screen definition
feature/screens/src/main/java/com/metasearch/android/feature/screens/Screens.kt
GraphDetailScreen data class property changed from imageUriString to entityName.
Detail presenters
feature/detail/src/main/java/com/metasearch/android/feature/detail/graph/GraphDetailPresenter.kt, feature/detail/src/main/java/com/metasearch/android/feature/detail/photo/PhotoDetailPresenter.kt
GraphDetailPresenter uses screen.entityName instead of screen.imageUriString. PhotoDetailPresenter injects GalleryRepository, asynchronously fetches file name before navigating with entityName.
Load more UI event & navigation
feature/search/src/main/java/com/metasearch/android/feature/search/focusing/FocusingSearchUiState.kt, feature/search/src/main/java/com/metasearch/android/feature/search/focusing/FocusingSearchPresenter.kt
Adds new OnMoreClick UI event; presenter handles it to navigate to GraphDetailScreen with category name.
Search result UI components
feature/search/src/main/java/com/metasearch/android/feature/search/focusing/component/MoreButton.kt, feature/search/src/main/java/com/metasearch/android/feature/search/focusing/component/SearchResultList.kt
New MoreButton composable created; SearchResultList adds onMoreClick callback, limits displayed photos to three per group, renders MoreButton when additional photos exist, applies preview placeholders.
UI integration
feature/search/src/main/java/com/metasearch/android/feature/search/focusing/FocusingSearchUi.kt
Wires onMoreClick callback from SearchResultList to FocusingSearchUiEvent; extends preview data with fake PhotoGroup.
String resources
feature/search/src/main/res/values/strings.xml
Adds new string resource focusing_search_more_button with value "더보기+".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through search results so grand,
With "더보기+" buttons, paw in hand!
Entity names now guide the way,
While modifiers shine in preview's day. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a 'more' feature to the focusing search results screen.

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

✨ 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

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

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

🤖 Fix all issues with AI agents
In
@feature/detail/src/main/java/com/metasearch/android/feature/detail/photo/PhotoDetailPresenter.kt:
- Around line 74-80: PhotoDetailPresenter currently uses
galleryRepository.getFileName(...) and falls back to an empty string which
causes invalid navigation to GraphDetailScreen; change the scope.launch handler
for PhotoDetailUiEvent.OnGraphButtonClick to check the result of
galleryRepository.getFileName(screen.imageUriString.toUri()) and if it's null or
blank do not call navigator.goTo but instead emit an error UI event or call the
presenter/view error handler (e.g., show an error toast/state), otherwise pass
the non-empty fileName into GraphDetailScreen; update references in
PhotoDetailPresenter to use this guard around
navigator.goTo(GraphDetailScreen(...)).
🧹 Nitpick comments (3)
feature/search/src/main/java/com/metasearch/android/feature/search/focusing/component/MoreButton.kt (1)

25-30: Add semantic role for accessibility.

Using clickable without semantics means screen readers won't announce this as a button. Consider adding role = Role.Button for proper accessibility support.

♻️ Suggested fix
+import androidx.compose.ui.semantics.Role

 Box(
     modifier = Modifier
         .size(100.dp)
         .clip(RoundedCornerShape(MetaSearchTheme.radius.sm))
         .background(Neutral800)
-        .clickable { onClick() },
+        .clickable(role = Role.Button) { onClick() },
     contentAlignment = Alignment.Center,
 ) {
feature/search/src/main/java/com/metasearch/android/feature/search/focusing/component/SearchResultList.kt (2)

40-40: Consider extracting displayLimit as a named constant or parameter.

The magic number 3 could be made more self-documenting and easier to adjust if requirements change.

♻️ Suggested refactor
+private const val PHOTO_DISPLAY_LIMIT = 3
+
 @Composable
 internal fun SearchResultList(
     modifier: Modifier = Modifier,
     result: SearchResult,
     onImageClick: (String) -> Unit,
     onMoreClick: (String) -> Unit,
 ) {
     LazyColumn(
         // ...
     ) {
-        val displayLimit = 3
+        val displayLimit = PHOTO_DISPLAY_LIMIT

63-71: Modifier order may cause preview placeholder to not be clipped.

The previewPlaceholder() is applied before clip(), which means in previews the placeholder won't have rounded corners. Consider reordering for visual consistency.

♻️ Suggested fix
 modifier = Modifier
     .size(100.dp)
-    .previewPlaceholder()
     .clip(RoundedCornerShape(MetaSearchTheme.radius.sm))
+    .previewPlaceholder()
     .clickable {
         onImageClick(photoName)
     },
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e6ca0ec and 78f2be0.

📒 Files selected for processing (13)
  • core/common/src/main/java/com/metasearch/android/core/common/extensions/ModifierExt.kt
  • core/data/api/src/main/java/com/metasearch/android/core/data/api/repository/GraphRepository.kt
  • core/data/impl/src/main/java/com/metasearch/android/core/data/impl/mapper/ResponseToModel.kt
  • core/data/impl/src/main/java/com/metasearch/android/core/data/impl/repository/GraphRepositoryImpl.kt
  • feature/detail/src/main/java/com/metasearch/android/feature/detail/graph/GraphDetailPresenter.kt
  • feature/detail/src/main/java/com/metasearch/android/feature/detail/photo/PhotoDetailPresenter.kt
  • feature/screens/src/main/java/com/metasearch/android/feature/screens/Screens.kt
  • feature/search/src/main/java/com/metasearch/android/feature/search/focusing/FocusingSearchPresenter.kt
  • feature/search/src/main/java/com/metasearch/android/feature/search/focusing/FocusingSearchUi.kt
  • feature/search/src/main/java/com/metasearch/android/feature/search/focusing/FocusingSearchUiState.kt
  • feature/search/src/main/java/com/metasearch/android/feature/search/focusing/component/MoreButton.kt
  • feature/search/src/main/java/com/metasearch/android/feature/search/focusing/component/SearchResultList.kt
  • feature/search/src/main/res/values/strings.xml
🧰 Additional context used
🧬 Code graph analysis (2)
feature/search/src/main/java/com/metasearch/android/feature/search/focusing/component/MoreButton.kt (1)
core/designsystem/src/main/java/com/metasearch/android/core/designsystem/theme/Theme.kt (1)
  • MetaSearchTheme (14-19)
feature/search/src/main/java/com/metasearch/android/feature/search/focusing/component/SearchResultList.kt (1)
feature/search/src/main/java/com/metasearch/android/feature/search/focusing/component/MoreButton.kt (1)
  • MoreButton (21-39)
🔇 Additional comments (15)
feature/search/src/main/res/values/strings.xml (1)

14-14: LGTM!

The new string resource follows the existing naming convention and appropriately supports the "load more" feature.

core/data/impl/src/main/java/com/metasearch/android/core/data/impl/mapper/ResponseToModel.kt (1)

19-24: LGTM!

The formatting change to use comma-separated category names (without hashtag prefixes) is applied consistently for related categories. This aligns with the change on line 33 for individual category groups.

feature/search/src/main/java/com/metasearch/android/feature/search/focusing/FocusingSearchUiState.kt (1)

25-30: LGTM!

The new OnMoreClick event follows the established pattern and is well-documented. The categoryName parameter correctly supports navigation to category-specific detail views.

core/common/src/main/java/com/metasearch/android/core/common/extensions/ModifierExt.kt (1)

15-23: Missing this. breaks modifier chaining.

The background() calls on line 20 are not chained to this, meaning any modifiers applied before previewPlaceholder will be lost in preview mode.

🐛 Proposed fix
 @Composable
 fun Modifier.previewPlaceholder(
     color: Color = LightGray,
     shape: Shape? = null,
 ): Modifier = if (LocalInspectionMode.current) {
-    if (shape != null) background(color, shape) else background(color)
+    if (shape != null) this.background(color, shape) else this.background(color)
 } else {
     this
 }

Likely an incorrect or invalid review comment.

core/data/api/src/main/java/com/metasearch/android/core/data/api/repository/GraphRepository.kt (1)

7-7: Parameter rename improves semantic clarity.

The rename from imageUriString to entityName correctly reflects that this parameter represents an entity name rather than an image URI. All call sites have been updated, and the implementation properly URL-encodes the parameter before building the detail graph URL.

core/data/impl/src/main/java/com/metasearch/android/core/data/impl/repository/GraphRepositoryImpl.kt (2)

27-31: URL construction logic looks correct.

The refactoring to accept entityName directly and use URLEncoder for proper URL encoding is a clean approach.


14-18: The galleryRepository dependency is actively used in the findMatchedUri method on line 41 and should not be removed. The original review comment incorrectly identifies it as unused after the refactoring.

Likely an incorrect or invalid review comment.

feature/screens/src/main/java/com/metasearch/android/feature/screens/Screens.kt (1)

36-39: LGTM!

The rename from imageUriString to entityName properly reflects the semantic change in how GraphDetailScreen is now used—it represents a named entity rather than an image URI reference.

feature/search/src/main/java/com/metasearch/android/feature/search/focusing/FocusingSearchPresenter.kt (1)

123-124: LGTM!

The OnMoreClick event handling correctly navigates to GraphDetailScreen using categoryName as the entity identifier. This aligns with the PR's goal of adding "load more" functionality for search results.

feature/detail/src/main/java/com/metasearch/android/feature/detail/graph/GraphDetailPresenter.kt (1)

47-49: LGTM!

The change correctly uses screen.entityName to fetch the detail graph URL, aligning with the updated GraphDetailScreen contract and GraphRepository API.

feature/search/src/main/java/com/metasearch/android/feature/search/focusing/component/MoreButton.kt (1)

41-49: LGTM!

The preview is properly structured with MetaSearchTheme wrapper and appropriate annotation.

feature/search/src/main/java/com/metasearch/android/feature/search/focusing/FocusingSearchUi.kt (2)

182-184: LGTM!

The onMoreClick callback is correctly wired to emit FocusingSearchUiEvent.OnMoreClick with the category name, consistent with the event model defined in FocusingSearchUiEvent.kt.


193-207: LGTM!

The preview data provides good coverage for both scenarios: groups with more than 3 photos (showing the MoreButton) and groups with fewer photos. The categoryName format aligns with the split logic in SearchResultList.

feature/search/src/main/java/com/metasearch/android/feature/search/focusing/component/SearchResultList.kt (2)

44-49: LGTM!

The tag transformation logic correctly formats category names for display while preserving the original categoryName for the onMoreClick callback.


56-80: LGTM!

The display limit and MoreButton logic are well-implemented:

  • Photos are correctly limited to 3 items
  • hasMore properly determines when to show the button
  • MoreButton is rendered as a LazyRow item maintaining consistent horizontal scrolling
  • The original categoryName is correctly passed to onMoreClick for downstream navigation

Comment on lines +74 to +80
is PhotoDetailUiEvent.OnGraphButtonClick -> {
scope.launch {
val fileName = galleryRepository.getFileName(screen.imageUriString.toUri()) ?: ""

navigator.goTo(GraphDetailScreen(entityName = fileName))
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Empty string fallback may cause invalid navigation.

When getFileName returns null, the code navigates to GraphDetailScreen with an empty entityName, which would result in an invalid URL (e.g., .../entityTripleGraph/dbName/). Consider showing an error or preventing navigation when the filename cannot be resolved.

🐛 Proposed fix
 is PhotoDetailUiEvent.OnGraphButtonClick -> {
     scope.launch {
         val fileName = galleryRepository.getFileName(screen.imageUriString.toUri())
-
-        navigator.goTo(GraphDetailScreen(entityName = fileName))
+        if (fileName != null) {
+            navigator.goTo(GraphDetailScreen(entityName = fileName))
+        } else {
+            toastMessage = "Unable to retrieve file information"
+        }
     }
 }
🤖 Prompt for AI Agents
In
@feature/detail/src/main/java/com/metasearch/android/feature/detail/photo/PhotoDetailPresenter.kt
around lines 74 - 80, PhotoDetailPresenter currently uses
galleryRepository.getFileName(...) and falls back to an empty string which
causes invalid navigation to GraphDetailScreen; change the scope.launch handler
for PhotoDetailUiEvent.OnGraphButtonClick to check the result of
galleryRepository.getFileName(screen.imageUriString.toUri()) and if it's null or
blank do not call navigator.goTo but instead emit an error UI event or call the
presenter/view error handler (e.g., show an error toast/state), otherwise pass
the non-empty fileName into GraphDetailScreen; update references in
PhotoDetailPresenter to use this guard around
navigator.goTo(GraphDetailScreen(...)).

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🤖 Android CI Summary

Step Results:

  • Unit Test: ✅ Success (2m 5s)
  • Debug Build: ✅ Success (1m 9s)
  • Code Style Check: ✅ Success (2m 42s)

Total Time: 5m 56s

🎉 All steps completed successfully!

@komodgn komodgn merged commit 88709aa into develop Jan 13, 2026
2 checks passed
@komodgn komodgn deleted the feature/#81 branch January 13, 2026 15:31
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.

1 participant

Comments