Skip to content

feat(card-browser): implement 'Default search text'#20955

Open
david-allison wants to merge 4 commits into
ankidroid:mainfrom
david-allison:18618-default-search-text
Open

feat(card-browser): implement 'Default search text'#20955
david-allison wants to merge 4 commits into
ankidroid:mainfrom
david-allison:18618-default-search-text

Conversation

@david-allison
Copy link
Copy Markdown
Member

@david-allison david-allison commented May 5, 2026

Note

Assisted-by: Claude Opus 4.7

Purpose / Description

Upstream functionality, only implemented in the new card browser

Fixes

Approach

I performed a few initial refactors, partially as logic shouldn't be in the saveChanges method, partially to reduce the code in the ViewModel

  • Adds a 'Default search text' control to the Browser options
  • If set, uses this as the default search text
    • Only if the search text wasn't set through other means (intent etc...)

How Has This Been Tested?

Screenshot 2026-05-05 at 19 03 09

Unit tests

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
    • I have fixed all but a contrast warning(light mode only), which falsely detects that the border should meet the standard for text (3.0:1 is for for the border, it wants 4.5:1). This change would negatively impact the visual hierarchy: the border should be less prominent than the hint

* Simplifies the ViewModel, it's getting large

Assisted-by: Claude Opus 4.7 - all
Assisted-by: Claude Opus 4.7 - all
Fixes 18618

Assisted-by: Claude Opus 4.7 - all
android:textColorHint was #79747E. On #E4F5FD this led to a contrast of 4.07:1

#716C76 is 4.57:1 - acceptable for text

Assisted-by: Claude Opus 4.7 - color
@Giyutomioka-SS
Copy link
Copy Markdown
Contributor

LGTM - has a merge conflict to resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Card Browser: Implement 'Default search text'

2 participants