Skip to content

feat: Long-press category tabs to open category selector overlay#3059

Open
matrix9neonebuchadnezzar2199-sketch wants to merge 7 commits intomihonapp:mainfrom
matrix9neonebuchadnezzar2199-sketch:feature/category-overlay-dialog
Open

feat: Long-press category tabs to open category selector overlay#3059
matrix9neonebuchadnezzar2199-sketch wants to merge 7 commits intomihonapp:mainfrom
matrix9neonebuchadnezzar2199-sketch:feature/category-overlay-dialog

Conversation

@matrix9neonebuchadnezzar2199-sketch
Copy link
Copy Markdown

Closes #3057

Summary

Adds a long-press gesture on library category tabs to open a full-screen overlay dialog for quick category navigation. Designed for users with many categories (50-100+) where horizontal tab scrolling becomes cumbersome.

Features

Three display modes

  • List (Flat) — 2-column text grid showing category name and item count
  • Nested (Tree) — Groups categories by / delimiter in names (e.g. Shounen/SF, Shounen/Battle → grouped under Shounen). Parent headers are collapsible. Categories without / display as top-level items. No database changes required.
  • Thumbnail (Bookshelf) — 2-column grid with manga cover images

Other details

  • Auto-scrolls to currently selected category on open
  • Selected category is highlighted; in Nested mode, parent group of selected child is also highlighted
  • Display mode persists across open/close within the same session
  • Back button / outside tap dismisses the dialog
  • All UI strings use i18n string resources
  • 8 unit tests for the grouping parse logic

Screenshots

Top bar

top

List mode

screenshot_list

Nested mode (collapsed)

screenshot_nested_collapsed

Nested mode (expanded)

screenshot_nested_expanded

Thumbnail mode

screenshot_thumbnail

Changes

  • CategoryOverlayDialog.kt — New file: overlay dialog with 3 display modes
  • LibraryTabs.kt — Added long-press gesture on category tabs
  • LibraryContent.kt — Wiring overlay state and callbacks
  • strings.xml — Added 7 new string resources
  • CategoryGroupTest.kt — 8 unit tests for / parse logic

Testing

  • spotlessCheck — no errors
  • assembleDebug — no errors (no new warnings)
  • Unit tests — 8/8 passed
  • 0 categories — no crash
  • 1 category — all 3 modes display correctly
  • Multiple categories with / — Nested grouping works
  • Multiple categories without / — Nested mode shows flat list
  • Screen rotation — no crash, mode preserved
  • Back button — dismisses dialog
  • Category selection — navigates correctly in all modes

- CategoryOverlayDialog.kt を新規作成(リスト/サムネ2列表示切替対応)
- LibraryTabs.kt でTabをBox+combinedClickableに置き換え(タップ/長押し両対応)
- LibraryContent.kt にオーバーレイの状態管理とハプティックフィードバックを追加
…cated API

- Replace hardcoded strings in CategoryOverlayDialog.kt with stringResource(MR.strings.*)
- Add string resources: action_select_category, action_list_view, action_thumbnail_view, category_count, category_item_count
- Fix deprecated Icons.Filled.ViewList -> Icons.AutoMirrored.Filled.ViewList
- Passes spotlessCheck and all unit tests
- Add CategoryOverlayDisplayMode.Nested enum value
- Add AccountTree icon button for Nested mode in header
- Extract CategoryModeIconButton composable to reduce duplication
- Extract CategoryFlatGrid and CategoryThumbnailGrid composables
- Nested mode temporarily shows flat list (implementation in Step 3)
- Add action_nested_view string resource
- Add CategoryGroup and CategoryChild data classes
- Add buildCategoryGroups() function that parses '/' delimiter
- Split on first '/' only (supports 2-level hierarchy)
- Single-child groups treated as top-level
- Edge cases handled: leading/trailing slash, empty list
- 8 unit tests all passing
- Add CategoryNestedList composable with LazyColumn
- Parent groups show expand/collapse with ExpandMore/ExpandLess icons
- Child items indented 28dp under parent headers
- Parent header shows child count and total item count
- Selected child highlights parent header with secondaryContainer
- Expand/collapse state managed with mutableStateMapOf
- All 8 existing unit tests still passing
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.

Long-press category tabs to open category selector overlay

2 participants