Skip to content

Conversation

@msmithstubbs
Copy link
Contributor

@msmithstubbs msmithstubbs commented Jan 9, 2026

  • Adds a modal to the search page to list and delete saved searches.
  • Saved searches now appear in a modal for sources in the dashboard
CleanShot.2026-01-15.at.11.57.27.mp4

ANL-1178

@msmithstubbs msmithstubbs force-pushed the feat/saved-searches-modal branch 2 times, most recently from 2c30c8f to 16d4f97 Compare January 12, 2026 05:13
with %Logflare.SavedSearch{} = saved_search <- SavedSearches.get(saved_search_id),
true <- Sources.get_by_user_access(user, saved_search.source_id) |> is_struct(),
{:ok, _response} <- SavedSearches.delete_by_user(saved_search) do
_ = SavedSearches.Cache.bust_by(source_id: saved_search.source_id)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found busting the cache directly was required. The ContextCache buster wasn't clearing the cached list in time for the UI to fetch it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to do the busting in the context instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to do the busting in the context instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realised it would be simpler to just fetch the saved searches from the database directly. It's an async request for the user anyway, and we optimistically remove the deleted search from the UI so there's no UI delay.

@msmithstubbs msmithstubbs marked this pull request as ready for review January 12, 2026 06:23
@msmithstubbs msmithstubbs changed the title wip: Display saved searches in modal feat: Display saved searches in modal Jan 12, 2026
@msmithstubbs msmithstubbs force-pushed the feat/saved-searches-modal branch from dce198c to 7c022ae Compare January 12, 2026 22:14
@Ziinc
Copy link
Contributor

Ziinc commented Jan 13, 2026

@msmithstubbs instead of a consolidated modal on the dashboard, I think a separate modal icon button on the left of the icon button for each source will be much better, so that users can open up the same search modal and go to a saved search quickly.
Not a fan of the full consolidated list, too messy and noisy.
Let's do the icon modal in the same PR.

</li>
<li>
<.modal_link component={LogflareWeb.SearchLive.SavedSearchesModalComponent} modal_id={:saved_searches_link} title="Saved Searches">
<i class="fas fa-bookmark"></i><span class="hide-on-mobile"> saved searches </span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use bookmark icon for the save button as well then, so that there is some connection between to the two functions.
Maybe "saved" is enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the icon to bookmark and label to Saved

CleanShot 2026-01-15 at 12 02 38@2x

@msmithstubbs msmithstubbs force-pushed the feat/saved-searches-modal branch 2 times, most recently from edcb8a7 to 6584412 Compare January 15, 2026 01:45
@msmithstubbs
Copy link
Contributor Author

msmithstubbs commented Jan 15, 2026

a separate modal icon button on the left of the icon button for each source will be much better, so that users can open up the same search modal and go to a saved search quickly.

Added a button to the dashboard for each source. Not sure if I've understood the location correctly?
CleanShot 2026-01-15 at 12 04 44@2x

@msmithstubbs msmithstubbs force-pushed the feat/saved-searches-modal branch from 6584412 to 587298d Compare January 18, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants