@@ -173,9 +173,9 @@ final class RealtimeSuggestionIndicatorController {
173173 @ObservedObject var viewModel : IndicatorContentViewModel
174174 @State var progress : CGFloat = 1
175175 var opacityA : CGFloat { progress }
176- var opacityB : CGFloat { ( 1 - progress) }
176+ var opacityB : CGFloat { 1 - progress }
177177 var scaleA : CGFloat { progress / 2 + 0.5 }
178- var scaleB : CGFloat { 1 - progress }
178+ var scaleB : CGFloat { max ( 1 - progress, 0.01 ) }
179179
180180 var body : some View {
181181 Circle ( )
@@ -315,6 +315,36 @@ final class RealtimeSuggestionIndicatorController {
315315 return
316316 }
317317
318+ if let activeXcode = NSRunningApplication
319+ . runningApplications ( withBundleIdentifier: " com.apple.dt.Xcode " )
320+ . first ( where: \. isActive)
321+ {
322+ let application = AXUIElementCreateApplication ( activeXcode. processIdentifier)
323+ if let focusElement: AXUIElement = try ? application
324+ . copyValue ( key: kAXFocusedUIElementAttribute) ,
325+ let selectedRange: AXValue = try ? focusElement
326+ . copyValue ( key: kAXSelectedTextRangeAttribute) ,
327+ let rect: AXValue = try ? focusElement. copyParameterizedValue (
328+ key: kAXBoundsForRangeParameterizedAttribute,
329+ parameters: selectedRange
330+ )
331+ {
332+ var frame : CGRect = . zero
333+ let found = AXValueGetValue ( rect, . cgRect, & frame)
334+ let screen = NSScreen . screens. first
335+ if found, let screen {
336+ frame. origin = . init(
337+ x: frame. maxX + 5 ,
338+ y: screen. frame. height - frame. minY - 12
339+ )
340+ frame. size = . init( width: 10 , height: 10 )
341+ window. setFrame ( frame, display: false )
342+ window. makeKey ( )
343+ return
344+ }
345+ }
346+ }
347+
318348 var frame = window. frame
319349 let location = NSEvent . mouseLocation
320350 frame. origin = . init( x: location. x + 15 , y: location. y + 15 )
0 commit comments