Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## 0.3.0 — 2026-11-18

### Sessions

- **Island at the notch.** Sessions that work or wait for you show around the camera housing: working sessions on the left, sessions waiting for you (or finished answers) on the right. Hover to open the list with the week and five-hour limits and a timer per session; click a session to open it. On a screen without a notch the island appears only while there is work. Settings → Menu bar → Session status → **Island at the screen notch** turns it off.
- **Answer permission requests from the island.** When a Claude Code session asks for permission, the island opens for a moment with the command and **Allow**, **Always** and **Deny**; the card then confirms what your click did. The request waits up to a minute. Without an answer, or when you click the session itself, Claude Code asks in its own dialog. To wait, Lunavect gives its permission hook 60 seconds instead of 3 in Claude Code's settings; sessions opened before that change keep asking in their own dialog until they restart.
- **Answer the agent's questions from the island.** When Claude Code asks you a question with options, the island shows it with the options as buttons, one question at a time; where several may be picked, tick them and click **Done**. Claude Code gets your choice as if you had answered in its own dialog, which stays open meanwhile. To type your own answer, click **In session**. A question the island cannot show, or one left unanswered for a minute, stays in Claude Code's dialog.
- A Claude Code session started in the terminal built into Claude (or Codex) counts as a terminal session. It used to count as a Claude Desktop task: after its tab closed it stayed **Permission needed** or **Thinking** for up to ten minutes, and a click reported that Claude had not provided a link. Now it leaves the list with its tab, and a click brings that app's window forward.
- A session whose turn ended with background or workflow agents still running stays **In background** while those agents call tools. A pause for Claude Code monitors alone ends within 31 minutes: Claude Code stops a monitor at its deadline (30 minutes at most), and such a session used to stay **In background** for up to an hour. Each of their tool calls used to turn the row back into **Thinking**, so a long-finished turn showed a growing timer.
- **Wakes at.** When a Claude session waits only for a timer it started in the background (`sleep 300`, or `sleep 300` followed by a check), the island and the panel show when it wakes, **Wakes at 15:42**, instead of **In background**. The pause now lasts until then and five minutes more: a short wait no longer keeps a session that never woke **In background** for an hour, and a wait longer than an hour no longer drops the session from the list. Any other work in flight may wake Claude sooner, so the row says **In background** as before.

### Limits

- Claude limits update again with Claude Code 2.1.327. That version shows `/usage` as a tab of its settings panel that ends with "Esc to close"; Lunavect waited for the earlier "Esc to cancel", so the limits stopped at the last value read and Settings said that the client did not respond in time.

### Widgets

- The medium limits widget with one provider has its own layout: the week as a large figure with its bar, and the five-hour window, model limit and plan end as tiles with small meters under it. Before, it stretched the small widget's rows across the width, with faint text on desktop glass and a bare calendar icon for the plan.
- The small one-provider widget draws its secondary lines in the widget's own ink, which stays readable on glass.
- Settings → Widgets no longer lists Xcode archives, exports and build folders, or the `__MACOSX` leftovers of an unpacked ZIP, as "another copy of Lunavect". After a macOS upgrade the system registers all of them again; they are not installed copies, and Lunavect keeps confirming its own widget registration.

### Statistics

- **When you work** labels the weekdays in the order they are counted. With the app in English on a Mac whose region starts the week on Monday, the labels started a day early, so Monday's hours read "Sun".
- With one provider connected, the chart card counts **Days with work** (for example 4 / 7) instead of "Days with records". The old count included days Lunavect only watched and left out a day off with no session open, so an ordinary day without work read as a lost day.

## 0.2.8 — 2026-09-30

