Commit Graph

109 Commits

Author SHA1 Message Date
Val Lorentz fab114459b rustfmt
All checks were successful
CI / lint (push) Successful in 2m2s
CI / Build and test (, nightly) (push) Successful in 1m30s
CI / Build and test (, beta) (push) Successful in 4m2s
CI / Build and test (, 1.76.0) (push) Successful in 4m6s
2024-02-11 14:19:18 +01:00
Val Lorentz 5f38edcb3b Fix crash on small screens
Some checks failed
CI / lint (push) Failing after 28s
CI / Build and test (, 1.76.0) (push) Successful in 3m31s
CI / Build and test (, beta) (push) Successful in 3m25s
CI / Build and test (, nightly) (push) Successful in 56s
2024-02-11 11:41:21 +01:00
Val Lorentz df4134829b Move ComputedRoomInfo creation to its own long-running task
Some checks failed
CI / lint (push) Failing after 36s
CI / Build and test (, 1.76.0) (push) Successful in 3m39s
CI / Build and test (, beta) (push) Successful in 3m35s
CI / Build and test (, nightly) (push) Failing after 14m10s
This should remove another source of Futures churn.

Plus, it makes the code simpler as computed_roominfo doesn't need to be
an Option anymore in this new design.
2024-02-11 10:24:34 +01:00
Val Lorentz e7f3eeb331 poll_updates still needs to return when there are changes in order to update the UI 2024-02-11 09:02:40 +01:00
Val Lorentz 11bf79e95e rustfmt
Some checks failed
CI / lint (push) Successful in 3m33s
CI / Build and test (, nightly) (push) Failing after 1m33s
CI / Build and test (, beta) (push) Successful in 6m31s
CI / Build and test (, 1.76.0) (push) Successful in 6m34s
2024-02-10 20:28:09 +01:00
Val Lorentz e627e3b9a2 Update ratatui to match ansi-to-tui's version
Some checks failed
CI / Build and test (, nightly) (push) Waiting to run
CI / lint (push) Failing after 29s
CI / Build and test (, 1.76.0) (push) Has been cancelled
CI / Build and test (, beta) (push) Has been cancelled
2024-02-10 20:25:23 +01:00
Val Lorentz fa6c171916 Use long-running tasks for polling
Some checks failed
CI / lint (push) Failing after 33s
CI / Build and test (, 1.73.0) (push) Failing after 49s
CI / Build and test (, nightly) (push) Failing after 1m33s
CI / Build and test (, beta) (push) Failing after 3m17s
Instead of making poll_updates() create and cancel tasks every time it is
called (ie. on every tick)

