mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-07-21 21:31:12 +02:00
fix(x): don't re-apply stale assistant email search on re-entering email view (#762)
The assistant's read-view email search stored its query in emailInitialSearchQuery and never cleared it, so every later visit to the email section remounted EmailView with the old query re-injected into the search box — even after the user had cleared it. Clear the stored query on any email navigation that doesn't carry an explicit search (sidebar, openEmailView) so deep-linked searches apply exactly once. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
826bce90ad
commit
2575238a01
1 changed files with 7 additions and 0 deletions
|
|
@ -4281,6 +4281,9 @@ function App() {
|
|||
setEmailInitialThreadId(threadId)
|
||||
setEmailThreadIdVersion((v) => v + 1)
|
||||
}
|
||||
// Same reason as in navigateToView: a stale assistant-driven search must
|
||||
// not repopulate the search box when the user re-enters the email view.
|
||||
setEmailInitialSearchQuery(null)
|
||||
ensureEmailFileTab()
|
||||
}, [ensureEmailFileTab])
|
||||
|
||||
|
|
@ -4455,6 +4458,10 @@ function App() {
|
|||
if (view.searchQuery) {
|
||||
setEmailInitialSearchQuery(view.searchQuery)
|
||||
setEmailSearchQueryVersion((v) => v + 1)
|
||||
} else {
|
||||
// Otherwise a past assistant-driven search would be re-applied on
|
||||
// every re-entry, even after the user cleared the search box.
|
||||
setEmailInitialSearchQuery(null)
|
||||
}
|
||||
ensureEmailFileTab()
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue