Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qjclaw-dmg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AI-甘富林
qjclaw-dmg
Commits
d21ff2dd
Commit
d21ff2dd
authored
May 09, 2026
by
edy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(desktop): support home image fallback and dev dock icon
parent
43eb29a5
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
319 additions
and
13 deletions
+319
-13
index.ts
apps/desktop/src/main/index.ts
+42
-6
ipc.ts
apps/desktop/src/main/ipc.ts
+277
-6
project-bundle.ts
apps/desktop/src/main/services/project-bundle.ts
+0
-1
No files found.
apps/desktop/src/main/index.ts
View file @
d21ff2dd
import
path
from
"node:path"
;
import
{
access
,
appendFile
,
readFile
,
writeFile
}
from
"node:fs/promises"
;
import
{
BrowserWindow
,
app
}
from
"electron"
;
import
{
BrowserWindow
,
app
,
nativeImage
}
from
"electron"
;
import
{
GatewayClient
}
from
"@qjclaw/gateway-client"
;
import
{
RuntimeManager
}
from
"@qjclaw/runtime-manager"
;
import
type
{
AppConfig
,
RuntimeCloudFetchAction
,
RuntimeModePreference
,
SaveConfigInput
,
SystemSummary
}
from
"@qjclaw/shared-types"
;
...
...
@@ -212,6 +212,45 @@ async function countFilePatternMatches(filePath: string, pattern: string): Promi
}
}
async
function
firstExistingPath
(
paths
:
string
[]):
Promise
<
string
|
undefined
>
{
for
(
const
candidate
of
paths
)
{
try
{
await
access
(
candidate
);
return
candidate
;
}
catch
{
// Try the next candidate.
}
}
return
undefined
;
}
async
function
resolveDevelopmentApplicationIconPath
(
systemSummary
:
SystemSummary
):
Promise
<
string
|
undefined
>
{
if
(
systemSummary
.
isPackaged
)
{
return
undefined
;
}
const
projectDir
=
path
.
resolve
(
systemSummary
.
appPath
);
return
firstExistingPath
([
path
.
join
(
projectDir
,
"build"
,
"icon.png"
),
path
.
join
(
projectDir
,
"build"
,
"icons"
,
"brand-icon.png"
)
]);
}
async
function
configureDevelopmentDockIcon
(
systemSummary
:
SystemSummary
):
Promise
<
string
|
undefined
>
{
const
iconPath
=
await
resolveDevelopmentApplicationIconPath
(
systemSummary
);
if
(
!
iconPath
||
process
.
platform
!==
"darwin"
||
systemSummary
.
isPackaged
||
!
app
.
dock
)
{
return
iconPath
;
}
const
icon
=
nativeImage
.
createFromPath
(
iconPath
);
if
(
!
icon
.
isEmpty
())
{
app
.
dock
.
setIcon
(
icon
);
}
return
iconPath
;
}
function
snapshotMainWindowState
(
window
:
BrowserWindow
|
null
):
Record
<
string
,
unknown
>
{
if
(
!
window
||
window
.
isDestroyed
())
{
return
{
...
...
@@ -2097,6 +2136,8 @@ async function bootstrap(): Promise<void> {
startupLogger = new StartupLogger(systemSummary.logsPath);
startupLoggerRef = startupLogger;
await traceBootstrap("when-ready", { isPackaged: systemSummary.isPackaged, userDataPath: systemSummary.userDataPath, logsPath: systemSummary.logsPath, smokeEnabled, smokeCloudBootstrapEnabled });
const developmentIconPath = await configureDevelopmentDockIcon(systemSummary);
await traceBootstrap("development-icon-configured", { developmentIconPath });
const configService = new AppConfigService(systemSummary.userDataPath);
const config = await configService.load();
...
...
@@ -2469,8 +2510,3 @@ if (!hasSingleInstanceLock) {
apps/desktop/src/main/ipc.ts
View file @
d21ff2dd
This diff is collapsed.
Click to expand it.
apps/desktop/src/main/services/project-bundle.ts
View file @
d21ff2dd
...
...
@@ -1368,4 +1368,3 @@ export class ProjectBundleService {
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment