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
@@ -37,8 +37,9 @@ the slices that meet them are in docs/ui.md, "For the next slices". Item 5, the
|
||||
desktop shell, is slice 1 of the step's list and landed on `phase5/gpui-shell`
|
||||
(2026-10-27): the store at start (the client's database, the settings with the
|
||||
UI's keys, the secrets, the default identity), the server rail, the sidebar,
|
||||
the top bar and the main area as entities that draw when what they show
|
||||
changed, the eleven callbacks of `bind/servers.rs` as actions through
|
||||
the top bar and the main area as entities that tell the window when what they
|
||||
show changed (the window then draws every part: gpui-pre 0.3.10 renders every
|
||||
uncached child view on every frame), the eleven callbacks of `bind/servers.rs` as actions through
|
||||
`voelin-ui-vm`'s logic and the engine's commands, the window's size and
|
||||
position kept in `ui.window`, the engine-event task in steps and a tick that
|
||||
draws nothing. What it shows, what it costs idle and what it leaves to the
|
||||
|
||||
+38
-3
@@ -1141,9 +1141,15 @@ is the server form.
|
||||
What is on screen, each part an entity of `crates/voelin-gpui/src/shell/` that
|
||||
observes the root state, makes its view of it (`voelin_ui_vm::servers::logic`:
|
||||
`rail`, `toolbar`) and tells the window only when the view differs from the one
|
||||
it showed: an engine event about a talker, a setting that is not the theme's or
|
||||
a tick draws nothing (the `what_changes_nothing_shown_draws_nothing` test counts
|
||||
the parts told).
|
||||
it showed (`cx.notify()`): an engine event about a talker, a setting that is not
|
||||
the theme's or a tick tells no part, so the window is not drawn at all (the
|
||||
`what_changes_nothing_shown_draws_nothing` test counts the parts told). A part
|
||||
that is told tells the window, and **the window draws every part**: in gpui-pre
|
||||
0.3.10 a child view embedded with `.child(entity)` is rendered again on every
|
||||
frame (only `Entity::cached` and `AnyView::cached`, which need a definite size,
|
||||
reuse a subtree until its entity is notified), so the parts' comparison saves the
|
||||
frames of a window nobody changes, not the work inside a frame ("For the next
|
||||
slices" says what the heavy panes do about it).
|
||||
|
||||
- **The rail** (`rail.rs`): the app's mark, then the saved servers as 46 pixel
|
||||
rounded squares (the server's icon from the engine's cache, else its initials
|
||||
@@ -1358,6 +1364,35 @@ entries); the in-window keys as GPUI key bindings and the global ones through
|
||||
What the foundation's review and the Opus gate (2026-10-27) found and left to
|
||||
the slices that meet it; none of it is a defect of what exists today.
|
||||
|
||||
- **A part's notify draws the whole window, and `Update.refresh` is not used
|
||||
yet.** The root notifies on every batch and each part compares the whole view
|
||||
it would show with the one it showed; a part that differs tells the window,
|
||||
and the window renders every uncached child view (gpui-pre 0.3.10: only
|
||||
`Entity::cached` and `AnyView::cached` skip one). With a rail, a sidebar and a
|
||||
top bar that costs little; the channel tree and the members of slice 2 (and
|
||||
later the chat's list and the stream tiles) are heavy, and one talker's
|
||||
indicator must not render the rail and the chat. Slice 2 embeds the heavy panes
|
||||
with `Entity::cached` (a definite size is needed: the pane's bounds come from
|
||||
its place in the layout) and turns `Update.refresh` (`voelin_ui_vm::host::
|
||||
Refresh`: `servers`, `toolbar`, `tree`, `chat`, ...; `perform` drops it today)
|
||||
into per-area signals, a generation or a flag per pane that its entity
|
||||
observes, so that a change of the tree or the members notifies those panes and
|
||||
not the rail and the chat.
|
||||
- **`Update.reloaded` is ignored, and `img()` caches by path.** `perform` drops
|
||||
`Update.reloaded` (the pictures the engine wrote again, whose decoded copies a
|
||||
front end drops). GPUI's `img()` caches what it decoded per source in the
|
||||
asset cache, so a picture rewritten into the same cache file (a server icon or
|
||||
an avatar that changed) stays stale on screen. The slice that shows engine
|
||||
pictures (slice 2: avatars, the tree's icons) drops the decoded copy for each
|
||||
path of `reloaded` (`ImageSource::remove_asset`, and `drop_image` for what the
|
||||
atlas holds) or keys the image by something that changes with the file.
|
||||
- **`SettingChanged` for the audio and the playback keys is not reloaded.**
|
||||
`AppState::setting_changed` follows `ui.theme` and `ui.font_scale` only; the
|
||||
Slint front end also reloads `audio` (unless the page has unsaved edits) and
|
||||
`client_playback`, the crash-reports flag and the decoder keys. The values the
|
||||
window keeps copies of (`vm.audio`, `vm.playback`) go stale when a command,
|
||||
the config file or another window changes them; the settings slice (5) adds
|
||||
the reload with the page that shows them.
|
||||
- **Settled by the shell slice: the engine-event task and the tick.** The task
|
||||
takes what is queued (64 events at most) in one `update` with one
|
||||
`cx.notify()` and yields between steps, and the tick notifies nobody (the
|
||||
|
||||
Reference in new issue
Block a user