loads of UI improvements, also improves the console UI

This commit is contained in:
2026-09-03 09:14:30 +02:00
parent 37d15a29f0
commit 03e1f90515
16 changed files with 1108 additions and 81 deletions

View File

@@ -14,12 +14,41 @@ export type DiffMode = 'original' | 'updated' | 'diff'
/** Soft wrap of long lines: never, always, or only in Markdown files. */
export type WordWrap = 'off' | 'on' | 'markdown'
/** xterm's colour table. Every value is a CSS colour; the selection entries
* may carry alpha, the rest may not. */
export interface TerminalTheme {
background: string; foreground: string; cursor: string; cursorAccent: string
selectionBackground: string; selectionInactiveBackground: string
black: string; red: string; green: string; yellow: string
blue: string; magenta: string; cyan: string; white: string
brightBlack: string; brightRed: string; brightGreen: string; brightYellow: string
brightBlue: string; brightMagenta: string; brightCyan: string; brightWhite: string
}
export interface HelderConfig {
ai: { command: string; autoLaunch: boolean }
editor: { autoSave: boolean; tabSize: number; wordWrap: WordWrap }
git: { confirmDiscard: boolean; confirmStage: boolean; confirmUnstage: boolean; defaultDiffMode: DiffMode; refreshInterval: number }
files: { exclude: string[]; followGitignore: boolean }
terminal: { shell: string | null }
terminal: {
/** Login shell for both panes. null = $SHELL. */
shell: string | null
/** null = follow the CSS vars (--code-font / --term-size in theme.css). */
fontFamily: string | null
fontSize: number | null
lineHeight: number
letterSpacing: number
cursorStyle: 'bar' | 'block' | 'underline'
cursorBlink: boolean
/** Paint bold text in the bright colour. Off keeps bold in its own hue,
* which stops a CLI's bold labels from washing out. */
boldIsBright: boolean
scrollback: number
/** macOS: send Option as Meta. Needed for a CLI's ⌥↵ binding; it also stops
* Option from typing accented characters, so it is off by default. */
optionIsMeta: boolean
theme: TerminalTheme
}
session: { restoreOnLaunch: boolean }
}
@@ -28,7 +57,33 @@ export const DEFAULTS: HelderConfig = {
editor: { autoSave: false, tabSize: 4, wordWrap: 'markdown' },
git: { confirmDiscard: true, confirmStage: false, confirmUnstage: false, defaultDiffMode: 'diff', refreshInterval: 10000 },
files: { exclude: [], followGitignore: false },
terminal: { shell: null },
terminal: {
shell: null,
fontFamily: null,
fontSize: null,
lineHeight: 1.35,
letterSpacing: 0,
cursorStyle: 'bar',
cursorBlink: true,
boldIsBright: false,
scrollback: 8000,
optionIsMeta: false,
// The app's own palette: charcoal ground, the accent on the caret and the
// selection, and the syntax colours reused for the ANSI table so a diff in
// the terminal reads like a diff in the editor.
theme: {
background: '#24272c',
foreground: '#dde1e7',
cursor: '#f19f3f',
cursorAccent: '#24272c',
selectionBackground: 'rgba(241,159,63,0.32)',
selectionInactiveBackground: 'rgba(241,159,63,0.18)',
black: '#2b2e34', red: '#e0696a', green: '#5cbd6b', yellow: '#d8a85c',
blue: '#6aa6f0', magenta: '#c98bdb', cyan: '#6ec0c0', white: '#b0b6bf',
brightBlack: '#7a828d', brightRed: '#ef8385', brightGreen: '#77d186', brightYellow: '#edc077',
brightBlue: '#86bbf5', brightMagenta: '#dba6e9', brightCyan: '#8ad6d6', brightWhite: '#fbfcfd',
},
},
session: { restoreOnLaunch: true },
}
@@ -41,7 +96,11 @@ const THEME_TEMPLATE = `/* Helder theme — custom CSS applied OVER the built-in
/* Code surfaces (editor + terminals) */
/* --code-font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; */
/* --code-size: 13px; */ /* editor font size */
/* --term-size: 12.5px; */ /* terminal font size */
/* --term-size: 12.5px; */ /* terminal font size, unless config.json sets one */
/* The terminal's colours, cursor and scrollback live in config.json, under
"terminal" — the palette is JS options, not CSS, because xterm paints to a
canvas. Edit either file and the running terminals restyle themselves. */
/* Example accent override: */
/* --accent: #4d8dff; */