Skip to content

feat(history): add local query insights - #2111

Open
sophiathedev wants to merge 3 commits into
TableProApp:mainfrom
sophiathedev:feat/query-history-insights
Open

feat(history): add local query insights#2111
sophiathedev wants to merge 3 commits into
TableProApp:mainfrom
sophiathedev:feat/query-history-insights

Conversation

@sophiathedev

@sophiathedev sophiathedev commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a Starter-gated Insights mode to Query History for the current connection
  • surface most-run, slowest, and week-over-week regressed queries from the local SQLite history store
  • add native master-detail UI with copy and load-in-editor actions
  • document the feature and include a full-window macOS preview

Behavior

  • Most Run counts successful and failed executions
  • Slowest uses only valid successful durations
  • Slower Than Last Week compares two half-open seven-day windows
  • regressions require at least three samples per window, a 25% increase, and a 50 ms absolute increase
  • switching connections clears stale results while the new scope loads

Security and edge cases

  • all aggregation stays on-device
  • SQL uses bound parameters for connection and time scope
  • blank queries, future entries, invalid dates, negative or non-finite durations, oversized limits, and extreme ratios are handled
  • results are scoped by exact connection, database, and query

Testing

  • 55 focused app tests across Query History, storage, licensing, selection, and date filtering
  • 10 deeper insight tests after edge-case fixes
  • 181 TableProCore package tests
  • Debug build
  • strict SwiftLint: 0 violations across 1,345 files
  • full-window macOS preview capture
  • UI automation execution locally: AppleSystemPolicy blocks ad-hoc UI test runners without development signing; the signed UI test is included for CI
  • full TableProTests run: 9,338 tests executed with 79 failures outside Query History

Preview

Query History Insights

Related

Follow-up to #2103.

Closes #2107

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +50 to +51
if let selection, !QueryHistoryInsightSelection.all(in: loadedSnapshot).contains(selection) {
self.selection = nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@sophiathedev
sophiathedev force-pushed the feat/query-history-insights branch from a9ac7ef to 9c6f8cf Compare August 14, 2026 03:42
@sophiathedev
sophiathedev force-pushed the feat/query-history-insights branch from 9c6f8cf to 40b2ae1 Compare August 14, 2026 03:55
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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.

Give Starter value that does not depend on sync

2 participants