Skip to content

Commit 9d07b50

Browse files
authored
remove strong and weak labels on gradient strength (#159)
* switch sides of strong and weak on gradient strength * remove weak and strong labels * update wording for decay length * update strength description text (also we should be pulling this from firebase when available * try removing gradient description * remove unused prop * fix re-run button position * set default strength_max to 1 * account for expanded description
1 parent 8e8f31f commit 9d07b50

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

src/App.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
--recipe-select-height: 52px;
55
--tab-height: 62px;
66
--footer-height: 64px;
7+
--description-height: 102px;
78
}
89

910
.app-container {

src/components/GradientInput/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface GradientInputProps {
1616
};
1717

1818
const GradientInput = (props: GradientInputProps): JSX.Element => {
19-
const { displayName, description, gradientOptions, defaultValue } = props;
19+
const { displayName, gradientOptions, defaultValue } = props;
2020
const selectedRecipeId = useSelectedRecipeId();
2121
const editRecipe = useEditRecipe();
2222
const getCurrentValue = useGetCurrentValue();
@@ -55,7 +55,6 @@ const GradientInput = (props: GradientInputProps): JSX.Element => {
5555
<div className="input-switch">
5656
<div className="input-label">
5757
<strong>{displayName}</strong>
58-
<small>{description}</small>
5958
</div>
6059
<div className="input-content">
6160
<Select
@@ -85,11 +84,9 @@ const GradientInput = (props: GradientInputProps): JSX.Element => {
8584
<div className="slider-labels">
8685
<small className="slider-label-left">
8786
<span>{gradientStrengthData.min}</span>
88-
<span>weak</span>
8987
</small>
9088
<small className="slider-label-right" style={{ marginRight: "5px" }}>
9189
<span>{gradientStrengthData.max}</span>
92-
<span>strong</span>
9390
</small>
9491
</div>
9592
</div>

src/components/RecipeForm/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
justify-content: space-between;
55
height: calc(
66
100vh - var(--header-height) - var(--recipe-select-height) -
7-
var(--tab-height) - var(--footer-height)
7+
var(--tab-height) - var(--footer-height) - var(--description-height)
88
);
99
}

src/utils/gradient.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function deriveGradientStrength(
6969
if (!opt?.strength_path) return undefined;
7070

7171
const storeMin = opt.strength_min ?? 0;
72-
const storeMax = opt.strength_max ?? 5;
72+
const storeMax = opt.strength_max ?? 1;
7373

7474
const uiMin = storeMin;
7575
const uiMax = storeMax;
@@ -81,10 +81,11 @@ export function deriveGradientStrength(
8181
? storeRaw
8282
: opt.strength_default ?? storeMin;
8383
const uiValue = round2(clampUi(storeNum));
84+
const strengthDescription = opt.strength_description || "Smaller decay length indicates stronger bias"
8485

8586
return {
8687
displayName: `Decay Length`,
87-
description: "Higher values will increase the decay length",
88+
description: strengthDescription,
8889
path: opt.strength_path,
8990
uiValue,
9091
min: uiMin,

0 commit comments

Comments
 (0)