search contexts: backend for setting as default and starring#44624
Conversation
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits d69cf06 and 1b52d29 or learn more. Open explanation
|
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 1b52d29...d69cf06.
|
…rmal query (#44875) * search contexts: remove autodefined contexts from frontend, add to normal query * generate * remove real global context, use union with dummy row instead * fix some tests * fix CountSearchContexts * add test for CountSearchContexts * search contexts: order contexts list by default first, then starred, then others (#44876) * search contexts: order contexts list by default first, then starred, then others * generate mocks * Add test for new order * explicit select and remove unused scan var * simplify getting authenticated user * fix go lint
|
@novoselrok @camdencheek I've merged the stacked PRs #44875 and #44876 into this and added some tests, can you take a quick second look? Thanks! |
camdencheek
left a comment
There was a problem hiding this comment.
A few comments, nothing blocking
| LEFT JOIN search_context_stars scs | ||
| ON scs.user_id = %d AND scs.search_context_id = sc.id | ||
| LEFT JOIN search_context_default scd | ||
| ON scd.user_id = %d AND scd.search_context_id = sc.id |
There was a problem hiding this comment.
This turned out pretty clean!
There was a problem hiding this comment.
Yes! Thank you!! Are there still any perf implications from so many joins?
There was a problem hiding this comment.
There definitely are, but these are joins on primary keys, so I'm not concerned by it. Nothing to worry about unless we see perf issues.
There was a problem hiding this comment.
Sounds great, thanks!
* search contexts: update header * add back tab * fix spacing * fix action button width
* search contexts: update header * search contexts: table view in management page * add menu * fix build failure * add back tab * fix spacing * fix action button width * address minor issues from figma * search contexts: card view for mobile (#45040) * search contexts: card view for mobile * fix build failure * give up on sr-only mixin
Part of #44903
This adds the backend code needed for allowing users to set a context as their default or starring a context. This does not yet have any changes to the behavior (eg. sort order or how default contexts will work).
Test plan
Updated existing tests to pass and made sure all the Go database tests pass with the new schema.
Not sure what other tests I should add here; this is relatively straightforward CRUD stuff. Any suggestions are appreciated.