docs: a part's notify draws the whole window, not just the part
The records said the shell's parts draw only when what they show changed. In gpui-pre 0.3.10 a child view embedded with .child(entity) is rendered on every frame (only Entity::cached and AnyView::cached reuse a subtree), so a part that is told tells the window, and the window draws every part. Correct the shell section of docs/ui.md, the status paragraph of the spikes report and the module comments of the shell and the root state, and add to "For the next slices" the gate's notes: heavy panes cached and Update.refresh turned into per-area signals, Update.reloaded ignored and img() caching by path, SettingChanged for audio and playback not reloaded. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0d32ac25f0
commit
7c0f385f2f
8 files changed
+53
-14
No files matched your search
@@ -21,7 +21,7 @@
|
||||
//!
|
||||
//! The root notifies on every batch of events and on every move of the user's;
|
||||
//! it is the views (`crate::shell`) that decide whether what they show changed
|
||||
//! and draw again only then. What a transition asks for besides the state
|
||||
//! and tell the window only then (the window draws every part). What a transition asks for besides the state
|
||||
//! (`Update`) is carried out as far as this front end has the parts: the
|
||||
//! engine's commands go out, the status line is set, what is to be kept goes
|
||||
//! to the store, a setting the theme follows is applied and the warnings are
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//! empty page: the "no server selected" state with the way to add one, and for
|
||||
//! a server on screen its name, address and state with the buttons that
|
||||
//! connect, disconnect and edit it. An entity of its own: it observes the root
|
||||
//! state and draws again only when what it shows changed.
|
||||
//! state and tells the window only when what it shows changed.
|
||||
|
||||
use gpui_kit::component::button::{Button, ButtonVariants as _};
|
||||
use gpui_kit::prelude::FluentBuilder as _;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
//! The desktop shell of the GPUI front end (`ui/shells/desktop.slint` and
|
||||
//! the server callbacks of `bind/servers.rs`): the server rail, the top bar,
|
||||
//! the sidebar, the main area, the server form and the toast, each an entity
|
||||
//! that observes the root state ([`crate::app::AppState`]) and draws again
|
||||
//! only when what it shows changed, and the actions the user's moves are
|
||||
//! ([`actions`]). [`crate::view::MainView`] puts them in the window.
|
||||
//! that observes the root state ([`crate::app::AppState`]) and tells the window
|
||||
//! only when what it shows changed (the window then draws every part), and the
|
||||
//! actions the user's moves are ([`actions`]). [`crate::view::MainView`] puts
|
||||
//! them in the window.
|
||||
|
||||
pub mod actions;
|
||||
mod form;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! The server rail: the saved servers as avatars with their state, the
|
||||
//! selection, the add-server button and the settings button (`ServerRail` of
|
||||
//! `ui/shells/desktop.slint`). An entity of its own: it observes the root
|
||||
//! state and draws again only when the servers it lists changed.
|
||||
//! state and tells the window only when the servers it lists changed.
|
||||
|
||||
use gpui_kit::prelude::FluentBuilder as _;
|
||||
use gpui_kit::{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//! `shells/common.slint`): the server on screen, the place of its channel tree
|
||||
//! (the next slice), the voice card while voice is connecting or connected, and
|
||||
//! the user's own card with the voice buttons. An entity of its own: it
|
||||
//! observes the root state and draws again only when what it shows changed.
|
||||
//! observes the root state and tells the window only when what it shows changed.
|
||||
|
||||
use gpui_kit::prelude::FluentBuilder as _;
|
||||
use gpui_kit::{
|
||||
|
||||
@@ -234,8 +234,10 @@ fn report(app: &Entity<AppState>, window: &Window, cx: &mut App) {
|
||||
|
||||
impl Render for MainView {
|
||||
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||
// One render of the window is one frame: the parts draw when they are
|
||||
// told, and the window is drawn when one was.
|
||||
// One render of the window is one frame. A part that has something new
|
||||
// tells the window, and the window then renders every part (gpui-pre
|
||||
// renders each uncached child view on every frame); a window nobody
|
||||
// tells is not drawn.
|
||||
self.counters.renders.incr();
|
||||
let theme = VoelinTheme::global(cx).clone();
|
||||
let (c, m) = (&theme.colors, &theme.metrics);
|
||||
|
||||
Reference in new issue
Block a user