feat: add foundation model for summarization#21
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds an on-device summarization option backed by Apple’s Foundation Models framework and wires it into the app’s summarization flows. The PR also expands the Briefings sidebar UI with branch scoping, copy-to-clipboard, and a waterfall-style layout (via a new third-party dependency).
Changes:
- Add
FoundationModelSummarizationServiceand integrate it as a newSummarizationProviderinAppStatesummarization/title/briefing paths. - Update Settings UI to show/select the new provider (and gate provider visibility based on device availability).
- Revamp Briefings sidebar layout and filtering (branch scope toggle, project filters, waterfall grid, copy button), adding
WaterfallGridas a dependency.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| RxCode/Views/Sidebar/BriefingView.swift | Adds branch scoping + copy button + waterfall grid layout for briefings. |
| RxCode/Views/SettingsView.swift | Updates summarization provider picker and adds Apple Foundation Model status UI. |
| RxCode/Views/Chat/ThreadTitlePopoverButton.swift | Simplifies title rendering by only showing a popover button when a summary exists. |
| RxCode/Services/FoundationModelSummarizationService.swift | Introduces on-device summarization/title generation via Foundation Models. |
| RxCode/App/AppState.swift | Adds the new provider and routes summarization calls to the Foundation Models service. |
| RxCode.xcodeproj/.../Package.resolved | Adds WaterfallGrid SwiftPM pin. |
| RxCode.xcodeproj/project.pbxproj | Adds WaterfallGrid package dependency to the Xcode project. |
Comments suppressed due to low confidence (1)
RxCode/Views/Sidebar/BriefingView.swift:325
- Same issue here:
Label(..., systemImage: "")uses an empty symbol name for the unchecked state. Consider conditionally rendering the icon (or usingText) so menu rows don’t rely on an invalid system image name.
Button {
selectedProjectIds.removeAll()
} label: {
Label("All projects", systemImage: selectedProjectIds.isEmpty ? "checkmark" : "")
}
Divider()
ForEach(projects) { project in
Button {
toggleProject(project.id)
} label: {
Label(
project.name,
systemImage: selectedProjectIds.contains(project.id) ? "checkmark" : ""
)
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| /// Cached current branch per project path, refreshed when the project list changes. | ||
| @State private var currentBranchByProject: [UUID: String] = [:] | ||
| @State private var branchRefreshTask: Task<Void, Never>? |
Comment on lines
+267
to
+272
| Label("Current branch", systemImage: showAllBranches ? "" : "checkmark") | ||
| } | ||
| Button { | ||
| showAllBranches = true | ||
| } label: { | ||
| Label("All branches", systemImage: showAllBranches ? "checkmark" : "") |
Comment on lines
+147
to
+153
| private func refreshCurrentBranches() async { | ||
| var resolved: [UUID: String] = [:] | ||
| for project in appState.projects { | ||
| if let branch = await GitHelper.currentBranch(at: project.path) { | ||
| resolved[project.id] = branch | ||
| } | ||
| } |
Comment on lines
+112
to
124
| /// Returns the providers that should be offered to the user right now. | ||
| /// Apple Foundation Model is hidden when the device doesn't support it | ||
| /// (non-Apple-Silicon Mac, Apple Intelligence disabled, etc.). | ||
| @MainActor | ||
| static var availableCases: [SummarizationProvider] { | ||
| allCases.filter { provider in | ||
| switch provider { | ||
| case .appleFoundationModel: | ||
| return FoundationModelSummarizationService.isAvailable | ||
| case .selectedClient, .openAI: | ||
| return true | ||
| } | ||
| } |
Comment on lines
674
to
678
| Picker("Provider", selection: $appState.summarizationProvider) { | ||
| ForEach(SummarizationProvider.allCases) { provider in | ||
| ForEach(SummarizationProvider.availableCases) { provider in | ||
| Text(provider.displayName).tag(provider) | ||
| } | ||
| } |
Comment on lines
1
to
+4
| import SwiftUI | ||
| import Foundation | ||
| import RxCodeCore | ||
| import WaterfallGrid |
Contributor
Author
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
No description provided.