Skip to content

feat(shortcuts): add Run Query, Open Connection and Add Rows actions to the Mac app - #3753

Merged
datlechin merged 4 commits into
mainfrom
feat/3628-mac-shortcuts-actions
Oct 21, 2026
Merged

datlechin merged 4 commits into
mainfrom
feat/3628-mac-shortcuts-actions

Conversation

@datlechin

@datlechin datlechin commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

  • App Intents in the Mac app (macOS 14 and later; the extracted metadata marks the actions 14.2): Open Connection, Run Query, Add Row to Table, Add Rows to Table, with Siri phrases.
  • Connection, Database or Schema and Table are entities picked from lists. Blocked connections are never listed. A shortcut saved before its connection was blocked fails with "External access is disabled for this connection".
  • Run Query goes through ScriptQueryRunner, which now takes a channel (AppleScript or Shortcuts): same External Clients check, Safe Mode, audit log and history as AppleScript, under a new Shortcuts history source and OperationCaller.shortcuts.
  • Run Query result: Rows (one JSON file per row, which Shortcuts reads as a dictionary keyed by column), First Value, CSV or JSON.
  • Add Row(s): Read Only refuses before connecting. Rows go through the grid's insert path (RowChangeStatementFactory, DataWriteExecutor), so drivers with their own row writes (Cassandra, DynamoDB, MongoDB) keep them. Safe Mode shows the whole batch with values once. One app-owned transaction on a pooled connection; an already open transaction is refused, never joined.
  • Open table tabs on the target table reload after an insert.
  • RowPayload, PayloadRow and IntentDataError move to TablePro/Core/Shortcuts/Shared/, compiled by both apps. Row planning is extracted to PayloadRowPlanner, which the iOS RowInsertPlanner now calls.
  • ExternalStatementGate.refuseWrite is the one home of the Read Only refusal. DataWriteStep.rowWrites is shared by the grid and Shortcuts.
  • A stored history filter equal to the full source set before Shortcuts widens to include it, as it did for AppleScript.
  • The External Clients footer in the connection form names Shortcuts.
  • Docs: docs(integrations): cover the Mac Shortcuts actions docs#103.

Test plan

  • New: QueryResultFilesTests, ShortcutsPlanningTests, ConnectionEntityQueryTests, GlobalStateSuites/ShortcutsActionTests (Blocked reason, deleted connection, Read Only before the gate and before connecting, SELECT count(*) value with .shortcuts history and gate caller, one-transaction insert, startup-command transaction, user's open transaction, partial write without transactions).
  • Updated: OperationConfirmationPromptTests (Shortcuts caller is distinguishable).
  • verify.sh test on those plus ScriptingPolicyTests, QueryHistorySourceTests, HistoryDateRangeTests, ExecutionAuditRecordTests, ScriptingDictionaryTests, HistoryPanelViewModelTests, DataChangeManagerTests: 133 passed.
  • verify.sh ios on the iOS intent and inserter suites: 67 passed. build, lint, l10n pass.
  • The built app's Metadata.appintents lists the four actions, three entities, the result enum and four App Shortcuts.
  • Not run in the Shortcuts app: the JSON-file-to-dictionary and text-to-number hand-off is Shortcuts' own coercion.

Not in this PR

  • A background action that cold-launches the app runs normal startup (Welcome or the restored session), as an AppleScript launch does. App Intents gives no signal before startup that the launch is for an intent.
  • MCP insert_rows (MCPConnectionBridge+Data.swift) still writes raw INSERTs row by row: no transaction, no driver row writers, no reload of open table tabs. Its rows arrive as typed JSON values, so moving it to the grid path changes the MCP contract and needs its own review.
  • features/table-operations.mdx in TableProApp/docs fails the menu-path check on main (sequence items).

Fixes #3628

…ts-actions

# Conflicts:
#	apple/TablePro/Resources/Localizable.xcstrings
…ts-actions

# Conflicts:
#	apple/TablePro/Resources/Localizable.xcstrings
@datlechin
datlechin merged commit 27a45c0 into main Oct 21, 2026
8 checks passed
@datlechin
datlechin deleted the feat/3628-mac-shortcuts-actions branch October 22, 2026 07:05
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.

Add Shortcuts actions to the Mac app

1 participant