Skip to content

fix: type colors into the Background field and keep its label in sync - #816

Merged
surajshetty3416 merged 3 commits into
frappe:developfrom
surajshetty3416:background-field-typed-colors
Sep 10, 2026
Merged

fix: type colors into the Background field and keep its label in sync#816
surajshetty3416 merged 3 commits into
frappe:developfrom
surajshetty3416:background-field-typed-colors

Conversation

@surajshetty3416

@surajshetty3416 surajshetty3416 commented Sep 10, 2026

Copy link
Copy Markdown
Member

Follow-ups to #813 for the Background field.

  • Text selects on focus, for Background and Text Color. Autocomplete gains selectOnFocus; select() is skipped when a popover already took the focus on that same focus, since it would hand it back and toggle the popover shut.
  • Typed colors apply. A hex (with or without #), rgb, hsl or image path typed into the field sets the background; anything else is ignored and the label restored. parseBackground decides what a value means, for the base value and for state variants, while the "copy current value to state" path still copies the real base styles.
  • The label follows the popup. Autocomplete skipped syncing its text while its list was open, and the list never closed once the picker popover took the focus, so a color picked there left "Gradient" in the field. Model changes now always sync the text; only option refreshes wait for the list to close.

The field selects its text on focus (Text Color too), accepts a typed
hex, rgb, hsl or image path, and ignores anything else. The Autocomplete
now syncs its text on every model change, even under an open list, so a
color picked in the popover replaces the "Gradient" label, and it
restores the model's text after a submission the owner rejected.

Co-Authored-By: Claude <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

Safe to merge; the previous malformed-color issue is fixed and resolved, with no new actionable findings.

Reviews (3) · Last reviewed commit: "chore: trim comments around the Backgrou..."

Comment thread frontend/src/components/BackgroundHandler.vue Outdated
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.89%. Comparing base (acc4c1b) to head (f7211b6).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #816   +/-   ##
========================================
  Coverage    66.89%   66.89%           
========================================
  Files           94       94           
  Lines        10505    10505           
========================================
  Hits          7027     7027           
  Misses        3478     3478           

☔ 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.

surajshetty3416 and others added 2 commits September 10, 2026 10:18
A prefix check let #zzz or an unfinished rgb( through and cleared a
real background image. The browser's own parser decides now.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@surajshetty3416
surajshetty3416 merged commit 29390dd into frappe:develop Sep 10, 2026
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.

1 participant