Fix graphical issues in the flasher patch editor
Some checks failed
CI / deploy (push) Failing after 2m57s

This commit is contained in:
Konstantin Pereiaslov 2026-11-24 11:28:07 -06:00
parent 114aac2605
commit d7d645e654
No known key found for this signature in database
GPG key ID: 24D1843DE7F39196

View file

@ -64,10 +64,15 @@ export const VkpEditor: Component<VkpEditorProps> = (props) => {
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
fontSize: '0.75rem',
lineHeight: 1.5,
// The <pre> inherits the page typography's letter spacing while the
// textarea resets it, so long lines would wrap differently.
letterSpacing: 'normal',
whiteSpace: 'pre-wrap',
overflowWrap: 'break-word',
wordBreak: 'normal',
tabSize: 4,
// Both layers keep the width of the textarea's scrollbar free.
scrollbarGutter: 'stable',
} as const;
const outlinedBorder = theme.palette.mode === 'light'
@ -107,6 +112,8 @@ export const VkpEditor: Component<VkpEditorProps> = (props) => {
<For each={tokens()}>{(t) =>
<Box component="span" sx={{ color: kindColors()[t.kind] }}>{t.text}</Box>
}</For>
{/* A textarea shows an empty last line after a trailing newline, a <pre> does not. */}
{'\n'}
</Box>
<Box
component="textarea"