Skip to content

Commit 426cf52

Browse files
committed
A late answer for other words never lands, and the words say what they mean.
Every place that drops the network's answer also drops its ask count, so an answer that took its time cannot repopulate the pane for words or a scope that have moved on. The record of what the last ask named holds the Space now too, so a Space scope follows what is open the same way a conversation scope does. And the empty state's words tell the two cases apart: asked and found nothing, or never asked.
1 parent df4dd48 commit 426cf52

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • crates/tinyclient/src/gui/conversation

‎crates/tinyclient/src/gui/conversation/side.rs‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ pub struct Side {
3333
pub search: Option<SearchPage>,
3434
/// The search pane's field and its wiring, alive while the pane is.
3535
search_input: Option<SearchField>,
36-
/// The conversation the search page asked about, for "this conversation" to follow.
36+
/// The conversation or Space the search page's last ask named, for the scope to follow
37+
/// what is open.
3738
search_asked_for: Option<Key>,
3839
/// How often the cache was asked for the search pane, counted across pages: a page remade
3940
/// starts at nothing, and its number must never meet an older ask's.
@@ -282,17 +283,20 @@ impl Shell {
282283
None => {
283284
page.scope = Scope::Everywhere;
284285
page.network = None;
286+
page.network_asked = 0;
285287
reask = true;
286288
}
287289
Some(name) if side.search_asked_for.as_ref() != Some(&name) => {
288290
page.network = None;
291+
page.network_asked = 0;
289292
reask = true;
290293
}
291294
_ => {}
292295
},
293296
Scope::Space => {
294297
if side.search_asked_for.as_ref() != open_space.as_ref() {
295298
page.network = None;
299+
page.network_asked = 0;
296300
if open_space.is_none() {
297301
page.scope = Scope::Everywhere;
298302
}
@@ -511,6 +515,7 @@ impl Shell {
511515
page.hits = None;
512516
page.picked = None;
513517
page.network = None;
518+
page.network_asked = 0;
514519
}
515520
self.reask_search(cx);
516521
if let Some(field) = &self.conversation_state.side.search_input {
@@ -584,6 +589,7 @@ impl Shell {
584589
page.hits = None;
585590
page.picked = None;
586591
page.network = None;
592+
page.network_asked = 0;
587593
self.reask_search(cx);
588594
}
589595

@@ -690,6 +696,7 @@ impl Shell {
690696
if let Some(page) = self.conversation_state.side.search.as_mut() {
691697
page.hits = None;
692698
page.network = None;
699+
page.network_asked = 0;
693700
}
694701
cx.notify();
695702
return;

0 commit comments

Comments
 (0)