This saves a lot of CPU, avoids a known memory leak that isn't patched
yet (https://github.com/jplatte/eyeball/pull/42).

It also seems to be a requirement to support async rendering code (eg.
to fetch images) as they cause `poll_updates` to be re-entrant, which
corrupted the timeline as `poll_updates` synchronized it through
`VectorDiff` and expected not to run again while a previous call was
still processing the previous `VectorDiff`.
2024-02-10 20:19:01 +01:00
Val Lorentz 115679d50d Inline RoomBuffer::id to avoid cloning Arcs all the time
All checks were successful
CI / lint (push) Successful in 4m9s
CI / Build and test (, 1.73.0) (push) Successful in 5m17s
CI / Build and test (, beta) (push) Successful in 5m16s
CI / Build and test (, nightly) (push) Successful in 4m43s
It accounts for half the CPU time in release mode
2023-12-17 18:03:17 +01:00
Val Lorentz 143f144e2c Remove ticking
We don't use it and it wastes CPU to cancel and re-create most futures on every tick
2023-12-17 18:03:17 +01:00
Val Lorentz b3ab8d734f Collapse buffers reorder happening within the same second
This reduces CPU-intensive churn, especially at startup
2023-12-16 16:21:29 +01:00
Val Lorentz ecbf745106 Prevent penultimate column's formatting from overflowing on last column's text
Some checks failed
CI / lint (push) Has been cancelled
CI / Build and test (, 1.73.0) (push) Has been cancelled
CI / Build and test (, beta) (push) Has been cancelled
CI / Build and test (, nightly) (push) Has been cancelled
2023-12-03 09:28:57 +01:00
Val Lorentz 8faf0d1902 Unescape HTML from prefixes, they are plain text
All checks were successful
CI / lint (push) Successful in 3m26s
CI / Build and test (, 1.73.0) (push) Successful in 7m7s
CI / Build and test (, beta) (push) Successful in 7m13s
CI / Build and test (, nightly) (push) Successful in 5m53s
2023-11-26 21:05:44 +01:00
Val Lorentz f5be73b915 Wrap buffer ids in Arc instead of cloning them
According to callgrind, a lot of time was spent in alloc/free for OwnedRoomId
structs contained in BufferId, even in release mode.
2023-11-26 21:05:44 +01:00
Val Lorentz 13965a7e67 Add '> ' prefix before each line of a blockquote, even after line-wrapping 2023-11-26 21:05:44 +01:00
Val Lorentz 61f30cfbf3 Randomly colorize mxids
All checks were successful
CI / lint (push) Successful in 3m32s
CI / Build and test (, beta) (push) Successful in 7m13s
CI / Build and test (, 1.73.0) (push) Successful in 7m14s
CI / Build and test (, nightly) (push) Successful in 5m45s
2023-11-26 04:14:49 +01:00
Val Lorentz ab98d565dc Compare atoms instead of strings
All checks were successful
CI / lint (push) Successful in 4m2s
CI / Build and test (, 1.73.0) (push) Successful in 7m27s
CI / Build and test (, beta) (push) Successful in 7m38s
CI / Build and test (, nightly) (push) Successful in 5m49s
2023-11-26 03:16:19 +01:00
Val Lorentz fc8193f892 Add support for formatting colors
All checks were successful
CI / lint (push) Successful in 3m27s
CI / Build and test (, 1.73.0) (push) Successful in 6m36s
CI / Build and test (, beta) (push) Successful in 7m1s
CI / Build and test (, nightly) (push) Successful in 5m38s
2023-11-26 02:32:21 +01:00
Val Lorentz 39134af79d Add support for formatting lists
All checks were successful
CI / lint (push) Successful in 3m21s
CI / Build and test (, 1.73.0) (push) Successful in 6m49s
CI / Build and test (, beta) (push) Successful in 6m58s
CI / Build and test (, nightly) (push) Successful in 5m48s
2023-11-26 01:49:59 +01:00
Val Lorentz 221af7d1b9 Collapse newlines from consecutive blocks and add indent to blockquote
All checks were successful
CI / lint (push) Successful in 3m30s
CI / Build and test (, 1.73.0) (push) Successful in 6m56s
CI / Build and test (, beta) (push) Successful in 7m0s
CI / Build and test (, nightly) (push) Successful in 5m44s
2023-11-25 23:33:14 +01:00
Val Lorentz 43f71e9caa Restore support for line breaks
All checks were successful
CI / lint (push) Successful in 3m29s
CI / Build and test (, 1.73.0) (push) Successful in 6m41s
CI / Build and test (, beta) (push) Successful in 6m51s
CI / Build and test (, nightly) (push) Successful in 5m39s
2023-11-25 22:13:53 +01:00
Val Lorentz f0b2536e86 fmt and clippy
All checks were successful
CI / lint (push) Successful in 3m24s
CI / Build and test (, beta) (push) Successful in 7m0s
CI / Build and test (, 1.73.0) (push) Successful in 7m39s
CI / Build and test (, nightly) (push) Successful in 5m59s
2023-11-25 21:43:30 +01:00
Val Lorentz 2385f33e6b Fix tests
Some checks failed
CI / lint (push) Failing after 1m4s
CI / Build and test (, 1.73.0) (push) Successful in 6m56s
CI / Build and test (, beta) (push) Successful in 7m15s
CI / Build and test (, nightly) (push) Successful in 6m45s
2023-11-25 21:24:47 +01:00
Val Lorentz f270ef25b4 Add minimal support for HTML formatting
Just bold/italic/underline for now.
2023-11-25 21:18:24 +01:00
Val Lorentz f4f134870b buflist: Set last_area as soon as possible
Some checks failed
CI / lint (push) Failing after 49s
CI / Build and test (, 1.73.0) (push) Failing after 5m11s
CI / Build and test (, beta) (push) Failing after 5m32s
CI / Build and test (, nightly) (push) Failing after 5m13s
2023-11-25 10:08:03 +01:00
Val Lorentz 9a422a6d7e Fix rooms with no messages being colored as if they had unread messages
Some checks failed
CI / lint (push) Failing after 35s
CI / Build and test (, 1.73.0) (push) Failing after 3m6s
CI / Build and test (, beta) (push) Failing after 3m15s
CI / Build and test (, nightly) (push) Has been cancelled
2023-11-25 09:59:39 +01:00
Val Lorentz d79f5d7527 Make history-related constants configurable
Some checks failed
CI / lint (push) Failing after 59s
CI / Build and test (, 1.73.0) (push) Failing after 5m1s
CI / Build and test (, beta) (push) Failing after 5m8s
CI / Build and test (, nightly) (push) Failing after 4m46s
2023-11-22 18:13:38 +01:00
Val Lorentz 501ccc007e Fix tests
All checks were successful
CI / lint (push) Successful in 2m21s
CI / Build and test (, 1.73.0) (push) Successful in 5m17s
CI / Build and test (, beta) (push) Successful in 5m40s
CI / Build and test (, nightly) (push) Successful in 5m7s
2023-11-22 17:28:30 +01:00
Val Lorentz 9cef34eb5c Switch to upstream matrix-sdk
Some checks failed
CI / lint (push) Successful in 4m13s
CI / Build and test (, 1.73.0) (push) Failing after 7m32s
CI / Build and test (, beta) (push) Failing after 7m54s
CI / Build and test (, nightly) (push) Failing after 4m32s
2023-11-22 16:50:30 +01:00
Val Lorentz 1c8c6d3e3e Make PageUp/PageDown behavior configurable and default to 50% 2023-11-22 15:56:56 +01:00
Val Lorentz c7124c1191 Silence clippy
Some checks failed
CI / lint (push) Failing after 2m30s
CI / Build and test (, 1.73.0) (push) Failing after 3m14s
CI / Build and test (, beta) (push) Failing after 3m35s
CI / Build and test (, nightly) (push) Failing after 2m37s
2023-11-22 09:43:01 +01:00
Val Lorentz 30b1e4282a buflist: Use different color when only non-messages are unread
Some checks failed
CI / lint (push) Failing after 2m30s
CI / Build and test (, 1.73.0) (push) Successful in 5m1s
CI / Build and test (, beta) (push) Successful in 6m8s
CI / Build and test (, nightly) (push) Successful in 5m24s
2023-11-19 18:24:26 +01:00
Val Lorentz b60834ebb3 buflist: Show rooms with unread events in red
All checks were successful
CI / lint (push) Successful in 2m27s
CI / Build and test (, 1.73.0) (push) Successful in 5m15s
CI / Build and test (, beta) (push) Successful in 6m22s
CI / Build and test (, nightly) (push) Successful in 5m33s
2023-11-19 17:12:55 +01:00
Val Lorentz 8d6a076b59 Color rooms in the buflist based on notifications/highlights
All checks were successful
CI / lint (push) Successful in 2m24s
CI / Build and test (, 1.73.0) (push) Successful in 4m57s
CI / Build and test (, beta) (push) Successful in 6m2s
CI / Build and test (, nightly) (push) Successful in 5m22s
2023-11-19 11:21:32 +01:00
Val Lorentz 9c9f21bc82 Clippy
All checks were successful
CI / lint (push) Successful in 1m56s
CI / Build and test (, beta) (push) Successful in 4m15s
CI / Build and test (, 1.73.0) (push) Successful in 4m27s
CI / Build and test (, nightly) (push) Successful in 5m5s
2023-11-18 19:00:34 +01:00
Val Lorentz dd9028cbb2 Identify active buffer by id instead of index
Some checks failed
CI / lint (push) Failing after 2m19s
CI / Build and test (, 1.73.0) (push) Has been cancelled
CI / Build and test (, beta) (push) Has been cancelled
CI / Build and test (, nightly) (push) Has been cancelled
So the active buffer doesn't change when buffers are reordered
2023-11-18 18:58:45 +01:00
Val Lorentz e03970a931 buflist: Add support for clicks to switch buffers
Some checks failed
CI / lint (push) Failing after 2m5s
CI / Build and test (, beta) (push) Successful in 4m15s
CI / Build and test (, 1.73.0) (push) Successful in 4m23s
CI / Build and test (, nightly) (push) Successful in 5m12s
2023-11-18 18:32:55 +01:00
Val Lorentz f4ea84b862 buflist: Add support for multiple columns
All checks were successful
CI / lint (push) Successful in 1m44s
CI / Build and test (, beta) (push) Successful in 4m3s
CI / Build and test (, 1.73.0) (push) Successful in 4m21s
CI / Build and test (, nightly) (push) Successful in 5m6s
2023-11-18 11:32:00 +01:00
Val Lorentz 56bab04a5a Remove register_config_handler, pass config directly to ::new()
Some checks failed
CI / Build and test (, nightly) (push) Waiting to run
CI / lint (push) Successful in 1m37s
CI / Build and test (, 1.73.0) (push) Has been cancelled
CI / Build and test (, beta) (push) Has been cancelled
2023-11-18 11:28:45 +01:00
Val Lorentz 2856dd0504 Hardcode default config, and document how config works 2023-11-18 11:27:32 +01:00
Val Lorentz fec449b933 Segregate lint and test cache
All checks were successful
CI / lint (push) Successful in 1m17s
CI / Build and test (, beta) (push) Successful in 2m20s
CI / Build and test (, 1.73.0) (push) Successful in 2m35s
CI / Build and test (, nightly) (push) Successful in 1m43s
As Clippy does not compile dependencies and completes first, they end up never being cached
2023-11-17 16:50:50 +01:00
Val Lorentz 929920edb2 Install zstd 2023-11-17 16:50:49 +01:00
Val Lorentz dd404147ab Preserve current position when new items are added to a buffer
All checks were successful
CI / lint (push) Successful in 5m3s
CI / Build and test (, 1.73.0) (push) Successful in 9m34s
CI / Build and test (, beta) (push) Successful in 9m34s
CI / Build and test (, nightly) (push) Successful in 8m46s
2023-11-17 14:34:16 +01:00
Val Lorentz 9b29d4d9e5 Add CI (#1)
All checks were successful
CI / lint (push) Successful in 4m49s
CI / Build and test (, 1.73.0) (push) Successful in 10m24s
CI / Build and test (, beta) (push) Successful in 10m24s
CI / Build and test (, nightly) (push) Successful in 8m51s
Reviewed-on: #1
Co-authored-by: Val Lorentz <progval+git+ratatrix@progval.net>
Co-committed-by: Val Lorentz <progval+git+ratatrix@progval.net>
2023-11-14 22:19:54 +00:00
Val Lorentz 2a32db27ea Clippy 2023-11-14 22:33:05 +01:00
Val Lorentz 1ff972803b Don't depend on ~/.config/ in tests 2023-11-14 20:14:19 +01:00
Val Lorentz 9d2555c1a1 Update tests 2023-11-13 22:14:22 +01:00
Val Lorentz e048638735 Prevent the last child of a space from being stolen by other space later
This caused flickering on screen where children shared by two spaces
would rotate on every render.
2023-11-12 11:08:24 +01:00
Val Lorentz 27b4fd7881 List space children in canonical order 2023-11-12 10:55:05 +01:00
Val Lorentz 29d69a2bc0 Fetch backlog more eagerly
By fetching it when the user gets close to the end of the backlog (rather than
waiting for them to actually see the end)
2023-11-11 10:59:19 +01:00
Val Lorentz b1d98c0da0 Only fetch display_name/parent/children if there was any update to the room state
Previously, fetching those pinned a whole CPU core, and panicked with
`called `Option::unwrap()` on a `None` value` here:
https://github.com/bikeshedder/deadpool/blob/deadpool-sync-v0.1.2/sync/src/lib.rs#L122
presumably because the high churn in created and dropped futures.

Technically we should re-fetch the parent if any space was updated (because
`Room::parent_spaces()` checks relationships are reciprocal), but
let's do this later
2023-11-11 10:40:26 +01:00