Repository: bevyengine/bevy
File: examples/ui/navigation/directional_navigation_overrides.rs (Rust)

Code before:
        commands,
        format!(">> Page {}", (page_num + 1) % 3 + 1),
        1000,
        525,
        Justify::Left,
    );
    text_entities.push(next_page_entity);

    // Texts describing that moving right wraps to the next row.
    let right_1 = spawn_small_text_node(commands, "> Btn 2-1".into(), 1000, 120, Justify::Left);
    let right_2 = spawn_small_text_node(commands, "> Btn 3-1".into(), 1000, 255, Justify::Left);
    let right_3 = spawn_small_text_node(commands, "> Btn 4-1".into(), 1000, 390, Justify::Left);
    let left_1 = spawn_small_text_node(commands, "Btn 1-3 < ".into(), 310, 255, Justify::Right);
    let left_2 = spawn_small_text_node(commands, "Btn 2-3 < ".into(), 310, 390, Justify::Right);
    let left_3 = spawn_small_text_node(commands, "Btn 3-3 < ".into(), 310, 525, Justify::Right);
    text_entities.push(right_1);
    text_entities.push(right_2);
    text_entities.push(right_3);
    text_entities.push(left_1);
    text_entities.push(left_2);
    text_entities.push(left_3);

    let text = match page_num {
        // For the first page, add a notice about vertical navigation being blocked off
        0 => Text::new(
            "Vertical movements disabled on each button, but you can still go to the next row by going off the right side."
        ),
        // For the third page, add a notice about vertical navigation being inverted in the grid.
        2 => Text::new(
            "Vertical Navigation has been manually overridden to be inverted! \
            ^ moves down, and v (down) moves up.",
        ),
        _ => Text::default()
    };
    let footer_info = commands
        .spawn((
            text,
            Node {
                position_type: PositionType::Absolute,
                left: px(450),
                top: px(600),
                width: px(540),
                padding: UiRect::all(px(12)),
                ..default()
            },
            TextFont {
                font_size: FontSize::Px(20.0),
                ..default()
            },
        ))
        .id();

Review comment (suggestion):
Maybe something like this would be clearer:
```suggestion
            "Vertical movements disabled on each button, but you can still navigate between rows by going off the left or right sides."
```
Seems unlikely anyone would be confused though anyway.

Code after:
        commands,
        format!(">> Page {}", (page_num + 1) % 3 + 1),
        1000,
        525,
        Justify::Left,
    );
    text_entities.push(next_page_entity);

    // Texts describing that moving right wraps to the next row.
    let right_1 = spawn_small_text_node(commands, "> Btn 2-1".into(), 1000, 120, Justify::Left);
    let right_2 = spawn_small_text_node(commands, "> Btn 3-1".into(), 1000, 255, Justify::Left);
    let right_3 = spawn_small_text_node(commands, "> Btn 4-1".into(), 1000, 390, Justify::Left);
    let left_1 = spawn_small_text_node(commands, "Btn 1-3 < ".into(), 310, 255, Justify::Right);
    let left_2 = spawn_small_text_node(commands, "Btn 2-3 < ".into(), 310, 390, Justify::Right);
    let left_3 = spawn_small_text_node(commands, "Btn 3-3 < ".into(), 310, 525, Justify::Right);
    text_entities.push(right_1);
    text_entities.push(right_2);
    text_entities.push(right_3);
    text_entities.push(left_1);
    text_entities.push(left_2);
    text_entities.push(left_3);

    let text = match page_num {
        // For the first page, add a notice about vertical navigation being blocked off
        0 => Text::new(
            "Vertical movements disabled on each button, but you can still navigate between rows by going off the left or right sides."
        ),
        // For the third page, add a notice about vertical navigation being inverted in the grid.
        2 => Text::new(
            "Vertical Navigation has been manually overridden to be inverted! \
            ^ moves down, and v (down) moves up.",
        ),
        _ => Text::default()
    };
    let footer_info = commands
        .spawn((
            text,
            Node {
                position_type: PositionType::Absolute,
                left: px(450),
                top: px(600),
                width: px(540),
                padding: UiRect::all(px(12)),
                ..default()
            },
            TextFont {
                font_size: FontSize::Px(20.0),
                ..default()
            },
        ))
        .id();