Skip to content

fix(browser): ANR on saved saved search previews - #22824

Merged
david-allison merged 1 commit into
ankidroid:mainfrom
david-allison:air/metered-confirmation-recreation-lucid-caribou
Oct 28, 2026
Merged

david-allison merged 1 commit into
ankidroid:mainfrom
david-allison:air/metered-confirmation-recreation-lucid-caribou

Conversation

@david-allison

Copy link
Copy Markdown
Member

Note

Assisted-by: GPT-6.1-Sol xhigh

Purpose / Description

Describe the problem or feature and motivation

Fixes

Approach

Limit saved search names & queries to 500 characters, to prevent ANRs.

How Has This Been Tested?

Screenshot test added; no regression for the ANR

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

Limit saved search names & queries to 500 characters, to prevent ANRs.

Fixes 22820

Assisted-by: GPT-6.1-Sol xhigh
@github-actions

Copy link
Copy Markdown
Contributor

Snapshot diff report vs main. Open screenshot-diff for diffs.

  • StandardSearchFragmentScreenshotTest: 1 change
All 1 changed screenshots

StandardSearchFragmentScreenshotTest

  • large_saved_search_previews_compare.png

@david-allison

david-allison commented Oct 27, 2026 •

Copy link
Copy Markdown
Member Author

Note: this is the redesign after a battle with edge to edge, just focus on the saved searches for now 😆

large_saved_search_previews_compare

@criticalAY criticalAY left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool!

@criticalAY
criticalAY added this pull request to the merge queue Oct 28, 2026
@criticalAY
criticalAY removed this pull request from the merge queue due to a manual request Oct 28, 2026
@criticalAY criticalAY added the Needs Second Approval Has one approval, one more approval to merge label Oct 28, 2026

@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: GPT-6.1-Sol xhigh

Thank you — the stack lines up with this row, the click still submits the full saved search, and the new screenshot shows the long row clipped with the short row left whole.

Clean replay onto ankidroid/main with no push (act SHA unchanged). Local validation: lintAll/ktlintCheck/lint-rules:test, jacocoUnitTestReport, and TEST_RELEASE_BUILD=true emulator tests on emulator-5556 / API35_GAPI — all passed.

SavedSearchAdapter.getView now assigns ellipsize(500) for both name and query before the row is returned, so the measure that follows sees at most 500 characters plus …. Taps still call submitSavedSearch(item) and applySavedSearch(item) with the uncut SavedSearch. maxLines 2 and 3 with ellipsize="end" clip the preview after the string is already bounded. The Roborazzi compare shows “Long name” on two lines ending in an ellipsis, the nid: list on three lines ending in an ellipsis, and “Short name” / tag:short in full.

some acceptable findings, no action required, just leaving for posterity: “saved saved” in title; Purpose still template placeholder; pixel clip alone would not prove the 500-char cut; Manage saved searches still binds full strings without maxLines; Assisted-by does not say which part was AI-written.

Screenshot changes have been detected, so leaving this for a good manual look.

@david-allison
david-allison added this pull request to the merge queue Oct 28, 2026
@david-allison david-allison added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels Oct 28, 2026
Merged via the queue into ankidroid:main with commit 47010a8 Oct 28, 2026
26 checks passed
@github-actions github-actions Bot added this to the 2.26 release milestone Oct 28, 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 Oct 28, 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.

ANR: nComputeLines

3 participants