Skip to content

[DRAFT]: refactor(card-browser) extract menu to CardBrowserFragment#20211

Draft
david-allison wants to merge 13 commits intoankidroid:mainfrom
david-allison:browse-menu-refactor-2
Draft

[DRAFT]: refactor(card-browser) extract menu to CardBrowserFragment#20211
david-allison wants to merge 13 commits intoankidroid:mainfrom
david-allison:browse-menu-refactor-2

Conversation

@david-allison
Copy link
Member

@david-allison david-allison commented Jan 24, 2026

Purpose / Description

I want to move the MenuHost to the SearchBar in the fragment for a redesign

Some logic should still be in the activity (Navigation Drawer handling; fragment handling).

Actions on selected cards/notes are fragment-only

Search logic is going to be heavily refactored, with most of the menu items removed. Splitting it out now makes it easier to handle this case.

Fixes

Approach

See commits: lots of refactors

How Has This Been Tested?

⚠️ I've done a number of manual tests, but don't feel this is sufficient. I'll probably add a few unit tests for the state

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

to `R.id.action_preview_many`

This ID was shared between two menus: `card_browser`
 and `note_editor` which will appear on the same screen

This causes issues with menu APIs, as they expect distinct
 IDs:

`menu.findItem(id)`; `menu.removeItem(id)` etc...
Handling fragments belongs in the Activity

The rest of the logic should be pushed down
We previously had one provider for both single select
 and multiselect.

This made logic difficult to reason about
Returning `true` stops further processing
@david-allison david-allison changed the title [DRAFT [DRAFT]: refacto(card-browser) extract menu to CardBrowserFragment Jan 24, 2026
@david-allison david-allison added the Blocked by dependency Currently blocked by some other dependent / related change label Jan 24, 2026
@david-allison david-allison changed the title [DRAFT]: refacto(card-browser) extract menu to CardBrowserFragment [DRAFT]: refactor(card-browser) extract menu to CardBrowserFragment Jan 24, 2026
@david-allison david-allison mentioned this pull request Jan 24, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Blocked by dependency Currently blocked by some other dependent / related change Has Conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant