Nicer UI for allowed command pills (#37)

This commit is contained in:
Matt Rubens
2024-12-01 22:24:53 -05:00
committed by GitHub
parent adc438fb0d
commit ccb973ecaf

View File

@@ -237,17 +237,36 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
</VSCodeButton> </VSCodeButton>
</div> </div>
<div style={{ marginTop: '10px' }}> <div style={{
marginTop: '10px',
display: 'flex',
flexWrap: 'wrap',
gap: '5px'
}}>
{(allowedCommands ?? []).map((cmd, index) => ( {(allowedCommands ?? []).map((cmd, index) => (
<div key={index} style={{ <div key={index} style={{
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
gap: '5px', gap: '5px',
marginBottom: '5px' backgroundColor: 'var(--vscode-button-secondaryBackground)',
padding: '2px 6px',
borderRadius: '4px',
border: '1px solid var(--vscode-button-secondaryBorder)',
height: '24px'
}}> }}>
<span>{cmd}</span> <span>{cmd}</span>
<VSCodeButton <VSCodeButton
appearance="icon" appearance="icon"
style={{
padding: 0,
margin: 0,
height: '20px',
width: '20px',
minWidth: '20px',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}}
onClick={() => { onClick={() => {
const newCommands = (allowedCommands ?? []).filter((_, i) => i !== index) const newCommands = (allowedCommands ?? []).filter((_, i) => i !== index)
setAllowedCommands(newCommands) setAllowedCommands(newCommands)