debugger: Make the stack frame list and module list keyboard-navigable (#30682)

- Switch stack frame list and module list to `UniformList` to access
scrolling behavior
- Implement `menu::` navigation actions

Release Notes:

- Debugger Beta: Added support for menu navigation actions (`ctrl-n`,
`ctrl-p`, etc.) in the stack frame list and module list.
This commit is contained in:
Cole Miller 2025-05-14 22:23:59 +02:00 committed by GitHub
parent 6420df3975
commit 87cb498a41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 360 additions and 201 deletions

View file

@ -190,7 +190,7 @@ async fn test_basic_fetch_initial_scope_and_variables(
running_state.update(cx, |running_state, cx| {
let (stack_frame_list, stack_frame_id) =
running_state.stack_frame_list().update(cx, |list, _| {
(list.flatten_entries(true), list.selected_stack_frame_id())
(list.flatten_entries(true), list.opened_stack_frame_id())
});
assert_eq!(stack_frames, stack_frame_list);
@ -431,7 +431,7 @@ async fn test_fetch_variables_for_multiple_scopes(
running_state.update(cx, |running_state, cx| {
let (stack_frame_list, stack_frame_id) =
running_state.stack_frame_list().update(cx, |list, _| {
(list.flatten_entries(true), list.selected_stack_frame_id())
(list.flatten_entries(true), list.opened_stack_frame_id())
});
assert_eq!(Some(1), stack_frame_id);
@ -1452,7 +1452,7 @@ async fn test_variable_list_only_sends_requests_when_rendering(
running_state.update(cx, |running_state, cx| {
let (stack_frame_list, stack_frame_id) =
running_state.stack_frame_list().update(cx, |list, _| {
(list.flatten_entries(true), list.selected_stack_frame_id())
(list.flatten_entries(true), list.opened_stack_frame_id())
});
assert_eq!(Some(1), stack_frame_id);
@ -1734,7 +1734,7 @@ async fn test_it_fetches_scopes_variables_when_you_select_a_stack_frame(
running_state.update(cx, |running_state, cx| {
let (stack_frame_list, stack_frame_id) =
running_state.stack_frame_list().update(cx, |list, _| {
(list.flatten_entries(true), list.selected_stack_frame_id())
(list.flatten_entries(true), list.opened_stack_frame_id())
});
let variable_list = running_state.variable_list().read(cx);
@ -1745,7 +1745,7 @@ async fn test_it_fetches_scopes_variables_when_you_select_a_stack_frame(
running_state
.stack_frame_list()
.read(cx)
.selected_stack_frame_id(),
.opened_stack_frame_id(),
Some(1)
);
@ -1778,7 +1778,7 @@ async fn test_it_fetches_scopes_variables_when_you_select_a_stack_frame(
running_state
.stack_frame_list()
.update(cx, |stack_frame_list, cx| {
stack_frame_list.select_stack_frame(&stack_frames[1], true, window, cx)
stack_frame_list.go_to_stack_frame(stack_frames[1].id, window, cx)
})
})
.await
@ -1789,7 +1789,7 @@ async fn test_it_fetches_scopes_variables_when_you_select_a_stack_frame(
running_state.update(cx, |running_state, cx| {
let (stack_frame_list, stack_frame_id) =
running_state.stack_frame_list().update(cx, |list, _| {
(list.flatten_entries(true), list.selected_stack_frame_id())
(list.flatten_entries(true), list.opened_stack_frame_id())
});
let variable_list = running_state.variable_list().read(cx);