feat(xcui): close scroll view validation loop

This commit is contained in:
2026-04-06 13:13:17 +08:00
parent b14a4fb7bb
commit 0804052d6f
11 changed files with 477 additions and 2 deletions

View File

@@ -530,6 +530,7 @@ void Application::AppendRuntimeOverlay(UIDrawData& drawData, float width, float
if (authoredMode) {
const auto& inputDebug = m_documentHost.GetInputDebugSnapshot();
const auto& scrollDebug = m_documentHost.GetScrollDebugSnapshot();
detailLines.push_back(
"Hover | Focus: " +
ExtractStateKeyTail(inputDebug.hoveredStateKey) +
@@ -601,6 +602,25 @@ void Application::AppendRuntimeOverlay(UIDrawData& drawData, float width, float
"Last event result: " +
(inputDebug.lastResult.empty() ? std::string("n/a") : inputDebug.lastResult));
}
detailLines.push_back(
"Scroll target | Primary: " +
ExtractStateKeyTail(scrollDebug.lastTargetStateKey) +
" | " +
ExtractStateKeyTail(scrollDebug.primaryTargetStateKey));
detailLines.push_back(
"Scroll offset B/A: " +
FormatFloat(scrollDebug.lastOffsetBefore) +
" -> " +
FormatFloat(scrollDebug.lastOffsetAfter) +
" | overflow " +
FormatFloat(scrollDebug.lastOverflow));
detailLines.push_back(
"Scroll H/T: " +
std::to_string(scrollDebug.handledWheelEventCount) +
"/" +
std::to_string(scrollDebug.totalWheelEventCount) +
" | " +
(scrollDebug.lastResult.empty() ? std::string("n/a") : scrollDebug.lastResult));
}
if (m_autoScreenshot.HasPendingCapture()) {

View File

@@ -24,8 +24,8 @@ fs::path RepoRelative(const char* relativePath) {
return (RepoRootPath() / relativePath).lexically_normal();
}
const std::array<EditorValidationScenario, 6>& GetEditorValidationScenarios() {
static const std::array<EditorValidationScenario, 6> scenarios = { {
const std::array<EditorValidationScenario, 7>& GetEditorValidationScenarios() {
static const std::array<EditorValidationScenario, 7> scenarios = { {
{
"editor.input.keyboard_focus",
UIValidationDomain::Editor,
@@ -44,6 +44,15 @@ const std::array<EditorValidationScenario, 6>& GetEditorValidationScenarios() {
RepoRelative("tests/UI/Editor/integration/shared/themes/editor_validation.xctheme"),
RepoRelative("tests/UI/Editor/integration/input/pointer_states/captures")
},
{
"editor.input.scroll_view",
UIValidationDomain::Editor,
"input",
"Editor Input | Scroll View",
RepoRelative("tests/UI/Editor/integration/input/scroll_view/View.xcui"),
RepoRelative("tests/UI/Editor/integration/shared/themes/editor_validation.xctheme"),
RepoRelative("tests/UI/Editor/integration/input/scroll_view/captures")
},
{
"editor.input.shortcut_scope",
UIValidationDomain::Editor,