feat(history): add local query insights - #2111
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9ac7ef321
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if let selection, !QueryHistoryInsightSelection.all(in: loadedSnapshot).contains(selection) { | ||
| self.selection = nil |
There was a problem hiding this comment.
Preserve selection using the insight's stable identity
When the selected query is executed again, the history notification reloads this snapshot, but QueryHistoryInsightSelection hashes the entire insight, including counts, timings, and lastExecutedAt. The refreshed value therefore never matches the existing selection even if the same query remains in the same category, so this branch clears the selection and closes the detail pane after the run. Match by category plus insight.id, then replace the selection with the refreshed insight so its metrics update without losing the user's context.
Useful? React with 👍 / 👎.
a9ac7ef to
9c6f8cf
Compare
9c6f8cf to
40b2ae1
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Behavior
Security and edge cases
Testing
Preview
Related
Follow-up to #2103.
Closes #2107