Skip to content

Releases

v0.1.4 — Follow light/dark theme switching

Choose a tag to compare

@youngxhui youngxhui released this 23 Sep 09:42

Sidebar labels and values now stay readable when OpenCode switches between light and dark mode.

Fixed

  • Labels use theme.text.base and values use theme.text.muted instead of the terminal default foreground, so they no longer render as unreadable white text on light backgrounds.
  • Added a themeText() fallback chain for the OpenCode 2.0.9 token renames (text.default → text.base, text.subdued → text.muted, no aliases kept).
  • Colors are read inside JSX property expressions so babel-preset-solid wraps them in _$effect and they re-evaluate live.
  • Subscribes to renderer theme_mode / palette events with delayed re-bumps (150ms / 600ms) because the host re-resolves color tokens asynchronously — the value read right at event time may still be stale.

Changed

  • Bump version to 0.1.4.

Full diff: v0.1.3...v0.1.4

v0.1.3 — Live-refreshing sidebar metrics

Choose a tag to compare

@youngxhui youngxhui released this 22 Sep 15:07

Fixed

  • Sidebar metrics no longer freeze at their first snapshot. The plugin was compiled with tsc, whose React-style JSX transform evaluates expressions once at component creation, so the sidebar showed - and never updated. The build now precompiles with babel-preset-solid — the same transform the OpenCode host applies to its own TUI — so JSX compiles into reactive insert accessors and Speed / Cache / TTFT update live as the session runs.
  • New windows now load the metrics block immediately instead of requiring a plugin panel reload (explicit sync on mount + refresh on 19 session events).

Changed

  • tsc is now typecheck-only (noEmit); npm run build uses the babel pipeline (build.mjs, moduleName: @opentui/solid, generate: universal).
  • Removed diagnostic logging and debug rows.

修复

  • 侧边栏指标不再冻结在首次快照:此前用 tsc 编译,其 React 风格 JSX 转换会在组件创建时一次性求值表达式,导致三行指标永远显示 - 且不刷新。现改用与 OpenCode 宿主完全相同的 babel-preset-solid 预编译,JSX 编译为响应式 insert accessor,Speed / Cache / TTFT 随会话实时更新。
  • 新窗口打开即加载指标块,不再需要重开 plugin 面板。

变更

  • tsc 仅做类型检查(noEmit);npm run build 使用 babel 管道(build.mjs)。
  • 移除诊断日志与调试行。

Install / 安装

opencode plugin add opencode-sidebar-token-metrics