### Limits for running sessions
Expand Down
18 changes: 14 additions & 4 deletions Lunavect.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
24E8812F2CAA22D78CDC4BDE /* SessionControls.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2DC823A41EEFC0265F4D7DE /* SessionControls.swift */; };
26A372025F10E010911E5D3E /* SessionHooks.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE4CC4099BDA102E5832C389 /* SessionHooks.swift */; };
28A1D895A8D2118FC39A1DCB /* WidgetRegistration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D0F30F7ED6A14689FEFEC43 /* WidgetRegistration.swift */; };
2976C59C0DA3999D038D1FFA /* PermissionBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71B711F1567F01842E5EC81 /* PermissionBridge.swift */; };
2CF1CB795986898BC446C4FE /* Providers.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF2D1B56138FBA499694CA18 /* Providers.swift */; };
2DD177E0604CF04A0CF49A6F /* ActivityHistoryImporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C70FEFEF51BBA2434DAB68B /* ActivityHistoryImporter.swift */; };
2F118106D096AABB0FCC5A6D /* ClaudeUsageProbe.swift in Sources */ = {isa = PBXBuildFile; fileRef = A021989DCABAC6C5DA1D7DBA /* ClaudeUsageProbe.swift */; };
Expand All @@ -48,6 +49,7 @@
41921077DE2B9A8FE70A1B63 /* WidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AEBE743BD96448FC267743F /* WidgetView.swift */; };
42A477FCE0298DFDC2F49803 /* TokenLedger.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3C6BB3418216A825608B012 /* TokenLedger.swift */; };
47E4BCD5B66B7CF98E7A2B03 /* SystemSleepSetting.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8C05325F14D50D9315D1122 /* SystemSleepSetting.swift */; };
4956E9B92E80136265807313 /* PermissionBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71B711F1567F01842E5EC81 /* PermissionBridge.swift */; };
4DFA165D0208B8136C78A081 /* CodexAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2F73CE91878580448FE361E /* CodexAnimation.swift */; };
503121D1FEAEF29EC3402513 /* TokenLedger.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3C6BB3418216A825608B012 /* TokenLedger.swift */; };
509C437D25DE9D059FA547EC /* SessionDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EDF1B51088BF74AB06D347B /* SessionDestination.swift */; };
Expand All @@ -68,6 +70,7 @@
5E37DE0B55C3A1D6D3724602 /* Sessions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F36C69FDA21D980CF78E95A /* Sessions.swift */; };
5E58321E4E045F3D9A977006 /* SubscriptionDatePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0DBDBF6B699906DDE77585B /* SubscriptionDatePicker.swift */; };
5F4965034E44FD36CCC504AC /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = B00DE3C3478A69C3E7F7DF1C /* Models.swift */; };
60072E47C69D4980E3114690 /* NotchIsland.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B25833EE70D59253473D1C4 /* NotchIsland.swift */; };
6184F66F91D8F4A65E8A1093 /* ActivityStatisticsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E36F2B5C53BA780AD42975FB /* ActivityStatisticsView.swift */; };
6323F319A0C94A1DBE9375DE /* SessionDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EDF1B51088BF74AB06D347B /* SessionDestination.swift */; };
65AA4A6F6C5C57D25F265900 /* Localization.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA6B2023A56E83F9F127F00A /* Localization.swift */; };
Expand Down Expand Up @@ -244,6 +247,7 @@
739640887B16506C6A5B8688 /* AppFeatures.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppFeatures.swift; sourceTree = "<group>"; };
780039D8CA11672F3EB534B7 /* clawd-waving.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "clawd-waving.gif"; sourceTree = "<group>"; };
788A00B2932286D4969B2DAF /* LocalFileCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalFileCache.swift; sourceTree = "<group>"; };
7B25833EE70D59253473D1C4 /* NotchIsland.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotchIsland.swift; sourceTree = "<group>"; };
83BAADC66DA4CEA79BD50CFE /* HiddenSessionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HiddenSessionsView.swift; sourceTree = "<group>"; };
83E87BA66A5F22FB4A99240D /* WeekleftWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeekleftWidget.swift; sourceTree = "<group>"; };
8575633272066B60FA5691B1 /* SubscriptionCalendar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionCalendar.swift; sourceTree = "<group>"; };
Expand All @@ -263,6 +267,7 @@
9F743D8112622A1BF43DDD4F /* codex-companion.webp */ = {isa = PBXFileReference; path = "codex-companion.webp"; sourceTree = "<group>"; };
A021989DCABAC6C5DA1D7DBA /* ClaudeUsageProbe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClaudeUsageProbe.swift; sourceTree = "<group>"; };
A2F73CE91878580448FE361E /* CodexAnimation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodexAnimation.swift; sourceTree = "<group>"; };
A71B711F1567F01842E5EC81 /* PermissionBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PermissionBridge.swift; sourceTree = "<group>"; };
ADDD774C71802AD7B92B4B7D /* LunavectMark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = LunavectMark.png; sourceTree = "<group>"; };
B00DE3C3478A69C3E7F7DF1C /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = "<group>"; };
B061050135D7E2DA0DA7E9A3 /* SessionInteractions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionInteractions.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -450,6 +455,7 @@
0219A08FBDA0BC2CE1AA753D /* MenuBarAppearance.swift */,
ECAC781EC4BD9E685A603326 /* MenuBarLimits.swift */,
0359C5E77621B5ABEB05B9ED /* MenuBarScenes.swift */,
7B25833EE70D59253473D1C4 /* NotchIsland.swift */,
857A17CC8EF387BE4949E7A3 /* SessionControlService.swift */,
19AA01C46FAF93C7DBD5944B /* SessionControlViews.swift */,
B061050135D7E2DA0DA7E9A3 /* SessionInteractions.swift */,
Expand Down Expand Up @@ -500,6 +506,7 @@
788A00B2932286D4969B2DAF /* LocalFileCache.swift */,
CA6B2023A56E83F9F127F00A /* Localization.swift */,
B00DE3C3478A69C3E7F7DF1C /* Models.swift */,
A71B711F1567F01842E5EC81 /* PermissionBridge.swift */,
CF2D1B56138FBA499694CA18 /* Providers.swift */,
F87FC6C4BFE71F1B9F0CC485 /* ReleaseConfiguration.swift */,
DD935DC8B8F653A6CFB0E46B /* SessionArrangement.swift */,
Expand Down Expand Up @@ -809,6 +816,7 @@
7411719BDEDF562C0E8CAF37 /* LocalFileCache.swift in Sources */,
65AA4A6F6C5C57D25F265900 /* Localization.swift in Sources */,
362AC6E279A42BEB9AF7B9B4 /* Models.swift in Sources */,
2976C59C0DA3999D038D1FFA /* PermissionBridge.swift in Sources */,
C36949D553184EBC3727DB85 /* Providers.swift in Sources */,
B9BA2A0C1715B50894F2E2B7 /* ReleaseConfiguration.swift in Sources */,
6EE60DB965DBF2EC152CF13C /* SessionArrangement.swift in Sources */,
Expand Down Expand Up @@ -887,6 +895,8 @@
559F689E384DD80303DB5031 /* MenuBarLimits.swift in Sources */,
5B9C99F54EE0C2AA3E637D65 /* MenuBarScenes.swift in Sources */,
EA166D92853F3D1040A15B16 /* Models.swift in Sources */,
60072E47C69D4980E3114690 /* NotchIsland.swift in Sources */,
4956E9B92E80136265807313 /* PermissionBridge.swift in Sources */,
2CF1CB795986898BC446C4FE /* Providers.swift in Sources */,
7BD77CECC31DCD7C3A8A9968 /* ReleaseConfiguration.swift in Sources */,
FC2052471D5D9C9DFCF07900 /* SessionArrangement.swift in Sources */,
Expand Down Expand Up @@ -1055,7 +1065,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 219;
CURRENT_PROJECT_VERSION = 235;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_NS_ASSERTIONS = NO;
Expand All @@ -1070,7 +1080,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
GENERATE_INFOPLIST_FILE = NO;
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 0.2.8;
MARKETING_VERSION = 0.3.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1160,7 +1170,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 219;
CURRENT_PROJECT_VERSION = 235;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand All @@ -1181,7 +1191,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
GENERATE_INFOPLIST_FILE = NO;
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 0.2.8;
MARKETING_VERSION = 0.3.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down
15 changes: 11 additions & 4 deletions Sources/Weekleft/ActivityStatisticsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ struct ActivityDetailChart: View {
HStack(alignment: .top, spacing: 24) {
metric(L("Пиковый час"), data.summary.peakLabel)
if data.series.count > 1 { metric(L("Вместе, без пересечений"), ActivityChartText.value(data.summary.totals)) }
else { metric(L("Дней с записями"), "\(data.summary.days.filter { $0.totals.observed > 0 }.count) / \(data.summary.days.count)") }
else { metric(L("Дней с работой"), ActivityChartText.workedDays(data.summary)) }
}
if data.stale || data.limited {
Label(L(data.stale ? "Данные устарели" : "По доступным записям"), systemImage: data.stale ? "clock.badge.exclamationmark" : "info.circle")
Expand Down Expand Up @@ -837,16 +837,23 @@ struct ActivityDayClockCard: View {
(L("Ночью"), 0, "moon.stars.fill"), (L("Утром"), 6, "sunrise.fill"), (L("Днём"), 12, "sun.max.fill"), (L("Вечером"), 18, "sunset.fill")]
private static let ring: CGFloat = 18, labelGap: CGFloat = 12

/// Weekday names in the order the summary counts them: from the system calendar's first day,
/// in the app's language. The language's own first day differs (English with a Monday region
/// started the labels a day early, so Monday's hours read "Sun").
static func weekdayNames(firstWeekday: Int, locale: Locale) -> [String] {
var calendar = Calendar.current; calendar.locale = locale
let symbols = calendar.shortWeekdaySymbols
return (0..<7).map { symbols[(firstWeekday - 1 + $0) % 7] }
}

var body: some View {
let hours = (0..<24).map { hour in weekdayHours.reduce(0) { $0 + ($1.indices.contains(hour) ? $1[hour] : 0) } }
let total = hours.reduce(0, +)
let values = Self.parts.map { part in hours[part.start..<(part.start + 6)].reduce(0, +) }
let top = values.indices.max { values[$0] < values[$1] } ?? 0
let days = weekdayHours.map { $0.reduce(0, +) }
let busiestDay = days.indices.max { days[$0] < days[$1] } ?? 0
var calendar = Calendar.current; calendar.locale = L10n.locale
let symbols = calendar.shortWeekdaySymbols
let names = (0..<7).map { symbols[(calendar.firstWeekday - 1 + $0) % 7] }
let names = Self.weekdayNames(firstWeekday: Calendar.current.firstWeekday, locale: L10n.locale)
let trailing: String? = total <= 0 ? nil : hoveredHour.map { String(format: "%02d:00–%02d:00", $0, $0 + 1) + " · " + Self.hours(hours[$0]) }
?? L("Чаще всего: {0}, {1}", Self.parts[top].title.lowercased(with: L10n.locale), names.indices.contains(busiestDay) ? names[busiestDay] : "")
return StatisticsCard(title: L("Когда вы работаете"), trailing: trailing) {
Expand Down
8 changes: 6 additions & 2 deletions Sources/Weekleft/IDEConnectionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ struct IDEConnectionsView: View {

static func resources() -> URL? {
#if SWIFT_PACKAGE
// `.copy("Resources")` keeps the folder; resourceURL already points inside it.
return Bundle.module.bundleURL.appendingPathComponent("Resources/IDEConnectors")
// `.copy("Resources")` keeps the folder: at the root of a flat bundle (native
// SwiftPM builds) or inside Contents/Resources (the Xcode build system).
let bundle = Bundle.module
return [bundle.bundleURL.appendingPathComponent("Resources/IDEConnectors"),
bundle.resourceURL?.appendingPathComponent("Resources/IDEConnectors")]
.compactMap { $0 }.first { FileManager.default.fileExists(atPath: $0.path) }
#else
return Bundle.main.resourceURL?.appendingPathComponent("IDEConnectors")
#endif
Expand Down
27 changes: 17 additions & 10 deletions Sources/Weekleft/Main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ enum StatusItemClick {
init(environment: AppEnvironment) { self.environment = environment; super.init() }
var menuBarAnimator: MenuBarAnimator?
var menuBarLimits: MenuBarLimitsController?
var notchIsland: NotchIslandController?
var window: NSWindow?
var welcomeWindow: NSWindow?
var monitorWindow: NSWindow?
Expand Down Expand Up @@ -192,17 +193,12 @@ enum StatusItemClick {
}
features.onControlAction = { [weak self] action, id in self?.controls.handle(action: action, controlID: id) }
features.limitCutOff = { [weak self] session in self?.controls.limitCutOff(session) ?? (false, nil) }
features.onOpenSession = { [weak self] id in
Task { @MainActor in
guard let self else { return }
// A known row opens at once; a failure is reported on the panel.
await self.sessionPanelState.openSession(id: id, rows: self.sessions.sessions,
refresh: { await self.sessions.refresh() }) { row in
try await SessionNavigation.open(row, resolver: self.store.clientResolver)
}
}
}
features.onOpenSession = { [weak self] id in self?.openSession(id: id) }
features.start()
let island = NotchIslandController(onOpen: { [weak self] id in self?.openSession(id: id) },
onOpenPanel: { [weak self] in self?.showSessions() })
island.start(sessions: sessions, store: store, appearance: menuBarAppearance)
notchIsland = island
let registration = WidgetRegistration(defaults: environment.defaults, health: .live)
widgetRegistration = registration
registration.start()
Expand Down Expand Up @@ -248,6 +244,17 @@ enum StatusItemClick {
}
}
}
/// Notices and the island open a session the same way; a known row opens
/// at once and a failure is reported on the panel.
func openSession(id: String) {
Task { @MainActor [weak self] in
guard let self else { return }
await self.sessionPanelState.openSession(id: id, rows: self.sessions.sessions,
refresh: { await self.sessions.refresh() }) { row in
try await SessionNavigation.open(row, resolver: self.store.clientResolver)
}
}
}
func observeSessionStatus() {
// RunLoop.main schedules in default mode only. Event tracking must not
// strand an old waiting count after the store already reports work.
Expand Down
Loading
Loading