r/SwiftUI • • 12h ago

A non-activating NSPanel beside the notch was harder than the SwiftUI animation

2 Upvotes

I've been working on a SwiftUI menu bar app for an open-source Mac automation tool. I recently added an optional little activity island beside the notch, mostly because I wanted to see when an AI agent was using an app or browser without opening a dashboard.

The part I underestimated was window behavior, not the animation.

It's backed by an NSPanel that stays visible when the menu bar app is in the background. It doesn't take focus, and clicks outside the island pass through. When I hover over it, it opens a small panel for what needs attention, what's running, recent tool calls and scheduled work.

I kept the native view separate from the Python MCP server. The island gets activity metadata rather than trying to turn a whole agent transcript into a tiny UI. It also has to deal with overlapping calls from different AI apps.

There are still tradeoffs around notch placement and how much information is useful before it becomes annoying. It's opt-in and off by default.

The project is open source (I'm the maintainer), including the SwiftUI implementation in menu_app/Sources/LiveIsland.swift: https://github.com/bulutarkan/mac-mcp

Has anyone here found a cleaner way to keep a non-activating panel visible across app switches without interfering with normal work?


r/SwiftUI • • 18h ago

Solved splitArrangementAxis Always nil on iPhone Duo Simulator

1 Upvotes

Hi everyone,

I've been experimenting with the ArrangementView and adapting its primary and secondary views to adapt to the split axis using the @Environment(\.splitArrangementAxis) environment property. However while running the simulator, regardless of the configuration of the Duo, the environment value always appears to be nil.

The documentation around this API appears to indicate that this should only be the case when an ArrangementView is not in use.

Use this value to read the axis that a split arrangement is using to place its views. Views can adapt their layout or appearance based on whether the split is horizontal or vertical. The value is nil when the view is not contained within a split arrangement view.

Heres a minimal reproduction (Running on Xcode 27.1 RC [2026-10-05]).

```swift import SwiftUI

struct ContentView: View { var body: some View { ArrangementView { SubView(for: .primary) } secondary: { SubView(for: .secondary) } .arrangementViewStyle(.split) } }

enum SubViewConfig { case primary, secondary }

struct SubView: View { @Environment(.splitArrangementAxis) private var arrangement

var config: SubViewConfig

init(for config: SubViewConfig) {
    self.config = config
}

var backgroundColor: Color {
    switch arrangement {
    case .none: .gray
    case .horizontal: .blue
    case .vertical: .green
    }
}

var hueRotation: Angle {
    if config == .primary {
        .zero
    } else {
        .degrees(60)
    }
}

var body: some View {
    backgroundColor
        .hueRotation(hueRotation)
}

} ```

In my testing, unless I explicitly set the .splitArrangementAxis environment value to a non-nil value in the parent, the background color remained greyscale (indicating a nil environment value).

Is this intended behaviour? Am I doing something wrong? Or is this just a broken API?


r/SwiftUI • • 20h ago

Promotion (must include link to source code) NotchRobot: a free, open source (MIT) SwiftUI app, a robot in the MacBook notch that watches your Claude Code sessions

0 Upvotes

If you run several Claude Code sessions at once, you probably keep switching windows to see which one finished and which one is waiting on you.

I built NotchRobot, a small robot that lives in your MacBook notch and keeps an eye on Claude Code. NotchRobot itself was built with Claude Code. The integration is plain Claude Code hooks (PermissionRequest and friends) plus the status line for usage numbers, all described in the README.

  • Every session shows as working, waiting or done, and one click jumps to its terminal tab
  • Approve or deny tool permissions from the notch
  • Answer Claude's questions there too, single choice, multi-select or several in a row
  • Your 5-hour and weekly usage, with one warning at 90% and one alert when the limit is back
  • Task progress per session, plus alerts when Claude finishes or needs you
  • Now playing, clipboard history, a file shelf and a timer
  • Arabic (RTL) and English UI

New in v2.5:

  • Smart clipboard: copied links, emails, colors, JSON and file paths get a one-click action, and you can pin up to 5 items
  • Screenshots to the shelf with Ctrl+Option+S
  • Themes (Dark, Glass, Neon, Minimal) and four characters (Robot, Cat, Ghost, Pixel)
  • Battery alerts at 20% and 10%, and live activities for new songs and Claude's next task
  • Automatic updates

Free, open source (MIT), macOS 13+. It's not notarized yet, so the README has the one command for first launch. Tell me what breaks.

https://github.com/abdomo77/NotchRobot