Skip to content

Commit 96e310c

Browse files
authored
Merge pull request #1631 from englut/sidebar-sorting
Sidebar channel & nickname sorting
2 parents 13807b7 + a07b7ce commit 96e310c

File tree

10 files changed

+231
-87
lines changed

10 files changed

+231
-87
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Added:
77
- Multi-line send support (uses IRCv3 [`multiline`](https://ircv3.net/specs/extensions/multiline) when available)
88
- Typing indicator support (uses IRCv3 [`typing`](https://ircv3.net/specs/client-tags/typing))
99
- Add emoji reactions for supported servers (uses IRCv3 [`react`](https://ircv3.net/specs/client-tags/react.html))
10+
- New `"config"` option to `sidebar.order_channels_by`. Uses `server.<server_name>.channels` to determine order.
11+
- Case insensitive sort of query names in sidebar
12+
- Copied `order_channels_by` from `sidebar` to `server.<name>`, defaults to `sidebar.order_channels_by` if empty.
1013

1114
Fixed:
1215

@@ -15,7 +18,8 @@ Fixed:
1518
- Prevent clicks from passing through completion picker overlays to content behind them (for example nicknames in the buffer).
1619
- Regression that could make the application slow to close
1720
- Apply locale to context menu, copy, and date separator timestamps
18-
- Fix direct message notifications when excludes are present
21+
- Fixed direct message notifications when excludes are present
22+
- Fixed reloading config for channel sorting.
1923

2024
Thanks:
2125

book/src/configuration/servers/README.md

Lines changed: 55 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,37 @@ You can define multiple server sections in the configuration file. Each server s
66
- [Examples](#examples)
77
- [Configuration](#configuration)
88
- [nickname](#nickname)
9-
- [nick\_password](#nick_password)
10-
- [nick\_password\_file](#nick_password_file)
11-
- [nick\_password\_file\_first\_line\_only](#nick_password_file_first_line_only)
12-
- [nick\_password\_command](#nick_password_command)
13-
- [nick\_identify\_syntax](#nick_identify_syntax)
14-
- [alt\_nicks](#alt_nicks)
9+
- [nick_password](#nick_password)
10+
- [nick_password_file](#nick_password_file)
11+
- [nick_password_file_first_line_only](#nick_password_file_first_line_only)
12+
- [nick_password_command](#nick_password_command)
13+
- [nick_identify_syntax](#nick_identify_syntax)
14+
- [alt_nicks](#alt_nicks)
1515
- [username](#username)
1616
- [realname](#realname)
1717
- [server](#server)
1818
- [port](#port)
1919
- [password](#password)
20-
- [password\_file](#password_file)
21-
- [password\_file\_first\_line\_only](#password_file_first_line_only)
22-
- [password\_command](#password_command)
20+
- [password_file](#password_file)
21+
- [password_file_first_line_only](#password_file_first_line_only)
22+
- [password_command](#password_command)
2323
- [channels](#channels)
24-
- [channel\_keys](#channel_keys)
24+
- [channel_keys](#channel_keys)
25+
- [order_channels_by](#order_channels_by)
2526
- [queries](#queries)
26-
- [ping\_time](#ping_time)
27-
- [ping\_timeout](#ping_timeout)
28-
- [reconnect\_delay](#reconnect_delay)
29-
- [should\_ghost](#should_ghost)
30-
- [ghost\_sequence](#ghost_sequence)
27+
- [ping_time](#ping_time)
28+
- [ping_timeout](#ping_timeout)
29+
- [reconnect_delay](#reconnect_delay)
30+
- [should_ghost](#should_ghost)
31+
- [ghost_sequence](#ghost_sequence)
3132
- [umodes](#umodes)
32-
- [use\_tls](#use_tls)
33-
- [dangerously\_accept\_invalid\_certs](#dangerously_accept_invalid_certs)
34-
- [root\_cert\_path](#root_cert_path)
35-
- [on\_connect](#on_connect)
36-
- [anti\_flood](#anti_flood)
37-
- [who\_poll\_enabled](#who_poll_enabled)
38-
- [who\_poll\_interval](#who_poll_interval)
33+
- [use_tls](#use_tls)
34+
- [dangerously_accept_invalid_certs](#dangerously_accept_invalid_certs)
35+
- [root_cert_path](#root_cert_path)
36+
- [on_connect](#on_connect)
37+
- [anti_flood](#anti_flood)
38+
- [who_poll_enabled](#who_poll_enabled)
39+
- [who_poll_interval](#who_poll_interval)
3940
- [monitor](#monitor)
4041
- [chathistory](#chathistory)
4142
- [proxy](#proxy)
@@ -48,6 +49,7 @@ You can define multiple server sections in the configuration file. Each server s
4849
## Examples
4950

5051
Examples can be found in the following guides:
52+
5153
- [Example Server Configurations](../../guides/example-server-configurations.md)
5254
- [Multiple Servers](../../guides/multiple-servers.md)
5355
- [Connect with soju](../../guides/connect-with-soju.md)
@@ -174,7 +176,7 @@ realname = ""
174176

175177
### server
176178

177-
The server to connect to. Should not contain the protocol, port, username, or password (i.e. should look like `"irc.libera.chat"` not `"ircs://irc.libera.chat:6697"`).
179+
The server to connect to. Should not contain the protocol, port, username, or password (i.e. should look like `"irc.libera.chat"` not `"ircs://irc.libera.chat:6697"`).
178180

179181
```toml
180182
# Type: string
@@ -276,6 +278,31 @@ A mapping of channel names to keys (passwords) for join-on-connect.
276278
channel_keys = { "#foo" = "password" }
277279
```
278280

281+
### order_channels_by
282+
283+
Ordering for channels listed in the sidebar for the current server.
284+
285+
- `"name"`: Sort channels by name only, ignoring chantypes (channel prefixes, e.g., `#` and `##`).
286+
- `"name-and-prefix"`: Sort channels by name including their chantypes.
287+
- `"config"`: Sort channels in the order they appear in your server's `channels`
288+
list. Any channels not in the list appear last, using default (`"name"`) sort.
289+
290+
291+
If not set, the value will be taken from the sidebar config: [order_channels_by](../sidebar/#order_channels_by).
292+
293+
```toml
294+
# Type: string
295+
# Values: "name", "name-and-prefix", "config"
296+
# Default: "name"
297+
298+
[servers.<name>]
299+
order_channels_by = "config"
300+
301+
# Example: When using "config", channels appear in this exact order:
302+
channels = ["#rust", "#halloy", "#halloy-test"]
303+
# Result: #rust → #halloy → #halloy-test → (any other channels are sorted by "name")
304+
```
305+
279306
### queries
280307

281308
A list of queries to add to the sidebar on connection.
@@ -421,7 +448,7 @@ on_connect = ["/msg NickServ IDENTIFY foo bar", "/delay 2", "/join registered-cl
421448

422449
### anti_flood
423450

424-
The time (in milliseconds) between sending messages to servers without SAFERATE. Timing is not strictly guaranteed; small groups of messages may be allowed to be sent at a faster rate, messages may be delayed in order to be batched, automated messages are included in the queue (most at a lower priority than user messages), etc.
451+
The time (in milliseconds) between sending messages to servers without SAFERATE. Timing is not strictly guaranteed; small groups of messages may be allowed to be sent at a faster rate, messages may be delayed in order to be batched, automated messages are included in the queue (most at a lower priority than user messages), etc.
425452

426453
```toml
427454
# Type: integer
@@ -492,9 +519,9 @@ Custom proxy for specified server
492519

493520
The logic is as follows:
494521

495-
* If a server proxy is provided, it will be used.
496-
* If a server proxy is not provided, the global proxy will be used.
497-
* If the global proxy is not provided, a plain connection will be used.
522+
- If a server proxy is provided, it will be used.
523+
- If a server proxy is not provided, the global proxy will be used.
524+
- If the global proxy is not provided, a plain connection will be used.
498525

499526
The configuration syntax and supported proxy types are similar to the global [Proxy](../proxy/) but associated with the current `servers.<name>`:
500527

@@ -546,4 +573,5 @@ External SASL auth uses a PEM encoded X509 certificate.
546573
Whether and where to confirm delivery of sent messages, if the server supports [`echo-message`](https://ircv3.net/specs/extensions/echo-message)
547574

548575
[^1]: Windows path strings should usually be specified as literal strings (e.g. `'C:\Users\Default\'`), otherwise directory separators will need to be escaped (e.g. `"C:\\Users\\Default\\"`).
576+
549577
[^2]: Relative paths are prefixed with the config directory (i.e. if you have your config.toml in `/home/me/.config/halloy/config.toml`, path `.passwd/libera` will be converted to `/home/me/.config/halloy/.passwd/libera`).

book/src/configuration/sidebar/README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Sidebar settings for Halloy.
44

55
- [Sidebar](#sidebar)
66
- [Configuration](#configuration)
7-
- [server\_icon](#server_icon)
7+
- [server_icon](#server_icon)
88
- [position](#position)
9-
- [max\_width](#max_width)
10-
- [user\_menu](#user_menu)
11-
- [order\_by](#order_by)
12-
- [order\_channels\_by](#order_channels_by)
13-
- [channel\_name\_casing](#channel_name_casing)
9+
- [max_width](#max_width)
10+
- [user_menu](#user_menu)
11+
- [order_by](#order_by)
12+
- [order_channels_by](#order_channels_by)
13+
- [channel_name_casing](#channel_name_casing)
1414
- [Scrollbar](#scrollbar)
1515
- [Unread Indicator](#unread-indicator)
1616
- [Padding](#padding)
@@ -95,18 +95,25 @@ order_by = "config"
9595

9696
### order_channels_by
9797

98-
Include chantypes (channel prefixes, e.g., `#` and `##`) when sorting channels in the sidebar.
98+
Ordering for channels listed in the sidebar.
9999

100-
- `"name"`: Sort channels by name only, ignoring chantypes.
100+
- `"name"`: Sort channels by name only, ignoring chantypes (channel prefixes, e.g., `#` and `##`).
101101
- `"name-and-prefix"`: Sort channels by name including their chantypes.
102+
- `"config"`: Sort channels in the order they appear in your server's `channels`
103+
list. Any channels not in the list appear last, using default (`"name"`) sort.
102104

103105
```toml
104106
# Type: string
105-
# Values: "name", "name-and-prefix"
107+
# Values: "name", "name-and-prefix", "config"
106108
# Default: "name"
107109

108110
[sidebar]
109-
order_channels_by = "name-and-prefix"
111+
order_channels_by = "config"
112+
113+
# Example: When using "config", channels appear in this exact order:
114+
[servers.liberachat]
115+
channels = ["#rust", "#halloy", "#halloy-test"]
116+
# Result: #rust → #halloy → #halloy-test → (any other channels are sorted by "name")
110117
```
111118

112119
### channel_name_casing

0 commit comments

Comments
 (0)