Skip to content

Commit 0d81b4c

Browse files
tidy(ui): make names a bit clearer
1 parent 99f1667 commit 0d81b4c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

invokeai/frontend/web/src/features/controlLayers/components/Tool/ToolWidthPicker.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ const marks = [
6969

7070
const sliderDefaultValue = mapRawValueToSliderValue(50);
7171

72-
const SLIDER_PICKER_WIDTH = 280;
73-
const DROPDOWN_PICKER_WIDTH = 76;
72+
const SLIDER_VS_DROPDOWN_CONTAINER_WIDTH_THRESHOLD = 280;
7473

7574
interface ToolWidthPickerComponentProps {
7675
localValue: number;
@@ -102,7 +101,7 @@ const DropDownToolWidthPickerComponent = memo(
102101
value={localValue}
103102
onChange={onChangeNumberInput}
104103
onBlur={onBlur}
105-
w={DROPDOWN_PICKER_WIDTH}
104+
w={76}
106105
format={formatPx}
107106
defaultValue={50}
108107
onKeyDown={onKeyDown}
@@ -147,7 +146,7 @@ DropDownToolWidthPickerComponent.displayName = 'DropDownToolWidthPickerComponent
147146
const SliderToolWidthPickerComponent = memo(
148147
({ localValue, onChangeSlider, onChangeInput, onKeyDown, onBlur }: ToolWidthPickerComponentProps) => {
149148
return (
150-
<Flex w={SLIDER_PICKER_WIDTH} gap={4}>
149+
<Flex w={SLIDER_VS_DROPDOWN_CONTAINER_WIDTH_THRESHOLD} gap={4}>
151150
<CompositeSlider
152151
w={200}
153152
h="unset"
@@ -210,7 +209,7 @@ export const ToolWidthPicker = memo(() => {
210209
}
211210
const observer = new ResizeObserver((entries) => {
212211
for (let entry of entries) {
213-
if (entry.contentRect.width > SLIDER_PICKER_WIDTH) {
212+
if (entry.contentRect.width > SLIDER_VS_DROPDOWN_CONTAINER_WIDTH_THRESHOLD) {
214213
setComponentType('slider');
215214
} else {
216215
setComponentType('dropdown');

0 commit comments

Comments
 (0)