From a07f94fa193279a105c793deed74c45cef28c0ec Mon Sep 17 00:00:00 2001 From: Prathmesh Vhatkar Date: Wed, 29 Jan 2025 11:57:24 +0530 Subject: [PATCH] fix: Move sliders to newline in settings to avoid horizontal scroll at normal(20-25%) window size --- .../src/components/settings/SettingsView.tsx | 119 ++++++++++-------- 1 file changed, 65 insertions(+), 54 deletions(-) diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index 43b1e5a..d7e5580 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -139,6 +139,20 @@ const SettingsView = ({ onDone }: SettingsViewProps) => { } } + const sliderLabelStyle = { + minWidth: "45px", + textAlign: "right" as const, + lineHeight: "20px", + paddingBottom: "2px", + } + + const sliderStyle = { + flexGrow: 1, + maxWidth: "80%", + accentColor: "var(--vscode-button-background)", + height: "2px", + } + return (
{
-
- Screenshot quality - setScreenshotQuality(parseInt(e.target.value))} - style={{ - flexGrow: 1, - accentColor: "var(--vscode-button-background)", - height: "2px", - }} - /> - {screenshotQuality ?? 75}% +
+ Screenshot quality +
+ setScreenshotQuality(parseInt(e.target.value))} + style={{ + ...sliderStyle, + }} + /> + {screenshotQuality ?? 75}% +

{

Advanced Settings

-
- Terminal output limit - setTerminalOutputLineLimit(parseInt(e.target.value))} - style={{ - flexGrow: 1, - accentColor: "var(--vscode-button-background)", - height: "2px", - }} - /> - - {terminalOutputLineLimit ?? 500} - +
+ Terminal output limit +
+ setTerminalOutputLineLimit(parseInt(e.target.value))} + style={{ ...sliderStyle }} + /> + {terminalOutputLineLimit ?? 500} +

Maximum number of lines to include in terminal output when executing commands. When exceeded @@ -613,26 +623,27 @@ const SettingsView = ({ onDone }: SettingsViewProps) => { enabled={experiments[EXPERIMENT_IDS.DIFF_STRATEGY] ?? false} onChange={(enabled) => setExperimentEnabled(EXPERIMENT_IDS.DIFF_STRATEGY, enabled)} /> -

- Match precision - { - setFuzzyMatchThreshold(parseFloat(e.target.value)) - }} - style={{ - flexGrow: 1, - accentColor: "var(--vscode-button-background)", - height: "2px", - }} - /> - - {Math.round((fuzzyMatchThreshold || 1) * 100)}% - +
+ Match precision +
+ { + setFuzzyMatchThreshold(parseFloat(e.target.value)) + }} + style={{ + ...sliderStyle, + }} + /> + + {Math.round((fuzzyMatchThreshold || 1) * 100)}% + +