@@ -2,12 +2,13 @@ import { useMemo, useRef, useState, useEffect } from "react";
22import Editor , { type Monaco } from "@monaco-editor/react" ;
33import type { editor as MonacoEditor } from "monaco-editor" ;
44import { traceCustomSchema } from "../../api/one" ;
5- import { defineMonacoTheme , ONE_UI_MONACO_THEME } from "../../utils/monacoTheme" ;
5+ import { defineMonacoTheme , ONE_UI_EDITOR_FONT_OPTIONS , ONE_UI_MONACO_THEME } from "../../utils/monacoTheme" ;
66import { getCollectedAnnotations , getDynamicScope , getOpenFrames } from "../../utils/traceStack" ;
77import { computeJsonPositions } from "../../utils/jsonPointerPositions" ;
88import type { TraceResult } from "../../types/one" ;
99import StackVisualizer from "../TraceDebugger/StackVisualizer" ;
1010import AnnotationsPanel from "../AnnotationsPanel" ;
11+ import { STACK_FONT_KEY , STACK_FONT_OPTIONS , getStoredStackFont } from "../../utils/stackFont" ;
1112
1213const PLAY_INTERVAL_MS = 700 ;
1314const API_URL_KEY = "one-ui.customDebuggerApiUrl" ;
@@ -83,6 +84,7 @@ const CustomDebugger = ({ onClose }: { onClose: () => void }) => {
8384 const [ error , setError ] = useState < string | null > ( null ) ;
8485
8586 const [ stepIndex , setStepIndex ] = useState ( 0 ) ;
87+ const [ stackFont , setStackFont ] = useState ( getStoredStackFont ) ;
8688 const [ isPlaying , setIsPlaying ] = useState ( false ) ;
8789
8890 const instanceEditorRef = useRef < MonacoEditor . IStandaloneCodeEditor | null > ( null ) ;
@@ -315,7 +317,7 @@ const CustomDebugger = ({ onClose }: { onClose: () => void }) => {
315317 value = { schemaText }
316318 onChange = { ( value ) => setSchemaText ( value ?? "" ) }
317319 onMount = { ( editorInstance ) => ( schemaEditorRef . current = editorInstance ) }
318- options = { { minimap : { enabled : false } , fontSize : 12 .5, stickyScroll : { enabled : false } } }
320+ options = { { ... ONE_UI_EDITOR_FONT_OPTIONS , minimap : { enabled : false } , fontSize : 13 .5, stickyScroll : { enabled : false } } }
319321 />
320322 </ div >
321323 </ div >
@@ -337,18 +339,35 @@ const CustomDebugger = ({ onClose }: { onClose: () => void }) => {
337339 value = { instanceText }
338340 onChange = { ( value ) => setInstanceText ( value ?? "" ) }
339341 onMount = { ( editorInstance ) => ( instanceEditorRef . current = editorInstance ) }
340- options = { { minimap : { enabled : false } , fontSize : 12 .5, stickyScroll : { enabled : false } } }
342+ options = { { ... ONE_UI_EDITOR_FONT_OPTIONS , minimap : { enabled : false } , fontSize : 13 .5, stickyScroll : { enabled : false } } }
341343 />
342344 </ div >
343345 </ div >
344346
345347 < div className = "w-80 shrink-0 flex flex-col rounded-lg border border-[var(--border)] bg-[var(--bg-surface)] overflow-hidden" >
346348 < div className = "px-3 py-1.5 border-b border-[var(--border)]" >
347- < div className = "text-xs text-[var(--text-secondary)]" > Call Stack</ div >
348- < div className = "text-[10px] text-[var(--text-secondary)] opacity-70 mt-0.5" >
349+ < div className = "flex items-center justify-between gap-2" >
350+ < div className = "text-sm text-[var(--text-secondary)]" > Call Stack</ div >
351+ < select
352+ value = { stackFont }
353+ onChange = { ( e ) => {
354+ setStackFont ( e . target . value ) ;
355+ localStorage . setItem ( STACK_FONT_KEY , e . target . value ) ;
356+ } }
357+ title = "Font for the stack frame cards"
358+ className = "text-xs rounded-[var(--radius-sm)] border border-[var(--border-strong)] bg-[var(--bg-inset)] text-[var(--text-secondary)] px-1 py-0.5 focus:outline-none focus:border-[var(--accent)]"
359+ >
360+ { STACK_FONT_OPTIONS . map ( ( option ) => (
361+ < option key = { option . value } value = { option . value } >
362+ { option . label }
363+ </ option >
364+ ) ) }
365+ </ select >
366+ </ div >
367+ < div className = "text-xs text-[var(--text-secondary)] opacity-70 mt-0.5" >
349368 Rules currently being checked, deepest on top
350369 </ div >
351- < div className = "flex items-center gap-3 mt-1.5 text-[10px] " >
370+ < div className = "flex items-center gap-3 mt-1.5 text-xs " >
352371 < span className = "flex items-center gap-1" >
353372 < span className = "w-2 h-2 rounded-full bg-[var(--border-strong)] inline-block" />
354373 checking
@@ -368,14 +387,14 @@ const CustomDebugger = ({ onClose }: { onClose: () => void }) => {
368387 </ div >
369388 { dynamicScope . length > 1 && (
370389 < div className = "mt-2 pt-2 border-t border-[var(--border)]" >
371- < div className = "text-[10px] text-[var(--text-secondary)] opacity-70" >
390+ < div className = "text-xs text-[var(--text-secondary)] opacity-70" >
372391 Dynamic scope
373392 </ div >
374393 < div className = "flex flex-col gap-0.5 mt-1" >
375394 { dynamicScope . map ( ( resource , i ) => (
376395 < span
377396 key = { i }
378- className = "text-[10px] font-mono truncate text-[var(--accent)]"
397+ className = "text-xs truncate text-[var(--accent)]"
379398 >
380399 { resource || "(this schema)" }
381400 </ span >
@@ -385,20 +404,18 @@ const CustomDebugger = ({ onClose }: { onClose: () => void }) => {
385404 ) }
386405 </ div >
387406 { traceResult ? (
388- < StackVisualizer frames = { openFrames } />
407+ < StackVisualizer frames = { openFrames } fontFamily = { stackFont } />
389408 ) : (
390409 < div className = "flex-1 flex items-center justify-center p-4 text-center text-xs text-[var(--text-secondary)]" >
391410 Click "Compile & Trace " to run the real Blaze evaluator on your pasted schema and instance.
392411 </div >
393412 ) }
394413 </ div >
395414
396- { traceResult && (
397- < AnnotationsPanel
398- annotations = { collectedAnnotations }
399- currentInstanceLocation = { currentStep ?. instanceLocation }
400- />
401- ) }
415+ < AnnotationsPanel
416+ annotations = { collectedAnnotations }
417+ currentInstanceLocation = { currentStep ?. instanceLocation }
418+ />
402419 </ div >
403420
404421 { traceResult && (
0 commit comments