Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Align inspector controls and tighten ranges

Bitti003180657737
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 8bed066..c4d46cd 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -13,7 +13,7 @@ Changes since 0.3.2.
- **Image batches.** Queue up to 100 images with different seeds from the Generate dropdown.
- **Generation effects.** Added LCS color steering, tone, sharpness and color stabilization, with step ranges and optional regions on supported models.
- **Generator controls.** Group generators and LoRAs by model, group generator dropdown choices, and enable editing per template.
-- **Inspector controls.** Added bounded sliders, editable effect values and compact, centered action buttons.
+- **Inspector controls.** Added sliders and editable values with consistent widths and practical ranges (up to 100 steps), plus compact, centered action buttons.
## Fixes and improvements
diff --git a/src/components/workspace/SliderNumberInput.test.tsx b/src/components/workspace/SliderNumberInput.test.tsx
index 2f36788..d8c0d46 100644
--- a/src/components/workspace/SliderNumberInput.test.tsx
+++ b/src/components/workspace/SliderNumberInput.test.tsx
@@ -25,8 +25,8 @@ it("synchronizes dragging, keyboard edits and range enforcement without erasing
fireEvent.change(field, { target: { value: "999" } });
expect(changed).toHaveBeenLastCalledWith(3.7);
fireEvent.blur(field);
- expect(field).toHaveValue(100);
- expect(bar).toHaveValue("100");
+ expect(field).toHaveValue(20);
+ expect(bar).toHaveValue("20");
fireEvent.change(field, { target: { value: "-1" } });
fireEvent.blur(field);
expect(field).toHaveValue(0.1);
@@ -44,5 +44,5 @@ it("keeps integer controls integral and both controls disabled together", () =>
expect(field).toBeDisabled();
expect(screen.getByRole("slider")).toBeDisabled();
expect(field).toHaveAttribute("min", "2");
- expect(field).toHaveAttribute("max", "1000");
+ expect(field).toHaveAttribute("max", "100");
});
diff --git a/src/components/workspace/SliderNumberInput.tsx b/src/components/workspace/SliderNumberInput.tsx
index d988110..f3ee3b6 100644
--- a/src/components/workspace/SliderNumberInput.tsx
+++ b/src/components/workspace/SliderNumberInput.tsx
@@ -1,29 +1,27 @@
-import type { ComponentProps, CSSProperties } from "react";
+import type { ComponentProps } from "react";
import { Slider } from "../ui";
import { CommittedNumberInput } from "./CommittedNumberInput";
-/** One bounded value, editable by dragging or typing. Keep number widths large
- * enough for the range, sign and fractional precision without crowding the bar. */
+/** One bounded value, editable by dragging or typing, with shared column widths
+ * so ranges, values and optional units do not shift neighboring controls. */
export function SliderNumberInput({ minimum, maximum, value, step = 1, sliderLabel, suffix, disabled, onCommit, ...input }: Omit<ComponentProps<typeof CommittedNumberInput>, "step"> & {
step?: number;
sliderLabel?: string;
suffix?: string;
}) {
const label = input["aria-label"] ?? "Value";
- const precision = Math.min(6, String(step).split(".")[1]?.length ?? 0);
- const digits = Math.max(String(minimum.toFixed(precision)).length, String(maximum.toFixed(precision)).length, String(value).length);
const range = `${minimum} to ${maximum}`;
const change = (next: number) => { if (!disabled) onCommit(next); };
- return <div className="slider-number" style={{ "--number-width": `${Math.max(4, digits)}ch` } as CSSProperties}>
+ return <div className="slider-number">
<Slider aria-label={sliderLabel ?? `${label} slider`} min={minimum} max={maximum} step={step}
value={value} disabled={disabled} title={range} onChange={change} />
<CommittedNumberInput {...input} className={`text-field slider-number__input ${input.className ?? ""}`}
minimum={minimum} maximum={maximum} step={step} value={value} disabled={disabled} title={input.title ?? range} onCommit={change} />
- {suffix && <span className="slider-number__unit" aria-hidden="true">{suffix.trim()}</span>}
+ <span className="slider-number__unit" aria-hidden="true">{suffix?.trim()}</span>
</div>;
}
/** Inspector editing ranges; persisted projects and engine limits stay intact. */
-export const GENERATION_STEPS_RANGE = { minimum: 2, maximum: 1000, step: 1, integer: true } as const;
-export const SIGMA_SHIFT_RANGE = { minimum: 0.1, maximum: 100, step: 0.1 } as const;
-export const CFG_RANGE = { minimum: 0, maximum: 30, step: 0.1 } as const;
+export const GENERATION_STEPS_RANGE = { minimum: 2, maximum: 100, step: 1, integer: true } as const;
+export const SIGMA_SHIFT_RANGE = { minimum: 0.1, maximum: 20, step: 0.1 } as const;
+export const CFG_RANGE = { minimum: 0, maximum: 10, step: 0.1 } as const;
diff --git a/src/components/workspace/TimelineView.tsx b/src/components/workspace/TimelineView.tsx
index 31fdf43..cf69397 100644
--- a/src/components/workspace/TimelineView.tsx
+++ b/src/components/workspace/TimelineView.tsx
@@ -1521,9 +1521,8 @@ export function TimelineView({ config, folderPath, generationCompletionTimes = {
<PropRow label="Speed" htmlFor="clip-speed" value={clipPlaybackRate(selected)} defaultValue={1}
onReset={speedDisabled ? undefined : () => changeSpeed(100)}
tooltip="100% is normal speed. Changes duration while keeping the same source range and moving later clips on this track. Audio pitch changes with speed.">
- <SliderNumberInput id="clip-speed" className="text-field" aria-label="Clip speed" minimum={MIN_CLIP_SPEED * 100} maximum={MAX_CLIP_SPEED * 100} step={1}
+ <SliderNumberInput id="clip-speed" className="text-field" aria-label="Clip speed" minimum={MIN_CLIP_SPEED * 100} maximum={MAX_CLIP_SPEED * 100} step={1} suffix="%"
value={Number((clipPlaybackRate(selected) * 100).toFixed(2))} disabled={speedDisabled} onCommit={changeSpeed} />
- <span className="inspector-unit">%</span>
</PropRow>
<PropRow label="Starts at"><span className="inspector-value">{formatTimecode(selected.startMs, fps)}</span></PropRow>
<PropRow label="Duration" htmlFor="clip-duration">
@@ -1556,8 +1555,7 @@ export function TimelineView({ config, folderPath, generationCompletionTimes = {
onReset={visualControlsDisabled ? undefined : () => updateTransform(key, fallback)}
scrub={visualControlsDisabled ? undefined : { value, onChange: (next) => updateTransform(key, next), min: minimum, max: maximum, step: 1 }}
>
- <SliderNumberInput id={`clip-${key}`} className="text-field" aria-label={label} minimum={minimum} maximum={maximum} step={1} value={value} disabled={visualControlsDisabled} onCommit={(next) => updateTransform(key, next)} />
- <span className="inspector-unit">{unit}</span>
+ <SliderNumberInput id={`clip-${key}`} className="text-field" aria-label={label} minimum={minimum} maximum={maximum} step={1} suffix={unit} value={value} disabled={visualControlsDisabled} onCommit={(next) => updateTransform(key, next)} />
</PropRow>;
})}
</PropSection>
diff --git a/src/styles/ui.css b/src/styles/ui.css
index 380ea6a..8d2ba52 100644
--- a/src/styles/ui.css
+++ b/src/styles/ui.css
@@ -852,7 +852,8 @@
}
.slider-number {
- display: flex;
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) 64px 32px;
align-items: center;
gap: var(--space-1);
flex: 1;
@@ -860,14 +861,12 @@
}
.slider-number > .ui-slider {
- flex: 1 1 0;
- width: 0;
- min-width: 24px;
+ width: 100%;
+ min-width: 0;
}
.ui-prop-row__value .slider-number > .slider-number__input.text-field {
- flex: none;
- width: calc(var(--number-width) + 12px);
+ width: 100%;
min-width: 0;
height: var(--control-sm);
padding-inline: 5px;
@@ -876,7 +875,6 @@
}
.slider-number__unit {
- flex: none;
color: var(--text-secondary);
font-size: var(--text-xs);
}