Skip to content

feat(browser): columns and find/replace progress - #22907

Merged
david-allison merged 1 commit into
ankidroid:mainfrom
criticalAY:cardbrowser-leftovers-progress
Nov 3, 2026
Merged

david-allison merged 1 commit into
ankidroid:mainfrom
criticalAY:cardbrowser-leftovers-progress

Conversation

@criticalAY

Copy link
Copy Markdown
Contributor

Note

Assisted-by: Claude Opus 5.5

Purpose / Description

Adopt the ViewModel progress for two more Card Browser loads: the Manage columns picker and the selected notes lookup before Find and replace opens.

Fixes

Approach

check commit

How Has This Been Tested?

  • Emulator Pixel 9, API 31
    before n after
Screenshot 2026-11-03 at 11 53 11 AM Screenshot 2026-11-03 at 11 53 21 AM

Learning (optional, can help others)

NA

Checklist

Please, go through these checks before submitting the PR.

  • 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

@criticalAY criticalAY changed the title feat(card-browser): show column and find and replace progress from th… feat(browser): columns and find/replace progress Nov 3, 2026
Loading the column picker and the notes for Find and Replace now report
progress from CardBrowserViewModel, so the browser's existing observer
shows the dialog and blocks input while they load.

Assisted-by: Claude Opus 5.5
@criticalAY
criticalAY force-pushed the cardbrowser-leftovers-progress branch from d9b2238 to 00d8011 Compare November 3, 2026 06:30

@mikehardy mikehardy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Assisted-by: Grok 4.7

Thank you — these two loads were the remaining browser sites still on the activity withProgress dialog, aside from the filtered-deck search you called out.

I did not push; prep replayed the PR tip locally at 00d8011. Lint Kotlin/JS, unit tests, and the emulator lane all passed (emulator-5556, API 35 google_apis).

BrowserColumnSelectionFragment.onViewCreated calls viewModel.loadColumnSelection(cardsOrNotes) inside launchCatchingViewTask. That is progressManager.withProgress { previewColumnHeadings(cardsOrNotes) }. previewColumnHeadings keeps activeColumns when the dialog mode matches the browser, otherwise reads BrowserColumnCollection from prefs. It then ColumnWithSample.loadSample on the first row: allBrowserColumns(), and, when a row exists, setActiveBrowserColumns for every column key, browserRowForId, then restores the previous keys in finally. The fragment splits that pair into the active and available recycler sections. The short-click path showColumnSelectionDialog still calls previewColumnHeadings with no progress wrapper.

showFindAndReplaceDialog calls activityViewModel.loadFindAndReplaceNoteIds(), which is progressManager.withProgress { queryAllSelectedNoteIds() }. That delegates to selectedRows.queryNoteIds: notes mode returns the in-memory ids; cards mode calls notesOfCards on the collection. After that returns, FindAndReplaceDialogFragment.newInstance is shown. The later findAndReplace op still has its own withProgress around the undoable replace, and it queries the selection again. showEditTagsDialog still calls queryAllSelectedNoteIds with no wrapper.

The lambda receiver inside withProgress is ProgressScope. previewColumnHeadings and queryAllSelectedNoteIds resolve on the outer CardBrowserViewModel. Neither helper starts its own progress, so these wrappers are not nested.

some acceptable findings, no action required, just leaving for posterity: Approach is check commit (the commit body already says what the two methods do); showColumnSelectionDialog still calls previewColumnHeadings directly, so a short click on a column heading does not publish progress; showEditTagsDialog still calls queryAllSelectedNoteIds directly, the same lookup loadFindAndReplaceNoteIds now wraps.

@mikehardy mikehardy added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Nov 3, 2026
@ZornHadNoChoice

Copy link
Copy Markdown
Collaborator

Is there a reason you didn't use the new "Material" loading indicator?

Screenshot_2026-11-03-13-07-19-598_com ichi2 anki

@david-allison david-allison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code looks good, awaiting consensus on @ZornHadNoChoice's query

@ZornHadNoChoice @criticalAY

Let's timebox 2 days, then merge and move standardization of progress dialogs to an issue if it's not resolved by then

@david-allison david-allison added Needs Author Reply Waiting for a reply from the original author Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) Needs reviewer reply Waiting for a reply from another reviewer and removed Needs Second Approval Has one approval, one more approval to merge labels Nov 3, 2026
@criticalAY

Copy link
Copy Markdown
Contributor Author

My “after” shot was taken on an emulator with animations off, but it does use it, sorry about the confusion fyi @ZornHadNoChoice

@david-allison david-allison removed Needs Author Reply Waiting for a reply from the original author Needs reviewer reply Waiting for a reply from another reviewer labels Nov 3, 2026
@david-allison
david-allison added this pull request to the merge queue Nov 3, 2026
@criticalAY

Copy link
Copy Markdown
Contributor Author
Screenshot 2026-11-03 at 8 11 42 PM Diuble checked its cool!

Merged via the queue into ankidroid:main with commit ac0efdc Nov 3, 2026
29 checks passed
@github-actions github-actions Bot added this to the 2.26 release milestone Nov 3, 2026
@github-actions github-actions Bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Nov 3, 2026
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.

4 participants