Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade electron 26->27 to fix screen blanking #3980

Merged
merged 5 commits into from Oct 13, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -105,7 +105,7 @@
"dependency-graph": "^0.11.0",
"dotenv": "^16.3.1",
"dotenv-expand": "^10.0.0",
"electron": "26.3.0",
"electron": "25.9.1",
"electron-builder": "^24.4.0",
"electron-mock-ipc": "^0.3.8",
"eslint": "^8.0.0",
Expand Down
Expand Up @@ -51,21 +51,31 @@ export interface TreeNode {
children: TreeNode[]
}

export function generateHierarchy(
export function generateHierarchy({
model,
trackConfs,
extra,
}: {
model: {
filterText: string
activeSortTrackNames: boolean
activeSortCategories: boolean
collapsed: Map<string, boolean>
view?: {
tracks: { configuration: AnyConfigurationModel }[]
}
},
trackConfs: AnyConfigurationModel[],
collapsed: { get: (arg: string) => boolean | undefined },
extra?: string,
): TreeNode[] {
}
trackConfs: AnyConfigurationModel[]
extra?: string
}): TreeNode[] {
const hierarchy = { children: [] as TreeNode[] } as TreeNode
const { filterText, activeSortTrackNames, activeSortCategories, view } = model
const {
collapsed,
filterText,
activeSortTrackNames,
activeSortCategories,
view,
} = model
if (!view) {
return []
}
Expand Down
Expand Up @@ -207,12 +207,11 @@ export default function stateTreeFactory(pluginManager: PluginManager) {
name: string
tracks: AnyConfigurationModel[]
}): TreeNode[] {
return generateHierarchy(
self as HierarchicalTrackSelectorModel,
self.connectionTrackConfigurations(connection),
self.collapsed,
connection.name,
)
return generateHierarchy({
model: self,
trackConfs: self.connectionTrackConfigurations(connection),
extra: connection.name,
})
},
}))
.views(self => ({
Expand Down Expand Up @@ -242,7 +241,10 @@ export default function stateTreeFactory(pluginManager: PluginManager) {
.map(s => ({
name: s.group,
id: s.group,
children: generateHierarchy(self, s.tracks, self.collapsed),
children: generateHierarchy({
model: self,
trackConfs: s.tracks,
}),
}))
// always keep the Tracks entry at idx 0
.filter((f, idx) => idx === 0 || !!f.children.length),
Expand Down
4 changes: 2 additions & 2 deletions products/jbrowse-desktop/package.json
Expand Up @@ -105,13 +105,13 @@
"use-query-params": "^2.0.0"
},
"devDependencies": {
"electron": "26.3.0"
"electron": "25.9.1"
},
"browserslist": [
"last 1 chrome version"
],
"build": {
"electronVersion": "26.3.0",
"electronVersion": "25.9.1",
"extraMetadata": {
"main": "build/electron.js"
},
Expand Down
89 changes: 44 additions & 45 deletions products/jbrowse-desktop/public/electron.ts
Expand Up @@ -220,89 +220,88 @@ async function createWindow() {

const mainMenu = Menu.buildFromTemplate([
// { role: 'appMenu' }
// @ts-expect-error
...(isMac
? [
{
label: app.name,
submenu: [
{ role: 'about' },
{ type: 'separator' },
{ role: 'services' },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideothers' },
{ role: 'unhide' },
{ type: 'separator' },
{ role: 'quit' },
{ role: 'about' as const },
{ type: 'separator' as const },
{ role: 'services' as const },
{ type: 'separator' as const },
{ role: 'hide' as const },
{ role: 'hideOthers' as const },
{ role: 'unhide' as const },
{ type: 'separator' as const },
{ role: 'quit' as const },
],
},
]
: []),
{
label: 'File',
// @ts-expect-error
submenu: [isMac ? { role: 'close' } : { role: 'quit' }],
submenu: [isMac ? { role: 'close' as const } : { role: 'quit' as const }],
},
{
label: 'Edit',
submenu: [
{ role: 'undo' },
{ role: 'redo' },
{ type: 'separator' },
{ role: 'cut' },
{ role: 'copy' },
{ role: 'paste' },
// @ts-expect-error
{ role: 'undo' as const },
{ role: 'redo' as const },
{ type: 'separator' as const },
{ role: 'cut' as const },
{ role: 'copy' as const },
{ role: 'paste' as const },
...(isMac
? [
{ role: 'pasteAndMatchStyle' },
{ role: 'delete' },
{ role: 'selectAll' },
{ type: 'separator' },
{ role: 'pasteAndMatchStyle' as const },
{ role: 'delete' as const },
{ role: 'selectAll' as const },
{ type: 'separator' as const },
{
label: 'Speech',
submenu: [{ role: 'startspeaking' }, { role: 'stopspeaking' }],
label: 'Speech' as const,
submenu: [
{ role: 'startSpeaking' as const },
{ role: 'stopSpeaking' as const },
],
},
]
: [{ role: 'delete' }, { type: 'separator' }, { role: 'selectAll' }]),
: [
{ role: 'delete' as const },
{ type: 'separator' as const },
{ role: 'selectAll' as const },
]),
],
},
{
label: 'View',
submenu: [
{ role: 'reload' },
// @ts-expect-error
{ role: 'toggledevtools' },
{ type: 'separator' },
// @ts-expect-error
{ role: 'zoomin' },
// @ts-expect-error
{ role: 'zoomout' },
{ type: 'separator' },
{ role: 'togglefullscreen' },
{ role: 'reload' as const },
{ role: 'toggleDevTools' as const },
{ type: 'separator' as const },
{ role: 'zoomIn' as const },
{ role: 'zoomOut' as const },
{ type: 'separator' as const },
{ role: 'togglefullscreen' as const },
],
},
{
label: 'Window',
submenu: [
{ role: 'minimize' },
{ role: 'zoom' },
// @ts-expect-error
{ role: 'minimize' as const },
{ role: 'zoom' as const },
...(isMac
? [
{ type: 'separator' },
{ role: 'front' },
{ type: 'separator' },
{ role: 'window' },
{ type: 'separator' as const },
{ role: 'front' as const },
{ type: 'separator' as const },
{ role: 'window' as const },
]
: [{ role: 'close' }]),
: [{ role: 'close' as const }]),
],
},
{
label: 'Help',
role: 'help',
// @ts-expect-error
submenu: [
{
label: 'Learn More',
Expand Down