Skip to content

fix: keep autocomplete lists full while filtering - #700

Merged
surajshetty3416 merged 7 commits into
frappe:developfrom
stravo1:autocomplete-fill-options
Jul 31, 2026
Merged

fix: keep autocomplete lists full while filtering#700
surajshetty3416 merged 7 commits into
frappe:developfrom
stravo1:autocomplete-fill-options

Conversation

@stravo1

@stravo1 stravo1 commented Jul 28, 2026

Copy link
Copy Markdown
Member

Each getOptions implementation filtered and capped its own list. Once an item was selected the list showed no extra options.

Add filterOptions, which puts the matches for a query first, fills the rest of the list with the other options, and stops at the limit. This way some options other than the selected one stay visible when available.

filterOptions takes limit and windowRadius in one options object. Without windowRadius it keeps the matches first, then fills the rest of the list. With windowRadius it keeps each match at its original position and shows the options around it.

Before:

Screen.Recording.2026-07-28.at.6.19.38.PM.mov

After:

Screen.Recording.2026-07-28.at.6.19.10.PM.mov

Each getOptions implementation filtered and capped its own list.
Once an item is selected the list showed no extra options.

Add filterOptions, which puts the matches for a query first, fills the
rest of the list with the other options, and stops at 20 items.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment thread frontend/src/components/BlockPropertySections/TypographySection.ts
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (8): Last reviewed commit: "fix: window color variable options aroun..." | Re-trigger Greptile

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.59%. Comparing base (1cd39a0) to head (9e56746).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #700   +/-   ##
========================================
  Coverage    57.59%   57.59%           
========================================
  Files           35       35           
  Lines         4271     4271           
========================================
  Hits          2460     2460           
  Misses        1811     1811           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The default font list took whatever the user font list left over. Non-matching
user fonts fill that list, so 20 or more user fonts used the whole limit. A
default font that matched the query never reached the dropdown. Each list now
filters against its own limit.

@surajshetty3416 surajshetty3416 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.

@stravo1 I don't this selected option should be first... it should be at its place following the sequence but checked/highlighted

@frappe frappe deleted a comment from obs3rv3 Jul 29, 2026
stravo1 and others added 2 commits July 30, 2026 01:42
filterOptions now takes limit and windowRadius in one options object.
Without windowRadius it keeps the matches first, then fills the rest of
the list. With windowRadius it keeps each match at its original position
and shows the options around it.

Only the font family list passes windowRadius. The color picker, the
css keyword list, the analytics filters, the visibility input, and the
dynamic value dropdown keep their current behavior.
filterOptions kept matches in place only when a caller passed a radius,
and each caller had to tune the upper and lower halves itself. Now every
caller gets the same window: a limit-sized slice with the match a third
of the way down, so its neighbours stay visible.

Color variables come from the store newest-first, so a match had unrelated
neighbours. Sort them by name before filtering.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@stravo1
stravo1 requested a review from surajshetty3416 July 30, 2026 11:26
stravo1 and others added 3 commits July 30, 2026 17:57
A partial query now returns only the matching options. An exact
match, which is the selected value on focus, returns a window
around the selection: up to 3 neighbours above, the rest below,
clamped at both ends of the list.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Place the selection about a third of the window from the top
instead of a fixed neighbour count.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@stravo1
stravo1 force-pushed the autocomplete-fill-options branch from a68c4ed to 9e56746 Compare July 30, 2026 13:06
@surajshetty3416
surajshetty3416 merged commit ac45157 into frappe:develop Jul 31, 2026
10 of 11 checks passed
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.

2 participants