Skip to content

fix(ui): build valid search query when toggling favorites sort#13217

Open
ChristophWurst wants to merge 1 commit into
mainfrom
fix/ui/search-query-empty-string
Open

fix(ui): build valid search query when toggling favorites sort#13217
ChristophWurst wants to merge 1 commit into
mainfrom
fix/ui/search-query-empty-string

Conversation

@ChristophWurst

Copy link
Copy Markdown
Member

Enabling the favorites-first preference while no search was active set the query to the literal string "undefined not:starred", hiding all messages until the next reload. Disabling it left an empty string behind, which produced filters with a leading space and split the envelope cache into separate lists.

How to test

  1. Enable sorting favorites on top
  2. Open a mailbox with favs and non favs
  3. Toggle the feature off
  4. Toggle the feature back on
  5. Toggle the feature off
  6. Toggle the feature back on

main: the UI will alternate between fav/non-fav split and a single list, but the single list will sometimes only have the non-favs and no favs.
here: the UI will alternate between fav/no-fav split and a single list that always contains the favs too

You can also pay close attention to the XHR URLs that happen on goggle. On main there is a message fetch with filter=+not:starred -> notice the leading +. That means empty string + a filter. The frontend will therefore store the result in separate array keys.

Assisted-by: Claude:claude-fable-5

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Enabling the favorites-first preference while no search was active
set the query to the literal string "undefined not:starred", hiding
all messages until the next reload. Disabling it left an empty
string behind, which produced filters with a leading space and
split the envelope cache into separate lists.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Christoph Wurst <1374172+ChristophWurst@users.noreply.github.com>
@ChristophWurst

Copy link
Copy Markdown
Member Author

/backport to stable5.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant