Skip to content

Commit

Permalink
Just ErrorBoundary'd out the issue with SongListMenu for now :/
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinfrei committed Dec 29, 2023
1 parent f5d34ef commit 38e36b7
Show file tree
Hide file tree
Showing 11 changed files with 437 additions and 795 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ yarn-error.log*
dist-electron
shared/build
modules/*/lib
.nx
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
},
"editor.formatOnSave": true,
"editor.tabSize": 2,
Expand Down
24 changes: 12 additions & 12 deletions modules/audiofileindex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@
"doc": "typedoc ./src/index.ts --readme none --tsconfig tsconfig.json"
},
"dependencies": {
"@freik/containers": "^0.2.12",
"@freik/helpers": "^0.3.11",
"@freik/logger": "^0.2.9",
"@freik/media-core": "^0.14.11",
"@freik/media-utils": "^0.19.3",
"@freik/node-utils": "^1.6.2",
"@freik/search": "^1.1.9",
"@freik/text": "^0.3.10",
"@freik/typechk": "^0.5.10",
"@freik/containers": "^0.2.13",
"@freik/helpers": "^0.3.12",
"@freik/logger": "^0.2.10",
"@freik/media-core": "^0.14.12",
"@freik/media-utils": "^0.19.4",
"@freik/node-utils": "^1.6.3",
"@freik/search": "^1.1.10",
"@freik/text": "^0.3.11",
"@freik/typechk": "^0.5.11",
"xxhashjs": "^0.2.2"
},
"devDependencies": {
"@freik/build-tools": "^3.6.9",
"@freik/build-tools": "^3.6.10",
"@types/debug": "^4.1.12",
"@types/jest": "^29.5.11",
"@types/rmfr": "^2.0.5",
"@types/xxhashjs": "^0.2.4",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"jest": "^29.7.0",
Expand Down
16 changes: 8 additions & 8 deletions modules/emain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@
"electron": ">=20.0.0"
},
"dependencies": {
"@freik/logger": "^0.2.9",
"@freik/sync": "^0.2.11",
"@freik/typechk": "^0.5.10"
"@freik/logger": "^0.2.10",
"@freik/sync": "^0.2.12",
"@freik/typechk": "^0.5.11"
},
"devDependencies": {
"@freik/node-utils": "^1.6.2",
"@freik/node-utils": "^1.6.3",
"@types/debug": "^4.1.12",
"@types/jest": "^29.5.11",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"electron": "^28.0.0",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"electron": "^28.1.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-prettier": "^5.1.2",
"jest": "^29.7.0",
"prettier": "^3.1.1",
"rimraf": "^5.0.5",
Expand Down
10 changes: 5 additions & 5 deletions modules/epreload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
"@freik/electron-render": "^0.1.0",
"@types/debug": "^4.1.12",
"@types/jest": "^29.5.11",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"electron": "^28.0.0",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"electron": "^28.1.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-prettier": "^5.1.2",
"jest": "^29.7.0",
"prettier": "^3.1.1",
"rimraf": "^5.0.5",
Expand All @@ -51,6 +51,6 @@
},
"files": ["lib/**/*"],
"dependencies": {
"@freik/logger": "^0.2.9"
"@freik/logger": "^0.2.10"
}
}
18 changes: 9 additions & 9 deletions modules/erenderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
},
"homepage": "https://github.com/kevinfrei/elect-render-tools#readme",
"dependencies": {
"@freik/logger": "^0.2.9",
"@freik/seqnum": "^1.1.9",
"@freik/typechk": "^0.5.10",
"@freik/logger": "^0.2.10",
"@freik/seqnum": "^1.1.10",
"@freik/typechk": "^0.5.11",
"@freik/web-utils": "^0.5.2",
"electron": "^28.0.0"
"electron": "^28.1.0"
},
"peerDependencies": {
"react": ">=17.0.2",
Expand All @@ -47,17 +47,17 @@
"@freik/web-utils": "^0.5.2",
"@types/debug": "^4.1.12",
"@types/jest": "^29.5.11",
"@types/react": "^17.0.73",
"@types/react": "^17.0.74",
"@types/react-dom": "^17.0.25",
"@types/react-test-renderer": "^17.0.9",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"electron": "^28.0.0",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"electron": "^28.1.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"./lib/**/*"
],
"dependencies": {
"@freik/typechk": "^0.5.10"
"@freik/typechk": "^0.5.11"
}
}
12 changes: 6 additions & 6 deletions modules/shared/src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
isString,
} from '@freik/typechk';

export enum IpcId {
export const enum IpcId {
ClearHates = 'clear-hates',
ClearLikes = 'clear-likes',
DeletePlaylist = 'delete-playlist',
Expand Down Expand Up @@ -48,7 +48,7 @@ export enum IpcId {
RescanInProgress = 'rescan-in-progress',
}

export enum Keys {
export const enum Keys {
AddFileLocation = 'O',
Albums = '2',
Artists = '3',
Expand All @@ -70,7 +70,7 @@ export enum Keys {
}

// TODO: This stuff let's me localize my strings eventually
export enum StrId {
export const enum StrId {
// MediaInfo.tsx strings
Mono = 'mono',
Stereo = 'stereo',
Expand Down Expand Up @@ -118,7 +118,7 @@ export function st(id: StrId): string {
return id;
}

export enum CurrentView {
export const enum CurrentView {
disabled = -1,
none = 0,
recent = 1,
Expand All @@ -132,14 +132,14 @@ export enum CurrentView {
tools = 9,
}

export enum TranscodeFormatTargets {
export const enum TranscodeFormatTargets {
m4a = 'm4a',
mp3 = 'mp3',
aac = 'aac',
}
export type TranscodeFormatTargetNames = 'm4a' | 'mp3' | 'aac';

export enum TranscodeSourceType {
export const enum TranscodeSourceType {
Playlist = 'p',
Artist = 'r',
Album = 'l',
Expand Down
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@
"hook-push": "yarn test"
},
"dependencies": {
"@fluentui/react": "^8.113.1",
"@fluentui/react-components": "^9.43.2",
"@fluentui/react": "^8.114.0",
"@fluentui/react-components": "^9.43.3",
"@fluentui/react-icons-mdl2": "^1.3.53",
"@freik/audiodb": "^0.8.3",
"@freik/containers": "^0.2.12",
"@freik/containers": "^0.2.13",
"@freik/electron-main": "^0.1.0",
"@freik/electron-preload": "^0.1.0",
"@freik/electron-render": "^0.1.0",
"@freik/emp-shared": "^0.0.6",
"@freik/helpers": "^0.3.11",
"@freik/logger": "^0.2.9",
"@freik/media-core": "^0.14.11",
"@freik/media-utils": "^0.19.3",
"@freik/node-utils": "^1.6.2",
"@freik/helpers": "^0.3.12",
"@freik/logger": "^0.2.10",
"@freik/media-core": "^0.14.12",
"@freik/media-utils": "^0.19.4",
"@freik/node-utils": "^1.6.3",
"@freik/p-limit": "^5.0.0",
"@freik/sync": "^0.2.11",
"@freik/text": "^0.3.10",
"@freik/typechk": "^0.5.10",
"@freik/sync": "^0.2.12",
"@freik/text": "^0.3.11",
"@freik/typechk": "^0.5.11",
"@freik/web-utils": "^0.5.2",
"album-art": "^3.2.1",
"jimp": "^0.22.10",
"open": "^10.0.0",
"open": "^10.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"recoil": "^0.7.7",
Expand All @@ -70,28 +70,28 @@
]
},
"devDependencies": {
"@freik/build-tools": "^3.6.9",
"@testing-library/jest-dom": "^6.1.5",
"@freik/build-tools": "^3.6.10",
"@testing-library/jest-dom": "^6.1.6",
"@testing-library/react": "^14.1.2",
"@types/debug": "^4.1.12",
"@types/electron-devtools-installer": "^2.2.5",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.5",
"@types/react": "^17.0.73",
"@types/react": "^17.0.74",
"@types/react-dom": "^17.0.25",
"@types/react-test-renderer": "^17.0.9",
"@types/xxhashjs": "^0.2.4",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"@vitejs/plugin-react": "^4.2.1",
"cross-env": "^7.0.3",
"electron": "^28.0.0",
"electron": "^28.1.0",
"electron-builder": "^24.10.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
Expand Down
37 changes: 20 additions & 17 deletions src/UI/SongMenus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Point,
} from '@fluentui/react';
import { Ipc } from '@freik/electron-render';
import { IpcId } from '@freik/emp-shared';
import { SongKey } from '@freik/media-core';
import { isString } from '@freik/typechk';
import {
Expand All @@ -14,14 +15,14 @@ import {
useMyTransaction,
} from '@freik/web-utils';
import { useRecoilValue } from 'recoil';
import { IpcId } from '@freik/emp-shared';
import {
songHateFuncFam,
songLikeFuncFam,
songLikeNumFromStringFuncFam,
} from '../Recoil/Likes';
import { AddSongs, PlaySongs } from '../Recoil/api';
import { SongListDetailClick } from './DetailPanel/Clickers';
import { ErrorBoundary } from './Utilities';

export type SongListMenuData = { data: string; spot: Point };

Expand Down Expand Up @@ -163,21 +164,23 @@ export function SongListMenu({
}

return (
<ContextualMenu
directionalHint={DirectionalHint.bottomRightEdge}
isBeakVisible={true}
hidden={context.data === ''}
items={realItems}
target={context.spot}
onDismiss={(ev) => {
// The DetailsList panel wiggles. A lot.
// So I had to turn off dismissal for scroll events, cuz otherwise it
// would disappear almost immediately.
if (ev?.type !== 'scroll') {
onClearContext();
}
}}
styles={{ container: { margin: 0, padding: 0, fontSize: 'small' } }}
/>
<ErrorBoundary>
<ContextualMenu
directionalHint={DirectionalHint.bottomRightEdge}
isBeakVisible={true}
hidden={context.data === ''}
items={realItems}
target={context.spot}
onDismiss={(ev) => {
// The DetailsList panel wiggles. A lot.
// So I had to turn off dismissal for scroll events, cuz otherwise it
// would disappear almost immediately.
if (ev?.type !== 'scroll') {
onClearContext();
}
}}
styles={{ container: { margin: 0, padding: 0, fontSize: 'small' } }}
/>
</ErrorBoundary>
);
}
Loading

0 comments on commit 38e36b7

Please sign in to comment.