Add diagnostics center, writable PR review, notification actions, setup-script editor, and prompt library - #467
Conversation
Add review.replyToThread, review.resolveThread, and review.submitReview RPCs (gated on the existing review:write scope) so clients can reply to review threads, resolve/reopen them, and submit APPROVE/COMMENT/ REQUEST_CHANGES reviews without leaving the app. GitHub-only, matching the read side; other providers keep the standard fallback error. Refs: docs/project/macos-top-100-missing-features.md rank 11
Persist a prompt library (global + per-project prompts with optional description and favorite flag) on ServerSettings so storage, transport, redaction, and the settingsUpdated stream come for free. Whole-object patch replacement matches customInstructions; pre-existing settings files decode via the same withDecodingDefault pattern. Refs: docs/project/macos-top-100-missing-features.md rank 23
Register an agent.approval UNNotificationCategory with Approve and Deny actions, carry the approval request id in the notification payload, and route action taps through a pure policy mapping into the existing id-based approval response path. Stale requests select the affected thread and surface the error instead of failing silently. Approval banners are now keyed by request id so concurrent approvals on one thread no longer replace each other. Refs: docs/project/macos-top-100-missing-features.md rank 76
Add a Project Settings sheet from the sidebar project context menu that creates, edits, reorders, and deletes project scripts (name, command, icon, runOnWorktreeCreate, preview URL/auto-open) and persists the full list through the existing project.meta.update path. The UI model now carries the preview fields the wire model always had, and the command palette shares the hoisted icon-to-symbol mapping. Refs: docs/project/macos-top-100-missing-features.md rank 39
Consume the four server diagnostics RPCs (trace diagnostics, process tree, resource history, process signaling) that previously had no Mac client. Add a Diagnostics settings tab with a process table and confirmed SIGINT/SIGKILL controls, per-process CPU/memory history, a trace/log console with copyable warning and error events, and an observability section. Extend the Connection tab with a mode-aware diagnostic checklist (descriptor, auth session, server version, WebSocket) that names a concrete fix per failure. Refs: docs/project/macos-top-100-missing-features.md ranks 17, 91, 92
Wire the new review.replyToThread, review.resolveThread, and review.submitReview RPCs into the native review sheet: per-thread reply editor, resolve/reopen button, and a review composer with Comment, Approve, and Request changes submission. Mutations serialize behind an in-flight guard, surface errors inline and through the global error path, and refetch the snapshot on success. Refs: docs/project/macos-top-100-missing-features.md rank 11
Decode and sync the new promptLibrary server settings, add a Prompts settings tab for global and per-project prompts (create, edit, favorite, delete, insert into composer, copy body), and add a $ completion source to the composer that ranks enabled provider skills ahead of library prompts (favorites first) and inserts the skill name or prompt body. Also place the Diagnostics tab in the settings sidebar so it is navigable. Refs: docs/project/macos-top-100-missing-features.md ranks 23, 24
SergeSerb2
left a comment
There was a problem hiding this comment.
Feature-rich PR adding diagnostics center, writable PR review, notification actions, prompt library, and project-settings editor. Code is well-structured with solid error handling and testability; needs verification that two field declarations (pendingDecisionResponseIDs, skills) are present in the actual file.
Could not anchor
- important
apps/mac/Sources/SurgeCodeMac/Model/AppModel.swift:3519 —respondToApprovalusespendingDecisionResponseIDsas a Set to track in-flight responses, but its declaration doesn't appear in the visible diff. If this is a new property being added in this PR, its declaration line must appear as a+line somewhere in the AppModel changes. Verify it's declared at the top of the class (e.g.,private var pendingDecisionResponseIDs = Set<String>()), or this will fail to compile.
SurgeCode auto-review · model=codex/gpt-5.6-luna · head=ea6315ea0487
|
Review follow-up for the unanchored pendingDecisionResponseIDs finding: confirmed the declaration already exists near the top of AppModel.swift (public private(set) var pendingDecisionResponseIDs: Set = []) and is present on the PR base, so it is intentionally not a new + line in this PR. respondToApproval and the user-input response path use the same set safely. The relevant macOS build and RendererSidebarContractTests pass; no source change was needed for this verification finding. |
Summary
Implements the five feature picks from the Recommended next (2026-08-03) section landed by #464 in
docs/project/macos-top-100-missing-features.md, at their smallest independently shippable slices. The UI/UX audit's list is deliberately untouched, per request.review.replyToThread,review.resolveThread, andreview.submitReviewRPCs (contracts + server, GitHub-only like the read side, gated on the pre-existingreview:writescope; commit id resolved server-side). The native review sheet grows per-thread reply editors, resolve/reopen buttons, and a Comment/Approve/Request-changes composer; mutations serialize behind an in-flight guard and refetch on success.UNNotificationActions and the request id; action taps flow through a pure policy mapping into the existing id-based approval response path. Stale requests select the affected thread and surface the error instead of failing silently; approval banners are keyed by request id so concurrent approvals on one thread no longer replace each other.runOnWorktreeCreate, preview URL/auto-open), saved whole-list through the existingproject.meta.updatepath. The UI model finally carries the preview fields the wire model always had; the command palette shares the hoisted icon mapping.promptLibrarycontracts schema onServerSettings(global + per-project prompts, whole-object patch replacement, backward-compatible decoding defaults). Mac: Prompts settings tab (CRUD, favorite, insert-into-composer, copy body) synced viasettingsUpdated, and a$completion source in the composer ranking enabled provider skills ahead of library prompts (favorites first), inserting the skill name or prompt body.Known follow-ups left in the backlog: inline line-anchored PR comments + non-GitHub review providers; Stop/Snooze/Answer notification actions; log-file tailing RPC for the console; prompt parameterization/version history/run-in-new-thread; script timeout/env fields (no contract support yet).
Design notes (per the audit's spec requirement)
orchestration:read(reads),orchestration:operate(signal); server refuses non-descendant pidsreview:writescopeproject.meta.update), Mac editsorchestration:write(existing)settingsUpdatedrefreshes peersArea
apps/mac— native macOS appapps/windows— Windows desktop appapps/mobile— iPhone companion appapps/server— backend serverpackages/contracts,packages/shared,packages/client-runtime, …) or relay (infra/relay)Release size
size:XS— tiny internal, documentation, or narrowly scoped fixsize:S— small user-visible fix or contained improvementsize:M— normal feature or meaningful behavior changesize:L— broad feature or substantial cross-package changesize:XL— release-system, architecture, or ecosystem-scale changeVerification
pnpm run verify --allpasses (check + typecheck + tests; addslint:mobileand the Swift suite)pnpm run test:macpasses (required forapps/macchanges)pnpm run verify --allgreen end-to-end:vp check0 errors, typecheck clean across 13 packages, 209 TS test files / 1935 tests passing, full Swift suite passing (1178 tests incl. the new suites: diagnostics RPC coding + presentation + connection checklist, review RPC coding + mutation flow, notification action mapping + approval responses, project-script editor + palette reflection, prompt library coding + composer$suggestions),lint:mobileclean. One rerun was needed for a settings-tab count guard and one for load-flakedserver.test.tscases (111/111 pass in isolation); neither touched the shipped code. New UI was exercised through swift-testing suites and the registered UIProbe snapshot; the app was not run manually.Screenshots / Recordings
Not captured — built and verified headlessly via the test suites; happy to attach captures on request.
Release notes
Adds a diagnostics/process/log center with a connection checklist, writable GitHub PR review, Approve/Deny notification actions, a project setup-script editor, and a prompt library with composer
$mentions to the macOS app.