components: app-owned text input and menu; use-import style

oakui/component gains the two app-facing components:

text_input: the app's text field — the gpui_elements editing engine
(IME composition, caret, selection, undo) wrapped with the app theme's
colors (text via a text_color refinement on the wrapping div so the
engine's run layout picks it up; selection/caret/placeholder/IME-marked
directly) — and install_text_input_bindings(), which binds the
Backspace/Delete/arrow/Home/End/select-all editing keys into the app
keymap scoped to the EditableText context. The app never installed
them before, so every field accepted IME text but ignored its editing
keys; the bindings are now wired once at OakApp::new. All seven call
sites (ofx_params x2, effect_library, manager, dialogs x3) use the
component instead of gpui_elements directly.

menu: all app menu code consolidates here — the model types are
re-exported, the shared context-menu plumbing (ContextMenuHandle,
ContextMenuTriggered) and the shared segments (edit/clip-edit/in-out/
color-label/new, the viewer context menu, the dynamic language menu)
move in from src/menus, which is deleted; app.rs and every panel
import from the component. Inline fully-qualified crate paths in
non-use positions are replaced with use imports.
This commit is contained in:
2026-08-22 16:44:52 +08:00
parent e7483ba735
commit 7e2b3cb4b8
20 changed files with 331 additions and 184 deletions
+3 -2
View File
@@ -26,7 +26,8 @@ use gpui::{
div, prelude::*, AnyElement, App, ClickEvent, Context, Entity, EventEmitter, MouseButton,
Render, SharedString, Window,
};
use gpui_elements::editable_text::{text_input, EditableTextState, StringStorage, TextChanged};
use gpui_elements::editable_text::{EditableTextState, StringStorage, TextChanged};
use crate::oakui::component::text_input;
use crate::i18n;
use crate::oakui::AppEngine;
@@ -162,7 +163,7 @@ impl<E: AppEngine> Render for EffectLibraryPanel<E> {
.border_b_1()
.border_color(colors.border)
.child(
text_input("effect-library-search")
text_input("effect-library-search", cx)
.state(self.search.downgrade())
.accepts_input(true),
),