Skip to content

Commit 64a0691

Browse files
committed
Release 0.37.0
1 parent fabc66e commit 64a0691

File tree

4 files changed

+87
-24
lines changed

4 files changed

+87
-24
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.37.0 - June 18, 2025
9+
### Added
10+
- **Advanced** settings: Added option to configure **Custom Instructions** for GitHub Copilot during chat sessions.
11+
- **Advanced** settings: Added option to keep the chat window automatically attached to Xcode.
12+
13+
### Changed
14+
- Enabled support for dragging-and-dropping files into the chat panel to provide context.
15+
16+
### Fixed
17+
- "Add Context" menu didn’t show files in workspaces organized with Xcode’s group feature.
18+
- Chat didn’t respond when the workspace was in a system folder (like Desktop, Downloads, or Documents) and access permission hadn’t been granted.
19+
820
## 0.36.0 - June 4, 2025
921
### Added
1022
- Introduced a new chat setting "**Response Language**" under **Advanced** settings to customize the natural language used in chat replies.

Core/Sources/SuggestionWidget/WidgetPositionStrategy.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,19 @@ enum UpdateLocationStrategy {
320320
return selectionFrame
321321
}
322322

323-
static func getChatPanelFrame(isAttachedToXcodeEnabled: Bool = false) -> CGRect {
323+
static func getChatPanelFrame(
324+
isAttachedToXcodeEnabled: Bool = false,
325+
xcodeApp: XcodeAppInstanceInspector? = nil
326+
) -> CGRect {
324327
let screen = NSScreen.main ?? NSScreen.screens.first!
325-
return getChatPanelFrame(screen, isAttachedToXcodeEnabled: isAttachedToXcodeEnabled)
328+
return getChatPanelFrame(screen, isAttachedToXcodeEnabled: isAttachedToXcodeEnabled, xcodeApp: xcodeApp)
326329
}
327330

328-
static func getChatPanelFrame(_ screen: NSScreen, isAttachedToXcodeEnabled: Bool = false) -> CGRect {
331+
static func getChatPanelFrame(
332+
_ screen: NSScreen,
333+
isAttachedToXcodeEnabled: Bool = false,
334+
xcodeApp: XcodeAppInstanceInspector? = nil
335+
) -> CGRect {
329336
let visibleScreenFrame = screen.visibleFrame
330337

331338
// Default Frame
@@ -335,7 +342,7 @@ enum UpdateLocationStrategy {
335342
var y = visibleScreenFrame.minY
336343

337344
if isAttachedToXcodeEnabled,
338-
let latestActiveXcode = XcodeInspector.shared.latestActiveXcode,
345+
let latestActiveXcode = xcodeApp ?? XcodeInspector.shared.latestActiveXcode,
339346
let xcodeWindow = latestActiveXcode.appElement.focusedWindow,
340347
let xcodeScreen = latestActiveXcode.appScreen,
341348
let xcodeRect = xcodeWindow.rect,

Core/Sources/SuggestionWidget/WidgetWindowsController.swift

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ actor WidgetWindowsController: NSObject {
1717
nonisolated let chatTabPool: ChatTabPool
1818

1919
var currentApplicationProcessIdentifier: pid_t?
20+
21+
weak var currentXcodeApp: XcodeAppInstanceInspector?
22+
weak var previousXcodeApp: XcodeAppInstanceInspector?
2023

2124
var cancellable: Set<AnyCancellable> = []
2225
var observeToAppTask: Task<Void, Error>?
@@ -84,6 +87,12 @@ private extension WidgetWindowsController {
8487
if app.isXcode {
8588
updateWindowLocation(animated: false, immediately: true)
8689
updateWindowOpacity(immediately: false)
90+
91+
if let xcodeApp = app as? XcodeAppInstanceInspector {
92+
previousXcodeApp = currentXcodeApp ?? xcodeApp
93+
currentXcodeApp = xcodeApp
94+
}
95+
8796
} else {
8897
updateWindowOpacity(immediately: true)
8998
updateWindowLocation(animated: false, immediately: false)
@@ -149,7 +158,7 @@ private extension WidgetWindowsController {
149158
.windowMoved,
150159
.windowResized:
151160
await updateWidgets(immediately: false)
152-
await updateChatWindowLocation()
161+
await updateAttachedChatWindowLocation(notification)
153162
case .created, .uiElementDestroyed, .xcodeCompletionPanelChanged,
154163
.applicationDeactivated:
155164
continue
@@ -446,14 +455,55 @@ extension WidgetWindowsController {
446455
}
447456

448457
@MainActor
449-
func updateChatWindowLocation() {
450-
let state = store.withState { $0 }
458+
func updateAttachedChatWindowLocation(_ notif: XcodeAppInstanceInspector.AXNotification? = nil) async {
459+
guard let currentXcodeApp = (await currentXcodeApp),
460+
let currentFocusedWindow = currentXcodeApp.appElement.focusedWindow,
461+
let currentXcodeScreen = currentXcodeApp.appScreen,
462+
let currentXcodeRect = currentFocusedWindow.rect
463+
else { return }
464+
465+
if let previousXcodeApp = (await previousXcodeApp),
466+
currentXcodeApp.processIdentifier == previousXcodeApp.processIdentifier {
467+
if currentFocusedWindow.isFullScreen == true {
468+
return
469+
}
470+
}
471+
451472
let isAttachedToXcodeEnabled = UserDefaults.shared.value(for: \.autoAttachChatToXcode)
452-
if isAttachedToXcodeEnabled {
453-
if state.chatPanelState.isPanelDisplayed && !windows.chatPanelWindow.isWindowHidden {
454-
let frame = UpdateLocationStrategy.getChatPanelFrame(isAttachedToXcodeEnabled: isAttachedToXcodeEnabled)
455-
windows.chatPanelWindow.setFrame(frame, display: true, animate: true)
473+
guard isAttachedToXcodeEnabled else { return }
474+
475+
if let notif = notif {
476+
let dialogIdentifiers = ["open_quickly", "alert"]
477+
if dialogIdentifiers.contains(notif.element.identifier) { return }
478+
}
479+
480+
let state = store.withState { $0 }
481+
if state.chatPanelState.isPanelDisplayed && !windows.chatPanelWindow.isWindowHidden {
482+
var frame = UpdateLocationStrategy.getChatPanelFrame(
483+
isAttachedToXcodeEnabled: true,
484+
xcodeApp: currentXcodeApp
485+
)
486+
487+
let screenMaxX = currentXcodeScreen.visibleFrame.maxX
488+
if screenMaxX - currentXcodeRect.maxX < Style.minChatPanelWidth
489+
{
490+
if let previousXcodeRect = (await previousXcodeApp?.appElement.focusedWindow?.rect),
491+
screenMaxX - previousXcodeRect.maxX < Style.minChatPanelWidth
492+
{
493+
let isSameScreen = currentXcodeScreen.visibleFrame.intersects(windows.chatPanelWindow.frame)
494+
// Only update y and height
495+
frame = .init(
496+
x: isSameScreen ? windows.chatPanelWindow.frame.minX : frame.minX,
497+
y: frame.minY,
498+
width: isSameScreen ? windows.chatPanelWindow.frame.width : frame.width,
499+
height: frame.height
500+
)
501+
}
456502
}
503+
504+
windows.chatPanelWindow.setFrame(frame, display: true, animate: true)
505+
506+
await adjustChatPanelWindowLevel()
457507
}
458508
}
459509

@@ -496,7 +546,7 @@ extension WidgetWindowsController {
496546

497547
let isAttachedToXcodeEnabled = UserDefaults.shared.value(for: \.autoAttachChatToXcode)
498548
if isAttachedToXcodeEnabled {
499-
// update in `updateChatWindowLocation`
549+
// update in `updateAttachedChatWindowLocation`
500550
} else if isChatPanelDetached {
501551
// don't update it!
502552
} else {

ReleaseNotes.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
### GitHub Copilot for Xcode 0.36.0
1+
### GitHub Copilot for Xcode 0.37.0
22

33
**🚀 Highlights**
44

5-
* Introduced a new chat setting "**Response Language**" under **Advanced** settings to customize the natural language used in chat replies.
6-
* Enabled support for custom instructions defined in _.github/copilot-instructions.md_ within your workspace.
7-
* Added support for premium request handling.
8-
9-
**💪 Improvements**
10-
11-
* Performance: Improved UI responsiveness by lazily restoring chat history.
12-
* Performance: Fixed lagging issue when pasting large text into the chat input.
13-
* Performance: Improved project indexing performance.
5+
* **Advanced** settings: Added option to configure **Custom Instructions** for GitHub Copilot during chat sessions.
6+
* **Advanced** settings: Added option to keep the chat window automatically attached to Xcode.
7+
* Added support for dragging-and-dropping files into the chat panel to provide context.
148

159
**🛠️ Bug Fixes**
1610

17-
* Don't trigger / (slash) commands when pasting a file path into the chat input.
18-
* Adjusted terminal text styling to align with Xcode’s theme.
11+
* "Add Context" menu didn’t show files in workspaces organized with Xcode’s group feature.
12+
* Chat didn’t respond when the workspace was in a system folder (like Desktop, Downloads, or Documents) and access permission hadn’t been granted.

0 commit comments

Comments
 (0)