Inline AI editing (✨ generate / rewrite, streaming, @-context)#252
Open
dep wants to merge 21 commits into
Open
Inline AI editing (✨ generate / rewrite, streaming, @-context)#252dep wants to merge 21 commits into
dep wants to merge 21 commits into
Conversation
Design for editing the current note via AI: active-line ✨ to generate at cursor, selection ✨ to rewrite via inline diff, Anthropic key in Keychain, per-request model picker (Haiku 4.5 / Sonnet 4.6 / Opus 4.8), @-note context autocomplete, and streamed output over direct URLSession SSE. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Nine TDD-structured tasks: AIModel, KeychainStore, AIContextResolver, AIRequestBuilder, AnthropicClient (SSE), InlineAIController, Settings integration, InlineAIView, and editor wiring. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
XcodeGen adds PBXBuildFile/PBXFileReference entries for the 7 new AI-feature source and test files. Pure additions, no deletions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…us polish Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… diff) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…r + Esc to close Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ard rewrite autosave Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…diff - Retry now discards the prior generation (discardOutput) before re-streaming, so it replaces rather than appends (was concatenating onto the last result). - The bar re-anchors below the streamed text as it grows, flipping to above the region when a long diff would push it off-screen — it no longer covers the diff. - Adds discardOutput() + 5 regression tests for the Retry replace behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
… first row - @mentions now resolve folders (concatenates a folder's direct notes) in addition to notes; autocomplete lists both with file/folder icons (allFolders wired through AIContextResolver + the bar). Fixes directories not appearing for @Weekly etc. - Prompt field is now multiline (axis: .vertical): Enter submits, Shift+Enter inserts a newline; the bar grows to fit and re-anchors. - The bar has a drag handle and can be repositioned; once moved it stops auto-snapping below the streamed text. - First @-suggestion is now clickable: the invisible Esc handler moved to a non-layout, non-hit-testing background, and each row has an explicit contentShape. - Adds 5 folder-resolution tests (35 resolver+controller tests pass). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the ability to edit the current note with AI, inline in the editor:
@note/@[Multi Word Note]autocomplete in the prompt to pull vault notes in as context (reuses the existing command-palette filename scoring; ~100K-char cap).URLSessionSSE toapi.anthropic.com/v1/messages(no SDK dependency, mirrors the existingGistPublisherpattern). Stop button / Esc cancels, keeping whatever streamed.Built spec-first → plan → subagent-driven TDD, one unit per task with two-stage (spec + code-quality) review, plus a holistic final review that caught and fixed two cross-unit seam bugs (spaced-filename
@-token mismatch; generate-error retry concatenation).Architecture (new files)
AIModelKeychainStoreSecItemwrapper for the API key.AIContextResolver@name→ note-content resolution, capped, with missing/truncation reporting. Pure.AIRequestBuilder/v1/messagesbody for generate/rewrite. Pure.AnthropicClientURLSession.bytesSSE →AsyncThrowingStream<String>, typed error mapping, injectable session.InlineAIControllerNSTextStorage.InlineAIViewAISparkleButton(NSControl ✨) + the SwiftUI bar +@-autocomplete.Plus:
SettingsManager/SettingsView(key + default model), andEditorViewwiring (✨ positioning, bar presentation, streaming → controller, transient diff coloring, teardown on note switch).Test Plan
Automated (passing): 48 new unit tests across the 6 logic units + settings persistence.
xcodebuild buildsucceeds; app launches.Manual QA needed (not exercised by automated tests — requires a real API key):
@+ letters → suggestions appear; pick one → inserts@name(or@[Multi Word]for spaced filenames) → resolves as context.🤖 Generated with Claude Code