Repository navigation
fix: restore cached network sidebars immediately - #10
Conversation
9688a87 to
592de3d
Compare
itz4blitz
left a comment
There was a problem hiding this comment.
The sidebar cache looks right: stale reads are dropped with the epoch check, Slack and Teams trees stay on their existing loading path, and macOS, Linux, and Windows CI are green.
This cannot merge as-is. The branch is behind current main and conflicts in two places after #8:
crates/tinyclient/src/gui/sidebar/home.rs— keep #8'sdiscord()guard (if !home.loaded_once { return Vec::new(); }) and its Discord regression tests, and keep this PR'sswitch_networkplus the cache tests.docs/design/polish/02-discord-slack.md— keep both #8's first-load / DM-order paragraph and this PR's session-cache paragraph.
Please rebase onto main and resolve those two files that way.
Keep network homes and their folds across navigation, then refresh from chatd in the background. Skip the event debounce on explicit navigation and invalidate outstanding reads before saving a home. Restore the root loading state when leaving a sublist so cached empty homes remain ready. Document the session cache and cover navigation, folds, and stale reads with regression tests. All eleven GUI home model tests pass. Co-Authored-By: GPT-6 <noreply@openai.com>
592de3d to
76afb30
Compare
itz4blitz
left a comment
There was a problem hiding this comment.
The rebase does what the last review asked. discord() still returns nothing until loaded_once, the Discord order tests are still here, and switch_network plus the session-cache paragraph sit beside them. Leaving a home bumps the epoch before the home is saved, so a read that started earlier cannot overwrite the restored sidebar, and a same-network click does not bump it. Slack and Teams still load through their own trees.
Approving. I'll merge once macOS, Linux, and Windows finish green on 76afb30.
|
Approved on 76afb30. Windows failed |
Switching away from Signal or another network discarded its sidebar, so returning showed “Getting your … chats…” and waited for the 150 ms event debounce before rereading the local daemon.
Keep each network's home in memory for the GUI session. Returning restores chats and expanded sections immediately, then refreshes from chatd in the background. Explicit navigation skips the debounce; background event bursts still coalesce. First visits still need a local read. Outstanding reads are invalidated when leaving a home, and leaving a sublist restores the root's loading readiness.
Rebased onto upstream
mainat 7ac7c74 after #8 merged, addressing the requested review changes. Keep #8's initial Discord loading guard and its regression tests, alongside this PR'sswitch_networkand cache tests. Preserve both the first-load/DM-order documentation and the session-cache paragraph. This is a single focused commit. Slack workspace trees and Teams channel trees retain their existing separate loading behavior.Validation:
git diff --checkpasses.