Skip to content

Commit 9355eb8

Browse files
authored
Merge pull request #353 from wakatime/main
Release v5.28.2
2 parents ba9e860 + b0f6e1d commit 9355eb8

File tree

5 files changed

+35
-7
lines changed

5 files changed

+35
-7
lines changed

.github/workflows/on_push.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
test:
1212
name: Tests and Build
13-
runs-on: macos-13
13+
runs-on: macos-15
1414
steps:
1515
-
1616
name: Checkout
@@ -75,7 +75,7 @@ jobs:
7575
sign:
7676
name: Sign Apple app
7777
needs: [version]
78-
runs-on: macos-13
78+
runs-on: macos-15
7979
steps:
8080
-
8181
name: Checkout
@@ -210,7 +210,7 @@ jobs:
210210
211211
release:
212212
name: Release
213-
runs-on: macos-13
213+
runs-on: macos-15
214214
needs: [version, sign, changelog]
215215
steps:
216216
-

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Build with `Xcode` before creating any pull requests, or your PR won’t pass th
2828

2929
To fix linter warning(s), run `swiftlint --fix`.
3030

31-
## Branching Stratgegy
31+
## Branching Strategy
3232

3333
We require specific branch name prefixes for PRs:
3434

WakaTime/AppDelegate.swift

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,27 @@ class AppDelegate: NSObject, NSApplicationDelegate, StatusBarDelegate, UNUserNot
107107
}
108108

109109
@objc func dashboardClicked(_ sender: AnyObject) {
110-
if let url = URL(string: "https://wakatime.com/") {
110+
let defaultUrl = "https://wakatime.com/"
111+
112+
var url = ConfigFile.getSetting(section: "settings", key: "api_url") ?? defaultUrl
113+
if url.isEmpty {
114+
url = defaultUrl
115+
}
116+
117+
url = url
118+
.replacingOccurrences(of: "://api.", with: "://")
119+
.replacingOccurrences(of: "/api/v1", with: "")
120+
.replacingOccurrences(of: "^api\\.", with: "", options: .regularExpression)
121+
.replacingOccurrences(of: "/api", with: "")
122+
123+
if let url = URL(string: url) {
111124
NSWorkspace.shared.open(url)
125+
} else {
126+
if url != defaultUrl {
127+
if let url = URL(string: defaultUrl) {
128+
NSWorkspace.shared.open(url)
129+
}
130+
}
112131
}
113132
}
114133

WakaTime/Helpers/MonitoringManager.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ class MonitoringManager {
213213
return extractPrefix(element.rawTitle, separator: " - ")
214214
case .imessage:
215215
return extractPrefix(element.rawTitle, separator: " - ")
216+
case .inkscape:
217+
return extractPrefix(element.rawTitle)
216218
case .iterm2:
217219
return extractPrefix(element.rawTitle, separator: " - ")
218220
case .linear:
@@ -261,8 +263,10 @@ class MonitoringManager {
261263
}
262264

263265
static func category(for app: NSRunningApplication, _ element: AXUIElement) -> Category {
264-
guard let monitoredApp = app.monitoredApp else {
265-
guard let url = currentBrowserUrl(for: app, element) else { return .coding }
266+
guard let monitoredApp = app.monitoredApp else { return .coding }
267+
268+
if isAppBrowser(app) {
269+
guard let url = currentBrowserUrl(for: app, element) else { return .browsing }
266270
return category(from: url)
267271
}
268272

@@ -297,6 +301,8 @@ class MonitoringManager {
297301
return .codereviewing
298302
case .imessage:
299303
return .communicating
304+
case .inkscape:
305+
return .designing
300306
case .iterm2:
301307
return .coding
302308
case .linear:
@@ -453,6 +459,8 @@ class MonitoringManager {
453459
}
454460
case .figma:
455461
return "Image (svg)"
462+
case .inkscape:
463+
return "Image (svg)"
456464
case .postman:
457465
return "HTTP Request"
458466
default:

WakaTime/Watchers/MonitoredApp.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ enum MonitoredApp: String, CaseIterable {
1818
case firefox = "org.mozilla.firefox"
1919
case github = "com.github.GitHubClient"
2020
case imessage = "com.apple.MobileSMS"
21+
case inkscape = "org.inkscape.Inkscape"
2122
case iterm2 = "com.googlecode.iterm2"
2223
case linear = "com.linear"
2324
case miro = "com.electron.realtimeboard"

0 commit comments

Comments
 (0)