Update binary fills flag name and add it to supported flags

This commit is contained in:
Belén Albeza 2025-05-29 09:50:12 +02:00
parent c0a98288d0
commit f33c1fb530
8 changed files with 12 additions and 11 deletions

View file

@ -127,7 +127,8 @@
:render-wasm-dpr
:hide-release-modal
:subscriptions
:subscriptions-old})
:subscriptions-old
:frontend-binary-fills})
(def all-flags
(set/union email login varia))

View file

@ -153,7 +153,7 @@ test("Create a RADIAL gradient", async ({ page }) => {
test("Gradient stops limit", async ({ page }) => {
const workspacePage = new WorkspacePage(page);
await workspacePage.mockConfigFlags(["enable-binary-fills"]);
await workspacePage.mockConfigFlags(["enable-frontend-binary-fills"]);
await workspacePage.setupEmptyFile(page);
await workspacePage.mockRPC(
"get-file-fragment?file-id=*&fragment-id=*",

View file

@ -71,7 +71,7 @@ test.describe("Shape attributes", () => {
page,
}) => {
const workspace = new WorkspacePage(page);
await workspace.mockConfigFlags(["enable-binary-fills"]);
await workspace.mockConfigFlags(["enable-frontend-binary-fills"]);
await workspace.setupEmptyFile();
await workspace.mockRPC(/get\-file\?/, "design/get-file-fills-limit.json");

View file

@ -822,7 +822,7 @@
(update [_ state]
(update state :colorpicker
(fn [{:keys [stops editing-stop] :as state}]
(let [cap-stops? (or (features/active-feature? state "render-wasm/v1") (contains? cfg/flags :binary-fills))
(let [cap-stops? (or (features/active-feature? state "render-wasm/v1") (contains? cfg/flags :frontend-binary-fills))
can-add-stop? (or (not cap-stops?) (< (count stops) shp/MAX-GRADIENT-STOPS))]
(if can-add-stop?
(if (cc/uniform-spread? stops)
@ -868,7 +868,7 @@
(update state :colorpicker
(fn [state]
(let [stops (:stops state)
cap-stops? (or (features/active-feature? state "render-wasm/v1") (contains? cfg/flags :binary-fills))
cap-stops? (or (features/active-feature? state "render-wasm/v1") (contains? cfg/flags :frontend-binary-fills))
can-add-stop? (or (not cap-stops?) (< (count stops) shp/MAX-GRADIENT-STOPS))]
(if can-add-stop? (let [new-stop (-> (cc/interpolate-gradient stops offset)
(split-color-components))
@ -889,7 +889,7 @@
(update state :colorpicker
(fn [state]
(let [stop (or (:editing-stop state) 0)
cap-stops? (or (features/active-feature? state "render-wasm/v1") (contains? cfg/flags :binary-fills))
cap-stops? (or (features/active-feature? state "render-wasm/v1") (contains? cfg/flags :frontend-binary-fills))
stops (mapv split-color-components (if cap-stops? (take shp/MAX-GRADIENT-STOPS stops) stops))]
(-> state
(assoc :current-color (get stops stop))

View file

@ -338,7 +338,7 @@
(fn [value]
(st/emit! (dc/update-colorpicker-gradient-opacity (/ value 100)))))
cap-stops? (or (features/use-feature "render-wasm/v1") (contains? cfg/flags :binary-fills))
cap-stops? (or (features/use-feature "render-wasm/v1") (contains? cfg/flags :frontend-binary-fills))
tabs
#js [#js {:aria-label (tr "workspace.libraries.colors.rgba")

View file

@ -287,7 +287,7 @@
(fn []
(when on-reverse-stops
(on-reverse-stops))))
cap-stops? (or (features/use-feature "render-wasm/v1") (contains? cfg/flags :binary-fills))
cap-stops? (or (features/use-feature "render-wasm/v1") (contains? cfg/flags :frontend-binary-fills))
add-stop-disabled? (when cap-stops? (>= (count stops) shp/MAX-GRADIENT-STOPS))]
[:div {:class (stl/css :gradient-panel)}

View file

@ -56,7 +56,7 @@
values (d/without-nils values)
fills (:fills values)
has-fills? (or (= :multiple fills) (some? (seq fills)))
can-add-fills? (and (contains? cfg/flags :binary-fills) (not (= :multiple fills)) (< (count fills) shp/MAX-FILLS))
can-add-fills? (and (contains? cfg/flags :frontend-binary-fills) (not (= :multiple fills)) (< (count fills) shp/MAX-FILLS))
state* (mf/use-state has-fills?)
open? (deref state*)

View file

@ -134,7 +134,7 @@
handler-state (mf/use-state {:display? false :offset 0 :hover nil})
cap-stops? (or (features/use-feature "render-wasm/v1") (contains? cfg/flags :binary-fills))
cap-stops? (or (features/use-feature "render-wasm/v1") (contains? cfg/flags :frontend-binary-fills))
can-add-stop? (if cap-stops? (< (count stops) shp/MAX-GRADIENT-STOPS) true)
endpoint-on-pointer-down
@ -525,7 +525,7 @@
shape (mf/deref shape-ref)
state (mf/deref refs/colorpicker)
gradient (:gradient state)
cap-stops? (or (features/use-feature "render-wasm/v1") (contains? cfg/flags :binary-fills))
cap-stops? (or (features/use-feature "render-wasm/v1") (contains? cfg/flags :frontend-binary-fills))
stops (if cap-stops?
(vec (take shp/MAX-GRADIENT-STOPS (:stops state)))
(:stops state))