perf(cua): omit unused icons from application selection

This commit is contained in:
creatixchu committed 2026-10-19 12:50:07 +08:00
1 parent a2484cb02d
commit eaea1ec5b9
5 files changed
+6 -11

No files matched your search

@@ -12,8 +12,8 @@
en: 4549f02fc53854a5
zh: 6f74f1130b6623a8
/deepseek-ai-dsh-experimental-cua-macos/table-of-contents:
en: 867d9ec544719acf
zh: 92348599582dc33a
en: 9353d17b05f2f88c
zh: 6b2c6b4ee0046294
/deepseek-ai-dsh-experimental-cua-macos/use-this-package:
en: 5f070508770a1a48
zh: 07d6e582c01b0ea3
+1 -1
View File
@@ -20,7 +20,7 @@ Inspect macOS permissions, select running applications and windows, read accessi
- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
- [Dev Note](#dev-note)
The helper supplies bounded 64-pixel PNG application icons for permission prompts and saved-application lists. Icon reads do not launch an application or inspect its windows; executable and signing checks still determine authorization.
The helper supplies bounded 64-pixel PNG application icons for permission-page application lists. Icon reads do not launch an application or inspect its windows; executable and signing checks still determine authorization.
The shared helper queries the process macOS considers responsible for it and captures that application’s name and icon before announcing readiness. A Desktop app launched from Terminal can therefore identify Terminal even when another GUI application sits between it and the helper. Permission queries retain this metadata after the responsible application exits and across connections sharing the helper. If the system query or application metadata is unavailable, the field is omitted and the UI uses the system prompt for guidance.
+1 -1
View File
@@ -20,7 +20,7 @@ kind: "package-reference"
- [已知限制与后续工作](#known-limitations-and-deferred-work)
- [开发备注](#dev-note)
helper 为授权提示和已授权应用列表提供 64 像素 PNG 图标。读取图标不会启动应用或检查窗口,授权仍由可执行文件和签名校验决定。
helper 为权限页的应用列表提供 64 像素 PNG 图标。读取图标不会启动应用或检查窗口,授权仍由可执行文件和签名校验决定。
共享 helper 查询 macOS 为它记录的责任进程,在发布就绪状态前保存对应应用的名称和图标。因此,从 Terminal 启动 Desktop 时,即使中间还有另一个 GUI 应用,也能识别到 Terminal。责任应用退出后,权限查询仍保留这些信息,后续复用该 helper 的连接读取同一份记录。系统查询或应用信息不可用时省略该字段,由界面引导用户按系统弹窗选择授权对象。
@@ -195,12 +195,7 @@ import Darwin
let outcome = try await worker.execute(request.method, params: params, catalog: catalog, installed: installed, trace: trace)
trace?.mark("worker.end")
switch outcome {
case .result(let value):
if request.method == "getApp", var fields = value.object {
let path = installed?.path ?? catalog.applications.first { Double($0.pid) == value["pid"].number }?.path
if let path, let icon = ApplicationCatalog.icon(at: path) { fields["applicationIcon"] = .string(icon) }
result = .object(fields)
} else { result = value }
case .result(let value): result = value
case .capture(let target):
let image = try await capture.capture(target, cancellation: cancellation, trace: trace)
result = try await worker.finishCapture(target, image: image, trace: trace)
@@ -142,7 +142,7 @@ function createApplicationState(socket, record, application, captureBroker, conn
}
if (!['Fixture', 'test.fixture', '9'].includes(params.selector)) refuse('APP_NOT_FOUND', 'Select the running Fixture application')
acquired = true
return { ...app, applicationIcon: `data:image/png;base64,${png}`, authorization: {"id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "name": "Fixture", "executablePath": "/fixture/app", "persistable": true} }
return { ...app, authorization: {"id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "name": "Fixture", "executablePath": "/fixture/app", "persistable": true} }
}
if (!acquired || params.appHandle !== app.appHandle) refuse('APP_NOT_FOUND', 'Acquire an application in this helper first')
if (method === 'show') return { dispatched: true, verified: false, windowId: params.windowId ?? window.windowId, foregroundChanged: false }