Skip to content

Add keep_focus_on_list: stay on the list when selecting a channel or opening a thread#84

Closed
Frodotus wants to merge 1 commit into
gammons:mainfrom
Frodotus:feat/keep-focus-on-list
Closed

Add keep_focus_on_list: stay on the list when selecting a channel or opening a thread#84
Frodotus wants to merge 1 commit into
gammons:mainfrom
Frodotus:feat/keep-focus-on-list

Conversation

@Frodotus

Copy link
Copy Markdown
Contributor

Closes #83.

What

A new [general] bool, keep_focus_on_list (default false). When enabled, selecting a channel or opening a thread loads the content but leaves keyboard focus on the list, so you can browse with j/k + Enter without tabbing back each time.

[general]
keep_focus_on_list = true

Behavior (when true)

Selecting still loads the content; only the focus jump is suppressed:

  • sidebar → channel: focus stays on the sidebar
  • channel message → its thread: thread opens, focus stays on the message list
  • threads view → thread: thread opens, focus stays on the threads list

Step into the content via the existing focus keys (Tab / l / ). Default (false) is the long-standing focus-follows-selection behavior, so nobody is affected unless they opt in.

Implementation

  • Gates the three selection-driven focusedPanel assignments — reduceChannelSelected (channel pick), handleEnter (threads-view Enter), and openThreadPanel (message → thread) — behind !a.keepFocusOnList.
  • Wires config.General.KeepFocusOnListapp.SetKeepFocusOnList(...), mirroring the other [general]/[appearance] bools.
  • Intentionally not gated: ThreadsViewActivatedMsg still focuses the threads list — that list is what you browse in the threads view, so landing on it is the on-list behavior (commented inline). Mouse click-to-focus-a-pane is also untouched.

Tests

Three tests, each driving a real production path and asserting default-vs-flag:

  • channel select via the ChannelSelectedMsg reducer (Update)
  • message → thread via the real handleEnter keystroke
  • threads view → thread via the real handleEnter keystroke

Full suite + go vet green. Wiki Configuration.md updated ("Browsing without losing focus").

@Frodotus Frodotus force-pushed the feat/keep-focus-on-list branch from 06a23f2 to 5625720 Compare June 11, 2026 13:28
@Frodotus Frodotus closed this Jun 16, 2026
@gammons

gammons commented Jun 16, 2026

Copy link
Copy Markdown
Owner

hi @Frodotus curious why you're closing your PRs!

@Frodotus

Copy link
Copy Markdown
Contributor Author

hi @Frodotus curious why you're closing your PRs!

Hi! Sorry for the confusion — no slight intended! I opened those while trying to get slk working as my daily driver, but I'm not really a Go person. In the end I built my own client in Python since it's what I know — that way I can quickly tweak things to fit my daily-driver needs instead of it turning into a Go learning project. Really appreciate slk though, and the effort you've put into it!

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.

Feature proposal: keep_focus_on_list — stay on the list when selecting a channel or opening a thread

2 participants