feat(search): saved searches (LC-312) #333
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-312-saved-searches"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Save a message-search query (operators included) and re-run it in one click. No new full-page search surface: saved searches live in the existing search popover.
Changes
migrations/chat/0061_saved_searches.sql+db/saved_searches.rs: per-usersaved_searches(user_id, query, ...), UNIQUE(user_id, query), cap 50. The query string is its own label (one-click save, no name).routes/search.rs: empty-queryget_searchnow returns the saved list (scoped to the unscoped sidebar box);POST /searches(save, cap-gated, swaps to a "Saved" confirmation) andPOST /searches/delete(re-renders the list).views/search.rs+templates/search/saved.html: the saved-list fragment.templates/search/results.html: a one-click Save control.templates/partials/sidebar.html:focusadded to the message-searchhx-triggerso focusing the empty box shows saved searches.templates/layout.html: delegated[data-lc-saved-query]handler fills the search input + dispatchesinputto re-run.routes/mod.rs: register/searches+/searches/delete.locales/{en,es}/misc.ftl: new strings.Save/delete use buttons +
hx-include(not nested<form>s, which are invalid inside the search form).Testing
just check,just fmt,just test,just test-saasall pass.db_saved_searches.rs(add/list/remove/idempotent/per-user) androutes_saved_searches.rs(save -> appears in empty-q popover -> delete; idempotent; unauth 303).Not operator-visible (no env/config/contract change).