Skip to content

Commit b949e54

Browse files
author
JooHyung Park
committed
[ai-assisted] Hide updater UI for MAS/MSIX and bump version to 2.0.13
1 parent a59ed2f commit b949e54

11 files changed

Lines changed: 139 additions & 66 deletions

File tree

package-lock.json

Lines changed: 2 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "talktofigma-desktop",
33
"productName": "TalkToFigma Desktop",
4-
"version": "2.0.12",
4+
"version": "2.0.13",
55
"description": "Bridge between Figma and AI tools (Cursor, Claude Code) using Model Context Protocol",
66
"type": "module",
77
"main": ".vite/build/main.cjs",
@@ -125,7 +125,6 @@
125125
"sonner": "^2.0.7",
126126
"tailwind-merge": "^3.4.0",
127127
"tw-animate-css": "^1.4.0",
128-
"update-electron-app": "^3.1.2",
129128
"uuid": "^13.0.0",
130129
"vaul": "^1.1.2",
131130
"winston": "^3.19.0",

src/main/ipc-handlers.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ import { ipcMain, BrowserWindow, shell, IpcMainInvokeEvent } from 'electron';
88
import { IPC_CHANNELS } from '../shared/constants';
99
import { createLogger } from './utils/logger';
1010
import * as storeUtils from './utils/store';
11-
import type { ServerState, FigmaAuthState } from '../shared/types';
11+
import type { ServerState, FigmaAuthState, UpdateCapabilities } from '../shared/types';
1212
import { registerMcpConfigHandlers } from './handlers/mcp-config-handler';
1313
import { trackTutorialAction, trackThemeChange, trackPageView, trackServerAction } from './analytics';
1414
import { checkForUpdates } from './utils/updater';
15+
import { getUpdateCapabilities } from './utils/distribution';
1516
import { TalkToFigmaService } from './server/TalkToFigmaService';
1617

1718
const logger = createLogger('IPC');
@@ -215,6 +216,10 @@ export function registerIpcHandlers(mainWindow: BrowserWindow): void {
215216
logger.info('IPC: update:check');
216217
checkForUpdates(true);
217218
});
219+
ipcMain.handle(IPC_CHANNELS.UPDATE_GET_CAPABILITIES, async (): Promise<UpdateCapabilities> => {
220+
logger.debug('IPC: update:get-capabilities');
221+
return getUpdateCapabilities();
222+
});
218223

219224
logger.info('IPC handlers registered successfully');
220225
}

src/main/menu.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import { app, Menu, MenuItemConstructorOptions, shell, BrowserWindow } from 'electron';
88
import { checkForUpdates } from './utils/updater';
9+
import { getUpdateCapabilities } from './utils/distribution';
910
import { TalkToFigmaServerManager } from './server/TalkToFigmaServerManager';
1011
import { TalkToFigmaService } from './server/TalkToFigmaService';
1112

