Skip to content

Add sysinfo preview with mock WaveEnv and frontend-only WPS updates#3020

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/add-waveenv-mock-for-sysinfo
Closed

Add sysinfo preview with mock WaveEnv and frontend-only WPS updates#3020
Copilot wants to merge 2 commits intomainfrom
copilot/add-waveenv-mock-for-sysinfo

Conversation

Copy link
Contributor

Copilot AI commented Mar 9, 2026

This adds a preview-server setup for sysinfo using the new mock WaveEnv pattern already used by other live component previews. The preview provides the SysinfoEnv surface directly, seeds initial history, and drives ongoing updates entirely in the frontend via handleWaveEvent().

  • New sysinfo preview

    • Adds frontend/preview/previews/sysinfo.preview.tsx
    • Renders multiple sysinfo scenarios:
      • CPU
      • CPU + Mem
      • All CPU
    • Instantiates SysinfoViewModel directly against a preview-scoped mock env
  • Mock SysinfoEnv wiring

    • Provides the env contract sysinfo.tsx expects:
      • EventReadHistoryCommand
      • SetMetaCommand
      • fullConfigAtom
      • getConnStatusAtom / getBlockMetaKeyAtom via the shared mock env
    • Seeds a mock block object with the required meta:
      • view: "sysinfo"
      • connection
      • sysinfo:type
      • graph:numpoints
  • Frontend-only live data path

    • Seeds preview history for EventReadHistoryCommand
    • Publishes incremental sysinfo updates on an interval with handleWaveEvent()
    • Installs a preview-only noop WPS RPC client so WPS subscriptions register cleanly without backend traffic
  • Preview state behavior

    • Keeps block meta updates local in preview mode by updating the mocked block atom in SetMetaCommand
    • Maintains rolling history so the preview behaves like the live component instead of a static snapshot
const nextEvent = makeSysinfoEvent(connection, Date.now(), state.tick);
state.history.push(nextEvent);
handleWaveEvent(nextEvent);

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 9, 2026

Deploying waveterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0a66642
Status: ✅  Deploy successful!
Preview URL: https://5b9c0c74.waveterm.pages.dev
Branch Preview URL: https://copilot-add-waveenv-mock-for.waveterm.pages.dev

View logs

Copilot AI changed the title [WIP] Add WaveEnv mock setup for sysinfo component previews Add sysinfo preview with mock WaveEnv and frontend-only WPS updates Mar 9, 2026
Copilot finished work on behalf of sawka March 9, 2026 23:37
@sawka sawka closed this Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants