KQ-2100 · CONSOLE/SHELL

Console Shell

An editor-style frame for a firmware project — title bar, file explorer, an editor with file tabs, a bottom panel for problems, output and a console, and a slim status bar — whose panel is pulled up by its edge: the edge follows the finger 1:1 with rubber-band past full height, and on release the height is projected with the release velocity and committed to the nearest snap point (closed, a quarter, half or full) on springs.glide carrying the throw's velocity. Closed, only the status bar is left, and its error and warning counts roll one face on springs.snap the way they moved when new problems arrive while their chip warms once; the panel's tab indicator slides on snap and choosing a problem opens its line in the editor. Cmd or Ctrl+J toggles the panel, F6 moves focus between explorer, editor, panel and status bar, the edge is a separator stepped by arrow keys, and in a narrow container the panel opens as a full-height sheet.

KQ-2100 · CONSOLE/SHELL

Gaugeworks · gauge-fw

  1. #include "sensor.h"
  2. #include "board.h"
  3. #define SAMPLE_HZ 200
  4. #define SMOOTHING 0.12f
  5. static float level = 0.0f;
  6. static uint16_t raw_last;
  7. void sensor_init(void) {
  8. adc_enable(ADC_CH_GAUGE);
  9. timer_start(TIMER_SAMPLE, SAMPLE_HZ);
  10. }
  11. float sensor_read(void) {
  12. uint16_t raw = adc_read(ADC_CH_GAUGE);
  13. level += SMOOTHING * (raw_scaled(raw) - level);
  14. raw_last = raw
  15. return level;
  16. }
  17. int sensor_selftest(void) {
  18. if (raw_last == 0) return -1; // no sample yet
  19. return calibrate(raw_last, &level);
  20. }
Build failed

panel quarter · problems · 2 errors 3 warnings · build failed

Install

One command — the source lands in your repo. Or copy it from the Code tab.

$ pnpm dlx shadcn@latest add @kinetiq/console-shell

Props

files
ConsoleFile[]
default defaultConsoleFiles
The project's files: { id, name, folder, lines }. The explorer groups them by folder; C and TOML get light colouring.
defaultFile
string
default the first file with a problem
The file open first.
problems
ConsoleProblem[]
default defaultConsoleProblems
What the last build found: { id, file, line, col?, severity: error | warning | info, message }. Counts in the status bar roll when this grows.
output
ConsoleLine[]
default defaultConsoleOutput
The build log: { id, text, tone?: muted | error | warn | success | command }.
history
ConsoleLine[]
default defaultConsoleHistory
The console's history, oldest first; the host appends what a command printed.
tab / defaultTab
"problems" | "output" | "console"
default "problems"
The panel's tab, controlled or initial.
onTabChange
(tab) => void
default —
Fires from the tablist, the status counts or the Build button that changed the tab.
panel / defaultPanel
number
default 0
The panel's height as a share of the space above the status bar, 0 (closed) to 1, controlled or initial. On a phone any open value shows as the full-height sheet.
onPanelResize
(height: number) => void
default —
Fires when a drag, key or button settles the panel on a new height.
onRunCommand
(command: string) => void
default —
A command was entered in the console, or Build was pressed ("build").
onOpenProblem
(problem: ConsoleProblem) => void
default —
A problem was chosen; the editor has already opened its file and highlighted its line.
build
"idle" | "building" | "passed" | "failed"
default "failed"
The build's state in the status bar: a progress line and spinner while building, a danger tint when it failed.
buildProgress
number
default 0
While building, how far along, 0 to 1.
statusItems
{ id: string; label: string }[]
default Ln/Col, encoding, board
Items on the right of the status bar (from a 40rem container).
project
string
default "Gaugeworks · gauge-fw"
The project's name in the title bar and the frame's accessible name.
branch
string
default "main"
The branch in the status bar.
frameHeight
number
default 520
The frame's height in px.
snapPoints
"quarter" | "half" | "free"
default "quarter"
Where the panel can rest: closed, a quarter, half or full; closed, half or full; or anywhere it is let go (with momentum).
statusStyle
"counts" | "pills" | "minimal"
default "counts"
How the status bar shows problems: icons and rolling numbers, tinted pills, or one dot and a phrase.
accent
"cobalt" | "plum" | "mint" | "ink" | string
default "cobalt"
Focus, selection, the panel's edge, keywords and the build progress; any CSS colour works.
disabled
boolean
default false
Read only: the panel cannot move and nothing runs.
className
string
default —
Classes for the frame.