Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
`scenarios/*.rb` (one chapter each, listed in `scenarios.rb`). Delivery chapters use `repo.rb` (fake git),
`delivery_commands.rb` (git, gh, bin/rails test, deploy), `delivery_ci.rb` and `delivery_world.rb`.
- `frontend/`: React + TypeScript (Vite), xterm.js terminal. Play screen is `src/components/PlayScreen.tsx`.
- UI follows Royal's UI style rules (Geist, motion, accessibility) with this app's own "System map" theme in
- UI follows Royal's UI style rules (motion, accessibility). Type: Space Grotesk headings, Geist body, JetBrains Mono for terminal and labels, with this app's own "System map" theme in
`frontend/src/styles.css`. Don't reuse the helpdesk look (dark sidebar + blue pill).

## Checks before opening a pull request
Expand Down
Binary file modified docs/play-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<title>DevOps Simulator</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap" rel="stylesheet" />
</head>
<body>
<div id="root"></div>
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/components/Terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface Props {

const COLORS = { amber: '\x1b[38;2;255;181;71m', green: '\x1b[38;2;75;227;161m', muted: '\x1b[38;2;142;137;176m', red: '\x1b[38;2;255;143;166m' }
const RESET = '\x1b[0m'
const FONT = '"JetBrains Mono", ui-monospace, monospace'

// A small line editor on top of xterm.js: typing, backspace, left/right,
// history with up/down, Ctrl+C, Ctrl+L and paste. Commands go to the server.
Expand Down Expand Up @@ -68,7 +69,7 @@ export const Terminal = forwardRef<TerminalHandle, Props>(function Terminal({ pr

useEffect(() => {
const t = new XTerm({
fontFamily: '"Geist Mono", ui-monospace, monospace',
fontFamily: FONT,
fontSize: 13,
lineHeight: 1.35,
cursorBlink: true,
Expand All @@ -91,6 +92,13 @@ export const Terminal = forwardRef<TerminalHandle, Props>(function Terminal({ pr
if (dims && (dims.cols !== t.cols || dims.rows !== t.rows)) fit.fit()
})
resize.observe(host.current!)
// The web font may arrive after xterm measured its cells. Re-measure once it's loaded.
void document.fonts?.load('13px "JetBrains Mono"').then(() => {
if (term.current !== t) return
t.options.fontFamily = 'monospace'
t.options.fontFamily = FONT
if (host.current?.offsetWidth) fit.fit()
})
t.onResize(() => redrawLine())
if (intro) t.write(COLORS.muted + intro.replace(/\r?\n/g, '\r\n') + RESET + '\r\n\r\n')
redrawLine()
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
:root,
[data-theme='dark'] {
--font-sans: 'Geist', system-ui, sans-serif;
--font-mono: 'Geist Mono', ui-monospace, monospace;
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
--font-display: 'Space Grotesk', 'Geist', system-ui, sans-serif;

--ground: #0D0B1A;
--surface: #15132A;
Expand Down Expand Up @@ -48,6 +49,7 @@ body { font: 14px/1.5 var(--font-sans); color: var(--ink); background: var(--gro
h1, h2 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
button { font: inherit; color: inherit; }
h1, h2, .node-name, .metric, .chapter-n { font-family: var(--font-display); }
:focus-visible { outline: none; box-shadow: var(--focus); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
Expand Down
Loading