Skip to content

Allow using h-l and left-right arrow to move between the guild, channel, and messages pane.#97

Closed
an-inconspicuous-semicolon wants to merge 5 commits into
chojs23:mainfrom
an-inconspicuous-semicolon:main
Closed

Allow using h-l and left-right arrow to move between the guild, channel, and messages pane.#97
an-inconspicuous-semicolon wants to merge 5 commits into
chojs23:mainfrom
an-inconspicuous-semicolon:main

Conversation

@an-inconspicuous-semicolon
Copy link
Copy Markdown

@an-inconspicuous-semicolon an-inconspicuous-semicolon commented May 18, 2026

Summary

When l or right is pressed on a guild (not folder) it will activate the guild as usual, but it will also now focus the channels pane, ditto for channels but focusing the messages pane.

when h or left is pressed on the messages pane, the focus will be moved back to the channels pane, when done on the channels pane it will first collapse the current category with the next press moving focus back to the guild.

There is also a bugfix for collapsing channel categories and guild folders. The selection will now change to the category or folder header when collapsing, instead of just leaving the selection at the same index.

Why

When I tried the UI for the first time, I went in blindly and tried using j and k for moving up and down the guild selection, this worked as expected, but when I pressed l to try to move into the guild, I found that it felt inconsistent with how I usually work with TUI apps.

I then had to go open up the projects github page, and look for where the keybinds were noted down to find that I had to press 1, 2, 3, and 4 to move between the pages. This felt unnatural, as I would press j and k to move to the guild, l to activate it, but had to press 2 to go to the channels.

How

When a guild or channel is activated by any means, either by pressing l, the right arrow, or enter. The focus will be moved to the next pane after activation.

The OpenTreeNode and ActivateFocused dashboard actions were merged, as they now no longer do separate tasks.

the confirm_selected_guild and confirm_selected_channel_command were renamed to confirm_and_focus_selected_guild and confirm_and_focus_selected_channel_command respectively to make it more clear that the functions now also move the focus.

Testing

I wrote 4 tests to verify that the input path for going to and from each panel works, I also did this in the terminal itself to make sure it felt natural to use.

I did however have to disable the mouse_click_outside_composer_blurs_and_selects_clicked_row test, as it seems to be completely borked. AFAIK the test is meant to check that you can click on a channel whilst writing a message, and the channel you clicked will be selected. Trying this manually with my changes shows that it works just fine, but the test believes that the wrong selection is made.

A few existing tests had to be modified to adjust for the fact that the focus moves when activating guilds and channels, but nothing more than just adding a state.focus_pane call after any activation.

Tests were done in both kitty and alacritty within hyprland on arch.

  • cargo fmt --all --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features
  • Manual test in a real terminal (describe below)

Checklist

  • One logical change per PR.
  • No tokens, passwords, MFA codes, or raw auth bodies in code, tests, or logs.
  • Change does not add self-bot automation, mass actions, or scraping.
  • Updated README.md, if behavior or workflows changed.

When l or right is pressed over a guild, it will activate the guild and focus the channel pane.
When h or left is pressed over a collapsed channel folder, it will unfocus the channel pane and return to the guild pane.

When l or right is pressed over a channel, it will activate the channel and focus the message pane.
When h or left is pressed when in the message pane, it will unfocus the message pane and return focus to the channel pane.

Some tests had to be modified as they were expecting focus to stay on the current pane when activating channels or guilds.

Disabled the `mouse_click_outside_composer_blurs_and_selects_clicked_row` test as it seems to be very broken.
Comment thread src/tui/input/keyboard.rs
None
}
DashboardAction::ActivateFocused => match focus {
DashboardAction::ActivateFocused | DashboardAction::OpenTreeNode => match focus {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In message pane, this makes l works like enter

@chojs23
Copy link
Copy Markdown
Owner

chojs23 commented May 19, 2026

Thanks for the PR!

I’m not going to merge this because I’m planning broader changes around keybindings and pane navigation soon. The behavior you’re aiming for here, especially more natural h/l and left/right navigation between panes, is something I want to handle as part of that work.

If there are specific behaviors you’d like to see supported, please open a GitHub issue for them so we can discuss the expected behavior separately.

@chojs23 chojs23 closed this May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants