gpui

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Navigation

导航

Load the relevant reference file based on the task:
TopicFileWhen to load
Actions & keybindingsaction.md
actions!
,
bind_keys
,
on_action
,
key_context
Async & background tasksasync.md
cx.spawn
,
background_spawn
,
Task
, async I/O
Context managementcontext.md
App
,
Window
,
Context<T>
,
AsyncApp
Custom elements (low-level)element.md
Element
trait,
request_layout
,
prepaint
,
paint
Entity stateentity.md
Entity<T>
,
WeakEntity
, state management
Events & subscriptionsevent.md
cx.emit
,
cx.subscribe
,
cx.observe
Focus & keyboard navfocus-handle.md
FocusHandle
,
track_focus
, Tab navigation
Global stateglobal.md
Global
trait,
cx.set_global
, app-wide config
Layout & stylinglayout-style.md
div()
,
h_flex()
,
v_flex()
, flexbox, overflow, positioning
ElementIdelement-id.md
ElementId
,
.id()
, uniqueness rules, stateful elements
Testingtest.md
#[gpui::test]
,
TestAppContext
,
VisualTestContext
根据任务加载相关参考文件:
主题文件加载时机
Actions & keybindingsaction.md
actions!
,
bind_keys
,
on_action
,
key_context
Async & background tasksasync.md
cx.spawn
,
background_spawn
,
Task
, 异步I/O
Context managementcontext.md
App
,
Window
,
Context<T>
,
AsyncApp
Custom elements (low-level)element.md
Element
trait,
request_layout
,
prepaint
,
paint
Entity stateentity.md
Entity<T>
,
WeakEntity
, 状态管理
Events & subscriptionsevent.md
cx.emit
,
cx.subscribe
,
cx.observe
Focus & keyboard navfocus-handle.md
FocusHandle
,
track_focus
, Tab导航
Global stateglobal.md
Global
trait,
cx.set_global
, 应用级配置
Layout & stylinglayout-style.md
div()
,
h_flex()
,
v_flex()
, flexbox, 溢出, 定位
ElementIdelement-id.md
ElementId
,
.id()
, 唯一性规则, 有状态元素
Testingtest.md
#[gpui::test]
,
TestAppContext
,
VisualTestContext

Extended References

扩展参考

For deep-dive topics, additional reference files are available:
Element trait:
  • element-api.md — complete API, hitbox system, event handling
  • element-patterns.md — text, interactive, container, composite patterns
  • element-examples.md — full examples: text, interactive, complex elements
  • element-best-practices.md — performance, state, common pitfalls
  • element-advanced.md — masonry/circular layouts, async updates, virtual lists
Entity management:
  • entity-api.md — complete Entity API, methods, lifecycle
  • entity-patterns.md — model-view, cross-entity communication, observer
  • entity-best-practices.md — memory, performance, lifecycle
  • entity-advanced.md — collections, registry, debounce, state machines
Testing:
  • test-examples.md — testing examples and patterns
  • test-reference.md — complete testing API reference
如需深入了解相关主题,可查看更多参考文件:
Element trait:
  • element-api.md — 完整API、碰撞框系统、事件处理
  • element-patterns.md — 文本、交互、容器、组合模式
  • element-examples.md — 完整示例:文本、交互、复杂元素
  • element-best-practices.md — 性能、状态、常见陷阱
  • element-advanced.md — 瀑布流/环形布局、异步更新、虚拟列表
Entity management:
  • entity-api.md — 完整Entity API、方法、生命周期
  • entity-patterns.md — 模型-视图、跨实体通信、观察者模式
  • entity-best-practices.md — 内存、性能、生命周期
  • entity-advanced.md — 集合、注册中心、防抖、状态机
Testing:
  • test-examples.md — 测试示例与模式
  • test-reference.md — 完整测试API参考