Skip to content

Commit c948b74

Browse files
author
Eric Wheeler
committed
docs: add style considerations for checkbox settings
Add documentation about styling checkbox settings in the UI, including: - Using VSCodeCheckbox component - Proper wrapping and spacing - Consistent styling for labels and descriptions - Example implementation based on terminalPowershellCounter Signed-off-by: Eric Wheeler <[email protected]>
1 parent 7ec5fac commit c948b74

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

cline_docs/settings.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,35 @@
7272
```
7373

7474
5. Add the setting to handleSubmit in SettingsView.tsx:
75+
7576
- Add a vscode.postMessage call to send the setting's value when clicking Save
7677
- This step is critical for persistence - without it, the setting will not be saved when the user clicks Save
7778
- Example:
7879
```typescript
7980
vscode.postMessage({ type: "multisearchDiffEnabled", bool: multisearchDiffEnabled })
8081
```
8182

83+
6. Style Considerations:
84+
- Use the VSCodeCheckbox component from @vscode/webview-ui-toolkit/react instead of HTML input elements
85+
- Wrap each checkbox in a div element for proper spacing
86+
- Use a span with className="font-medium" for the checkbox label inside the VSCodeCheckbox component
87+
- Place the description in a separate div with className="text-vscode-descriptionForeground text-sm mt-1"
88+
- Maintain consistent spacing between configuration options
89+
- Example:
90+
```typescript
91+
<div>
92+
<VSCodeCheckbox
93+
checked={terminalPowershellCounter ?? true}
94+
onChange={(e: any) => setCachedStateField("terminalPowershellCounter", e.target.checked)}
95+
data-testid="terminal-powershell-counter-checkbox">
96+
<span className="font-medium">{t("settings:terminal.powershellCounter.label")}</span>
97+
</VSCodeCheckbox>
98+
<div className="text-vscode-descriptionForeground text-sm mt-1">
99+
{t("settings:terminal.powershellCounter.description")}
100+
</div>
101+
</div>
102+
```
103+
82104
## For Select/Dropdown Settings
83105

84106
1. Add the message type to WebviewMessage.ts:

0 commit comments

Comments
 (0)