@@ -15,6 +16,7 @@ import { TalkToFigmaService } from './server/TalkToFigmaService';
1516
*/
1617
export function createMenu(mainWindow: BrowserWindow) {
1718
const isMac = process.platform === 'darwin';
19+
const { canCheckForUpdates } = getUpdateCapabilities();
1820
const serverManager = TalkToFigmaServerManager.getInstance();
1921
const service = TalkToFigmaService.getInstance();
2022

@@ -48,13 +50,17 @@ export function createMenu(mainWindow: BrowserWindow) {
4850
submenu: [
4951
{ role: 'about' },
5052
{ type: 'separator' },
51-
{
52-
label: 'Check for Updates...',
53-
click: () => {
54-
checkForUpdates(true);
55-
}
56-
},
57-
{ type: 'separator' },
53+
...(canCheckForUpdates
54+
? [
55+
{
56+
label: 'Check for Updates...',
57+
click: () => {
58+
checkForUpdates(true);
59+
}
60+
} as MenuItemConstructorOptions,
61+
{ type: 'separator' as const },
62+
]
63+
: []),
5864
{ role: 'services' },
5965
{ type: 'separator' },
6066
{ role: 'hide' },
@@ -146,7 +152,7 @@ export function createMenu(mainWindow: BrowserWindow) {
146152
role: 'help',
147153
submenu: [
148154
// Windows/Linux: Add "Check for Updates" to Help menu
149-
...(!isMac
155+
...(!isMac && canCheckForUpdates
150156
? [
151157
{
152158
label: 'Check for Updates...',

src/main/server/TalkToFigmaTray.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { createLogger } from '../utils/logger';
2020
import { TalkToFigmaServerManager } from './TalkToFigmaServerManager';
2121
import { TalkToFigmaService } from './TalkToFigmaService';
2222
import { checkForUpdates } from '../utils/updater';
23+
import { getUpdateCapabilities } from '../utils/distribution';
2324

2425
const logger = createLogger('Tray');
2526

@@ -110,6 +111,7 @@ export class TalkToFigmaTray {
110111
private buildMenu(): Menu {
111112
const status = this.manager.getStatus();
112113
const wsRunning = status.websocket.running;
114+
const { canCheckForUpdates } = getUpdateCapabilities();
113115

114116
const template: Electron.MenuItemConstructorOptions[] = [
115117
// ═══ HEADER ═══
@@ -147,12 +149,15 @@ export class TalkToFigmaTray {
147149
},
148150
{ type: 'separator' },
149151

150-
// ═══ UPDATE CHECK ═══
151-
{
152-
label: 'Check for Updates...',
153-
click: () => checkForUpdates(true),
154-
},
155-
{ type: 'separator' },
152+
...(canCheckForUpdates
153+
? [
154+
{
155+
label: 'Check for Updates...',
156+
click: () => checkForUpdates(true),
157+
},
158+
{ type: 'separator' as const },
159+
]
160+
: []),
156161

157162
// ═══ EXIT ═══
158163
{

src/main/utils/distribution.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2026 Grabtaxi Holdings Pte Ltd (GRAB), All rights reserved.
3+
*
4+
* Use of this source code is governed by an MIT-style license that can be found in the LICENSE file
5+
*/
6+
7+
export type DistributionChannel = 'direct' | 'mas' | 'msix';
8+
9+
export interface UpdateCapabilities {
10+
channel: DistributionChannel;
11+
canCheckForUpdates: boolean;
12+
managedByStore: boolean;
13+
}
14+
15+
export function getDistributionChannel(): DistributionChannel {
16+
if (process.mas) {
17+
return 'mas';
18+
}
19+
20+
if (process.windowsStore) {
21+
return 'msix';
22+
}
23+
24+
return 'direct';
25+
}
26+
27+
export function getUpdateCapabilities(): UpdateCapabilities {
28+
const channel = getDistributionChannel();
29+
const canCheckForUpdates = channel === 'direct';
30+
31+
return {
32+
channel,
33+
canCheckForUpdates,
34+
managedByStore: !canCheckForUpdates,
35+
};
36+
}

src/main/utils/updater.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import { autoUpdater, BrowserWindow, dialog, app } from 'electron';
88
import log from 'electron-log';
9+
import { getUpdateCapabilities } from './distribution';
910

1011
// Configure logging
1112
log.transports.file.level = 'info';
@@ -35,10 +36,9 @@ export function initializeUpdater() {
3536
return;
3637
}
3738

38-
// App Store / TestFlight builds must not use Electron autoUpdater.
39-
// Updates are managed by the App Store infrastructure.
40-
if (process.mas || process.windowsStore) {
41-
log.info('Auto-updater disabled for App Store/TestFlight/MSIX builds');
39+
const { canCheckForUpdates, channel } = getUpdateCapabilities();
40+
if (!canCheckForUpdates) {
41+
log.info(`Auto-updater disabled for ${channel} distribution channel`);
4242
return;
4343
}
4444

@@ -164,16 +164,9 @@ export function checkForUpdates(manual = false) {
164164
return;
165165
}
166166

167-
// MAS/TestFlight/MSIX: update checks are handled by app stores.
168-
if (process.mas || process.windowsStore) {
169-
log.info('Skipping update check for App Store/TestFlight/MSIX build');
170-
if (manual) {
171-
dialog.showMessageBox({
172-
type: 'info',
173-
title: 'Updates Managed by Store',
174-
message: 'This build receives updates through the App Store or Microsoft Store.'
175-
});
176-
}
167+
const { canCheckForUpdates, channel } = getUpdateCapabilities();
168+
if (!canCheckForUpdates) {
169+
log.info(`Skipping update check for ${channel} distribution channel`);
177170
return;
178171
}
179172

src/pages/Help.tsx

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,34 @@
1+
import { useEffect, useState } from 'react'
12
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
23
import { Button } from '@/components/ui/button'
34
import { HelpCircle, ExternalLink, FileText, Github, BookOpen, MessageCircle, Download } from 'lucide-react'
45

56
export function HelpPage() {
7+
const [canCheckForUpdates, setCanCheckForUpdates] = useState(false)
8+
9+
useEffect(() => {
10+
let active = true
11+
12+
const loadUpdateCapabilities = async () => {
13+
try {
14+
const capabilities = await window.electron?.update?.getCapabilities?.()
15+
if (active) {
16+
setCanCheckForUpdates(capabilities?.canCheckForUpdates ?? false)
17+
}
18+
} catch {
19+
if (active) {
20+
setCanCheckForUpdates(false)
21+
}
22+
}
23+
}
24+
25+
void loadUpdateCapabilities()
26+
27+
return () => {
28+
active = false
29+
}
30+
}, [])
31+
632
const openExternal = (url: string) => {
733
window.electron?.shell?.openExternal?.(url)
834
}
@@ -44,28 +70,29 @@ export function HelpPage() {
4470
</CardContent>
4571
</Card>
4672

47-
{/* Updates */}
48-
<Card>
49-
<CardHeader>
50-
<CardTitle className="flex items-center gap-2">
51-
<Download className="size-5" />
52-
Updates
53-
</CardTitle>
54-
<CardDescription>
55-
Keep your app up to date with the latest features and fixes
56-
</CardDescription>
57-
</CardHeader>
58-
<CardContent className="space-y-2">
59-
<Button
60-
variant="outline"
61-
className="w-full justify-start"
62-
onClick={checkForUpdates}
63-
>
64-
<Download className="size-4 mr-2" />
65-
Check for Updates
66-
</Button>
67-
</CardContent>
68-
</Card>
73+
{canCheckForUpdates && (
74+
<Card>
75+
<CardHeader>
76+
<CardTitle className="flex items-center gap-2">
77+
<Download className="size-5" />
78+
Updates
79+
</CardTitle>
80+
<CardDescription>
81+
Keep your app up to date with the latest features and fixes
82+
</CardDescription>
83+
</CardHeader>
84+
<CardContent className="space-y-2">
85+
<Button
86+
variant="outline"
87+
className="w-full justify-start"
88+
onClick={checkForUpdates}
89+
>
90+
<Download className="size-4 mr-2" />
91+
Check for Updates
92+
</Button>
93+
</CardContent>
94+
</Card>
95+
)}
6996

7097
{/* Get Help */}
7198
<Card>

src/preload.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ const electronAPI: ElectronAPI = {
8888

8989
update: {
9090
check: () => ipcRenderer.invoke(IPC_CHANNELS.UPDATE_CHECK),
91+
getCapabilities: () => ipcRenderer.invoke(IPC_CHANNELS.UPDATE_GET_CAPABILITIES),
9192
},
9293

9394
sse: {

src/shared/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export const IPC_CHANNELS = {
7979

8080
// Updates
8181
UPDATE_CHECK: 'update:check',
82+
UPDATE_GET_CAPABILITIES: 'update:get-capabilities',
8283

8384
// SSE migration detection
8485
SSE_CLIENT_DETECTED: 'sse:client-detected',

0 commit comments

Comments
 (0)