()
| 377 | } |
| 378 | |
| 379 | export function InspectorView(): s.JSX.Element { |
| 380 | |
| 381 | const ctx = useAppCtx() |
| 382 | |
| 383 | const {setOpenPanel} = s.useContext(SidePanelCtx)! |
| 384 | |
| 385 | function getValueActionInspect(item: Inspector.ValueItem): ValueNodeAction | undefined { |
| 386 | |
| 387 | if (item.value().type !== debug.ValueType.Unknown) { |
| 388 | return { |
| 389 | icon: 'Eye', |
| 390 | title: 'Inspect', |
| 391 | onClick() { |
| 392 | ctx.output.emit(msg('ConsoleInspectValue', item.itemId)) |
| 393 | }, |
| 394 | } |
| 395 | } |
| 396 | } |
| 397 | function getValueActionGraph(signal: Inspector.Signal): ValueNodeAction { |
| 398 | return { |
| 399 | icon: 'Graph', |
| 400 | title: 'Open in Graph panel', |
| 401 | onClick() { |
| 402 | s.batch(() => { |
| 403 | ctx.inspector.setInspectedSignal(signal.id) |
| 404 | setOpenPanel('dgraph') |
| 405 | }) |
| 406 | }, |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | const valueItems = s.createMemo(() => { |
| 411 | let r = { |
| 412 | custom_values: [] as Inspector.Signal[], |
| 413 | signals: [] as Inspector.Signal[], |
| 414 | stores: [] as Inspector.Signal[], |
| 415 | memos: [] as Inspector.Signal[], |
| 416 | } |
| 417 | for (let signal of Object.values(ctx.inspector.state.signals)) { |
| 418 | switch (signal.type) { |
| 419 | case debug.NodeType.CustomValue: r.custom_values.push(signal) ;break |
| 420 | case debug.NodeType.Signal: r.signals.push(signal) ;break |
| 421 | case debug.NodeType.Store: r.stores.push(signal) ;break |
| 422 | case debug.NodeType.Memo: r.memos.push(signal) ;break |
| 423 | } |
| 424 | } |
| 425 | return r |
| 426 | }) |
| 427 | |
| 428 | return ( |
| 429 | <ui.Scrollable> |
| 430 | <div class="min-w-full w-fit p-4 p-b-14 flex flex-col gap-y-4"> |
| 431 | <ListSignals |
| 432 | when={ |
| 433 | ctx.inspector.state.props != null && |
| 434 | Object.keys(ctx.inspector.state.props.record).length |
| 435 | } |
| 436 | title={<>Props {ctx.inspector.state.props!.proxy && <ui.Badge>PROXY</ui.Badge>}</>} |
nothing calls this directly
no test coverage detected
searching dependent graphs…