Agent Skillslichtblick-suite/lichtblick › panel-state-transitions

panel-state-transitions

GitHub

解析离散状态转换面板知识,涵盖时间轴可视化、消息路径提取、250ms批量刷新机制及高性能数据集转换。

.github/skills/panel-state-transitions/SKILL.md lichtblick-suite/lichtblick

Trigger Scenarios

询问关于 StateTransitions 面板的实现细节或结构 需要优化或理解基于时间的图表渲染逻辑 查询如何配置消息路径以提取特定状态值 分析高频率消息下的性能瓶颈与批处理策略

Install

npx skills add lichtblick-suite/lichtblick --skill panel-state-transitions -g -y
More Options

Non-standard path

npx skills add https://github.com/lichtblick-suite/lichtblick/tree/develop/.github/skills/panel-state-transitions -g -y

Use without installing

npx skills use lichtblick-suite/lichtblick@panel-state-transitions

指定 Agent (Claude Code)

npx skills add lichtblick-suite/lichtblick --skill panel-state-transitions -a claude-code -g -y

安装 repo 全部 skill

npx skills add lichtblick-suite/lichtblick --all -g -y

预览 repo 内 skill

npx skills add lichtblick-suite/lichtblick --list

SKILL.md

Frontmatter
{
    "name": "panel-state-transitions",
    "description": "Deep StateTransitions panel knowledge: TimeBasedChart segments, message-path extraction, preloaded-range subscription with 250ms batch flush, block+currentFrame merge, and messagesToDataset."
}

Panel State Transitions Skill

A timeline visualization for discrete state changes extracted from messages.

Structure

panels/StateTransitions/
├── index.tsx                       # main panel, TimeBasedChart usage, message-path config
├── messagesToDataset.ts            # message → Chart.js dataset (perf-critical)
└── hooks/
    ├── useDecodedMessageRange.ts   # preloaded-range subscription, 250ms batch flush
    └── useStateTransitionsData.ts  # merges preloaded blocks + current frame

Data Flow

  1. User configures message paths (e.g. /robot/state.mode)
  2. useDecodedMessageRange subscribes to preloaded blocks for those paths
  3. Messages arrive in batches (250ms flush interval)
  4. messagesToDataset extracts discrete values and builds chart segments
  5. useStateTransitionsData merges block data with live current-frame data
  6. TimeBasedChart renders colored segments on a timeline

messagesToDataset (Performance Critical)

function messagesToDataset(messages: MessageEvent[], path: MessagePath): ChartDataset {
  // iterate all messages, extract value at path
  // create segment boundaries at state-change points
  // return { data: [{ x: startTime, x2: endTime, y: stateLabel }] }
}

Runs on every data update — must stay fast for large datasets.

250ms Batch Flush

useDecodedMessageRange debounces:

  • Accumulates incoming messages for 250ms
  • Triggers a single state update with the full batch
  • Prevents a React re-render per message — critical for topics with thousands of preloaded messages

TimeBasedChart

Shared chart component (also used by other panels):

  • Time on the X-axis, discrete values on the Y-axis
  • Supports multiple series (each path = a row)
  • Zoom/pan synchronized with global playback time
  • Colored segments represent distinct state values

Performance Notes

  • 250ms batch flush prevents render storms from high-frequency messages
  • messagesToDataset is O(n) per path — keep n bounded (downsample if needed)
  • Avoid re-processing already-processed blocks during the block + currentFrame merge
  • Message-path parsing is cached (nearley grammar not re-parsed)

Key Files

  • packages/suite-base/src/panels/StateTransitions/index.tsx
  • packages/suite-base/src/panels/StateTransitions/messagesToDataset.ts
  • packages/suite-base/src/panels/StateTransitions/hooks/useDecodedMessageRange.ts
  • packages/suite-base/src/panels/StateTransitions/hooks/useStateTransitionsData.ts

Skills Reference

  • For message-path syntax and extraction: load message-path skill

Version History

  • cab9317 Current 2026-07-24 12:17

Same Skill Collection

.github/skills/3d-rendering/SKILL.md
.github/skills/caching-internals/SKILL.md
.github/skills/deserialization/SKILL.md
.github/skills/e2e-playwright-mcp/SKILL.md
.github/skills/electron-internals/SKILL.md
.github/skills/extensions-internals/SKILL.md
.github/skills/layouts-internals/SKILL.md
.github/skills/mcap-format/SKILL.md
.github/skills/message-path/SKILL.md
.github/skills/message-pipeline/SKILL.md
.github/skills/panel-extension-api/SKILL.md
.github/skills/panel-image/SKILL.md
.github/skills/panel-log/SKILL.md
.github/skills/panel-map/SKILL.md
.github/skills/panel-raw-messages/SKILL.md
.github/skills/panel-user-scripts/SKILL.md
.github/skills/performance/SKILL.md
.github/skills/player-internals/SKILL.md
.github/skills/plot-internals/SKILL.md
.github/skills/remote-caching/SKILL.md
.github/skills/test-conventions/SKILL.md
.github/skills/theme/SKILL.md
.github/skills/unit-testing/SKILL.md
.github/skills/web-workers/SKILL.md
.github/skills/websocket-connection/SKILL.md

Metadata

Files
0
Version
cab9317
Hash
aef8adce
Indexed
2026-07-24 12:17

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-09 02:20
浙ICP备14020137号-1 $bản đồ khách truy cập$