Repository navigation
LRC-LIB-KEYWORDS: the Keyword List holds its place as the Keywords box above it changes - #1755
Merged
Merged
Conversation
…x above it changes Scrolled down a long Keyword List, ticking or unticking a keyword grew or shrank the Keywords box above it (a row of chips, suggestions) and slid the tree under the pointer. The panel now moves its scroll offset by the same amount and draws the pass again, so the list stays put. It holds only while the box's top is scrolled out of sight and the change does not come from the box itself (the pointer on it, or typing in its field). The offset is set on the scroll area as the redrawn pass starts, from the offset the pass before started at: a scroll asked for during a pass lands a frame later, and egui pulls a shrunken panel's offset back by the end of a pass. Ticks clicked one after another (a script, a quick hand) then land on the rows clicked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…old lasts one pass A pass drawn again after a discard still has the widgets of the pass thrown away, so a control request answered there found a row where it no longer is; it also added a 240 fps sample to perf.fps. Control requests and the fps sample now run on a frame's first pass only. The Keyword List's hold is kept for the pass right after it was asked for, so it never moves a panel that was not drawn in between. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Thank you @nledford! This landed on main in integration batch 37 (#1852), rebased onto main after the previous batches. If you haven't already, please join our Discord: https://discord.gg/artcraft. We'd love to have you there. |
chrisgleissner
pushed a commit
to chrisgleissner/lightcraft
that referenced
this pull request
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When you scroll down a long Keyword List and tick or untick keywords, the Keywords box above it grows or shrinks (a row of chips, the suggestions). The tree then slides down or up under the pointer, by a row or more with each tick, so the next click has to find its row again.
Fix
The panel now holds the list in place, the way a browser's scroll anchoring does. When the box changes height, the panel moves its scroll offset by the same amount, and the pass is drawn again (
request_discard) so the list never shows a frame out of place. It holds only:Details that tracing turned up (
crates/ui-egui/src/panels/right.rs):vertical_scroll_offset). A scroll requested during a pass (scroll_with_delta, even with no animation) only lands a frame later, so one frame was drawn out of place and a click could hit the wrong row.This is the app's first
request_discard, so the second commit makesApp::logicdrain control requests (and take the fps sample) only on a frame's first pass. A redrawn pass has no input of its own and still holds the discarded pass's widget rects, so a request answered there would click where a row used to be (crates/ui-egui/src/lib.rs).Left, START: the panel scrolled down, nothing ticked. Middle, BEFORE (main): after ticking lake, macro, mountains, night and ocean, the list has slid down by the growth of the box. Right, AFTER (this PR): the same five ticks, with every row where it was. Demo library, 1400×800,
lightcraft-cli snapshot.Tests
In
crates/ui-egui/src/tests_keyword_list.rs:ticking_a_keyword_keeps_the_list_in_place: a 40-keyword list, scrolled so the box is out of sight. Ticks and unticks six keywords and checks three things after each click: the clicked row's rect is unchanged, the click toggled that keyword, and the box really changed height. Fails on main.ticks_in_quick_succession_land_on_their_rows: six ticks clicked back to back with no settling between them, as a script or a quick hand does. All six must land on their rows. Failed with the first version of this fix, which held the list a frame late.at_the_top_the_box_grows_in_sight: at the top of the panel, ticked keywords' chips push the list down, as before.Verification
cargo fmt --all --check,cargo clippy -p lightcraft-ui-egui --all-targets -D warnings,cargo xtask layers,cargo xtask paritycargo test -p lightcraft-ui-egui --lib: 839 pass. The sixtests_model_setuptests fail when the crate is built alone (the denoise feature is off) and pass under--workspace; they're unrelated to this change.cargo test -p lightcraft-cli: 21 pass.Limits
Overlap
keywordsfunction inright.rs. Whichever lands second needs a small port:hold_list_in_place(ui, top)goes just beforekeyword_list::show, withtoptaken before the box's header.🤖 Generated with Claude Code