gpui-context

Manage GPUI contexts for state updates, notifications, and async tasks.

62|1|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/zerx-lab/rmx --skill gpui-context
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gpui-context
Source: https://github.com/zerx-lab/rmx/tree/main/.opencode/skills/gpui-context
Command: npx skills add https://github.com/zerx-lab/rmx --skill gpui-context

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GPUI context management across App, Window, Context<T>, AsyncApp, and AsyncWindowContext can be complex. This Skill provides a structured approach to coordinate UI rendering and entity updates by exposing typed contexts like App, Window, Context<T>, AsyncApp, and AsyncWindowContext.

Core Features & Use Cases

  • Context type overview: App, Window, Context<T>, AsyncApp, AsyncWindowContext.
  • State management and rendering: update entities, trigger re-renders via cx.notify.
  • Async operations: spawn and manage background tasks while preserving UI context.
  • Window management: open/close windows and perform window-specific operations within a component. Use cases include building interactive components that react to state changes, coordinating multiple UI layers, and performing asynchronous work tied to specific contexts.

Quick Start

Use gpui-context to structure UI components around App, Window, and Context<T>. In a component update, modify state, call notify to re-render, spawn asynchronous work with cx.spawn, and access the current entity with cx.entity(). Open a window from the App context and create a Context<T> for a component to render.

Frequently Asked Questions about gpui-context

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage GPUI contexts like App, Window, and Context<T> in Rust?

GPUI context management coordinates App, Window, Context<T>, AsyncApp, and AsyncWindowContext to simplify UI state handling. It structures components around typed contexts to enable predictable renders and clean lifecycles.

How do I trigger a re-render after updating entity state in GPUI?

To trigger a re-render in GPUI after modifying entity state, call cx.notify within a component update. This notifies the GPUI framework to refresh the UI and reflect the updated state.

Can I spawn asynchronous background tasks while preserving the UI context in GPUI?

Yes, you can spawn and manage asynchronous background tasks using cx.spawn while preserving the UI context. AsyncApp and AsyncWindowContext enable background work tied to specific entities and windows.

Does building interactive GPUI components require Rust primitives for state coordination?

Building interactive GPUI components requires Rust and GPUI primitives to coordinate multiple UI layers. The context management approach applies to component updates, window management, and asynchronous tasks.

How do I open a new window and access the current entity in a GPUI application?

To open a new window in a GPUI application, use the App context to perform window-specific operations. You can access the current entity within a component by calling cx.entity() to create a Context<T>.

What is the best way to coordinate multiple UI layers in GPUI without complex state handling?

The best way to coordinate multiple GPUI UI layers is using a structured context approach that exposes typed contexts like App and Window. This simplifies state management and enables predictable renders across components.