Skip to content

Commit d1bfbc6

Browse files
authored
Merge pull request #632 from psv2522/sliders-on-newline
fix: Move sliders to newline in settings to avoid horizontal scroll.
2 parents bc5b00e + a07f94f commit d1bfbc6

File tree

1 file changed

+65
-54
lines changed

1 file changed

+65
-54
lines changed

webview-ui/src/components/settings/SettingsView.tsx

Lines changed: 65 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,20 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
139139
}
140140
}
141141

142+
const sliderLabelStyle = {
143+
minWidth: "45px",
144+
textAlign: "right" as const,
145+
lineHeight: "20px",
146+
paddingBottom: "2px",
147+
}
148+
149+
const sliderStyle = {
150+
flexGrow: 1,
151+
maxWidth: "80%",
152+
accentColor: "var(--vscode-button-background)",
153+
height: "2px",
154+
}
155+
142156
return (
143157
<div
144158
style={{
@@ -481,22 +495,22 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
481495
</div>
482496

483497
<div style={{ marginBottom: 15 }}>
484-
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
485-
<span style={{ fontWeight: "500", minWidth: "100px" }}>Screenshot quality</span>
486-
<input
487-
type="range"
488-
min="1"
489-
max="100"
490-
step="1"
491-
value={screenshotQuality ?? 75}
492-
onChange={(e) => setScreenshotQuality(parseInt(e.target.value))}
493-
style={{
494-
flexGrow: 1,
495-
accentColor: "var(--vscode-button-background)",
496-
height: "2px",
497-
}}
498-
/>
499-
<span style={{ minWidth: "35px", textAlign: "left" }}>{screenshotQuality ?? 75}%</span>
498+
<div style={{ display: "flex", flexDirection: "column", gap: "5px" }}>
499+
<span style={{ fontWeight: "500" }}>Screenshot quality</span>
500+
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
501+
<input
502+
type="range"
503+
min="1"
504+
max="100"
505+
step="1"
506+
value={screenshotQuality ?? 75}
507+
onChange={(e) => setScreenshotQuality(parseInt(e.target.value))}
508+
style={{
509+
...sliderStyle,
510+
}}
511+
/>
512+
<span style={{ ...sliderLabelStyle }}>{screenshotQuality ?? 75}%</span>
513+
</div>
500514
</div>
501515
<p
502516
style={{
@@ -559,24 +573,20 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
559573
<div style={{ marginBottom: 40 }}>
560574
<h3 style={{ color: "var(--vscode-foreground)", margin: "0 0 15px 0" }}>Advanced Settings</h3>
561575
<div style={{ marginBottom: 15 }}>
562-
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
563-
<span style={{ fontWeight: "500", minWidth: "150px" }}>Terminal output limit</span>
564-
<input
565-
type="range"
566-
min="100"
567-
max="5000"
568-
step="100"
569-
value={terminalOutputLineLimit ?? 500}
570-
onChange={(e) => setTerminalOutputLineLimit(parseInt(e.target.value))}
571-
style={{
572-
flexGrow: 1,
573-
accentColor: "var(--vscode-button-background)",
574-
height: "2px",
575-
}}
576-
/>
577-
<span style={{ minWidth: "45px", textAlign: "left" }}>
578-
{terminalOutputLineLimit ?? 500}
579-
</span>
576+
<div style={{ display: "flex", flexDirection: "column", gap: "5px" }}>
577+
<span style={{ fontWeight: "500" }}>Terminal output limit</span>
578+
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
579+
<input
580+
type="range"
581+
min="100"
582+
max="5000"
583+
step="100"
584+
value={terminalOutputLineLimit ?? 500}
585+
onChange={(e) => setTerminalOutputLineLimit(parseInt(e.target.value))}
586+
style={{ ...sliderStyle }}
587+
/>
588+
<span style={{ ...sliderLabelStyle }}>{terminalOutputLineLimit ?? 500}</span>
589+
</div>
580590
</div>
581591
<p style={{ fontSize: "12px", marginTop: "5px", color: "var(--vscode-descriptionForeground)" }}>
582592
Maximum number of lines to include in terminal output when executing commands. When exceeded
@@ -614,26 +624,27 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
614624
enabled={experiments[EXPERIMENT_IDS.DIFF_STRATEGY] ?? false}
615625
onChange={(enabled) => setExperimentEnabled(EXPERIMENT_IDS.DIFF_STRATEGY, enabled)}
616626
/>
617-
<div style={{ display: "flex", alignItems: "center", gap: "5px", marginTop: "15px" }}>
618-
<span style={{ fontWeight: "500", minWidth: "100px" }}>Match precision</span>
619-
<input
620-
type="range"
621-
min="0.8"
622-
max="1"
623-
step="0.005"
624-
value={fuzzyMatchThreshold ?? 1.0}
625-
onChange={(e) => {
626-
setFuzzyMatchThreshold(parseFloat(e.target.value))
627-
}}
628-
style={{
629-
flexGrow: 1,
630-
accentColor: "var(--vscode-button-background)",
631-
height: "2px",
632-
}}
633-
/>
634-
<span style={{ minWidth: "35px", textAlign: "left" }}>
635-
{Math.round((fuzzyMatchThreshold || 1) * 100)}%
636-
</span>
627+
<div
628+
style={{ display: "flex", flexDirection: "column", gap: "5px", marginTop: "15px" }}>
629+
<span style={{ fontWeight: "500" }}>Match precision</span>
630+
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
631+
<input
632+
type="range"
633+
min="0.8"
634+
max="1"
635+
step="0.005"
636+
value={fuzzyMatchThreshold ?? 1.0}
637+
onChange={(e) => {
638+
setFuzzyMatchThreshold(parseFloat(e.target.value))
639+
}}
640+
style={{
641+
...sliderStyle,
642+
}}
643+
/>
644+
<span style={{ ...sliderLabelStyle }}>
645+
{Math.round((fuzzyMatchThreshold || 1) * 100)}%
646+
</span>
647+
</div>
637648
</div>
638649
<p
639650
style={{

0 commit comments

Comments
 (0)