Repository navigation
fix(components): drop slider hit zIndex that outranked host overlays - #96
Merged
sudoevolve merged 1 commit intoOct 10, 2026
Conversation
The slider's internal ".hit" area carried zIndex(10). Hit testing and painting traverse ordered children sorted by subtreeMaxZIndex (dsl.h rebuildOrderedElements), so any page containing a slider had its subtree sort key raised to 10: root-level overlays composed later at the default z=0 (scrim, dropdown menus) were sorted below the page and lost both hit priority and paint order - clicks fell through to the page underneath. The hit area keeps its input priority via composition order (last child of the slider stack is hit-tested first in reversed order), so the zIndex is unnecessary. Drop it and add a regression test asserting the page subtree stays at z=0, the overlay keeps its compose position, and the hit area remains the topmost ordered child of the slider stack. Reproduced end-to-end in a host app (node editor with sliders and root-level dropdown overlays): with the old zIndex, clicks on the dropdown scrim/items landed on the canvas input area; without it, overlays receive clicks as expected.
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.
Closes #95。
修改内容
移除
components/slider.h内部热区.hit的.zIndex(10),并新增回归测试tests/unit/slider_subtree_z_order.cpp。修改原因
命中测试与绘制遍历按
subtreeMaxZIndex排序(dsl.h的rebuildOrderedElements,升序、命中逆序)。.hit的栈内输入优先级本就由合成序保证(栈内最后一个子元素最先被逆序命中),zIndex(10) 没有栈内收益,却把任何包含滑条的页面子树排序键抬到 10:宿主在页面之后合成的默认 z=0 根级浮层(scrim、下拉菜单)在排序中落到页面之下,命中与绘制双双失效——真实宿主(节点编辑器画布,浮层下拉 + 滑条参数节点)真机 A/B 实证:含滑条时点击浮层菜单项的坐标事件穿透到页面输入区,不含滑条则正常。详见 #95。实际执行的测试
cmake --build build-fix -j(Debug,-DEUI_BUILD_TEST_FIXTURES=ON):全目标零错误;ctest:34/34 通过(含新增slider_subtree_z_order;修复前该测试在首条断言失败:slider inflates page subtreeMaxIndex to 10,语义即回归判定);影响范围
仅滑条内部热区的 z 声明;栈内行为不变(track/fill/knob/hit 的命中与绘制序均保持原有效结果)。结构性使用 zIndex 的组件(如 carousel 的景深卡片)不在此列,未改动。