Skip to content

Commit 1cebc7f

Browse files
committed
release: v1.7.0
1 parent 5d517dd commit 1cebc7f

File tree

10 files changed

+123
-8
lines changed

10 files changed

+123
-8
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# 1.7.0 (2024-01-05)
2+
3+
## Features
4+
- **ChordDictionary**: added a new module for displaying all available chords
5+
- **PianoKeyboard**: added target notes (for future use & dictionary)
6+
- **ChordDisplay**: detect on release option
7+
- **ChordDisplay**: added chord link to dictionary
8+
- **Layout**: added a bottom bar with key signature and latency
9+
10+
## Fixes
11+
- **Notation**: adapt centering when single stave
12+
- **CircleOfFifths**: dominant sector not correclty detected
13+
14+
115
# 1.6.2 (2023-12-19)
216

317
## Fixes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "midi-jar",
3-
"version": "1.6.2",
3+
"version": "1.7.0",
44
"description": "A MIDI tool box for displaying chords and notes, routing devices, and more",
55
"main": "./src/main/main.ts",
66
"scripts": {

release/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "midi-jar",
3-
"version": "1.6.2",
3+
"version": "1.7.0",
44
"description": "A MIDI tool box for displaying chords and notes, routing devices, and more",
55
"license": "MIT",
66
"author": {

src/main/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ ipcMain.on('app:window:getState', (event) => {
113113

114114
onWindowStateChange((state?: WindowState) => {
115115
if (state) {
116-
sendToAll('app:window:state', state);
116+
sendToAll('app:window:state', getWindowState());
117117
}
118118
});
119119

src/main/store/defaults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const defaults: StoreType = {
104104
height: null,
105105
maximized: false,
106106
alwaysOnTop: false,
107-
changelogDismissed: true,
107+
changelogDismissed: '100.0.0', // hack: ensure changelog does not blink at startup
108108
updateDismissed: null,
109109
path: '/',
110110
},

src/main/store/legacy-types.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,46 @@ export type v1_6_0_ChordDisplaySettings = {
227227
displayIntervals: boolean;
228228
keyboard: v1_6_0_KeyboardSettings;
229229
};
230+
231+
export type v1_6_0_Settings = {
232+
general: v1_0_0_GeneralSettings;
233+
server: v1_0_0_ServerSettings;
234+
chordDisplay: v1_6_0_ChordDisplaySettings[];
235+
chordQuiz: v1_5_0_ChordQuizSettings;
236+
circleOfFifths: v1_2_0_CircleOfFifthsSettings;
237+
notation: v1_2_0_NotationSettings;
238+
};
239+
240+
/* v1.7.0 - added chord dictionary, fix changelog dismissed */
241+
export type v1_7_0_ChordDisplaySettings = Omit<v1_6_0_ChordDisplaySettings, 'chordNotation'> & {
242+
detectOnRelease: boolean;
243+
chordNotation: 'long' | 'short' | 'symbol' | 'preferred';
244+
};
245+
246+
export type v1_7_0_ChordQuizSettings = Omit<v1_5_0_ChordQuizSettings, 'chordNotation'> & {
247+
chordNotation: 'long' | 'short' | 'symbol' | 'preferred';
248+
};
249+
250+
export type v1_7_0_ChordDictionarySettings = {
251+
interactive: 'detect' | 'play';
252+
hideDisabled: boolean;
253+
filterInKey: boolean;
254+
groupBy: 'none' | 'quality' | 'intervals';
255+
defaultNotation: 'long' | 'short' | 'symbol';
256+
disabled: string[];
257+
aliases: Array<[key: string, value: string]>;
258+
};
259+
260+
export type v1_7_0_WindowState = v1_5_1_WindowState & {
261+
changelogDismissed: string | null;
262+
};
263+
264+
export type v1_7_0_Settings = {
265+
general: v1_0_0_GeneralSettings;
266+
server: v1_0_0_ServerSettings;
267+
chordDisplay: v1_7_0_ChordDisplaySettings[];
268+
chordQuiz: v1_7_0_ChordQuizSettings;
269+
chordDictionary: v1_7_0_ChordDictionarySettings;
270+
circleOfFifths: v1_2_0_CircleOfFifthsSettings;
271+
notation: v1_2_0_NotationSettings;
272+
};

src/main/store/migrations.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ import {
1616
v1_5_1_WindowState,
1717
v1_6_0_ChordDisplaySettings,
1818
v1_6_0_KeyboardSettings,
19+
v1_6_0_Settings,
20+
v1_7_0_ChordDisplaySettings,
21+
v1_7_0_Settings,
1922
} from './legacy-types';
2023

2124
const migrations: Migrations<StoreType> = {
@@ -312,6 +315,40 @@ const migrations: Migrations<StoreType> = {
312315

313316
store.set('settings.chordDisplay', newChordDisplay);
314317
},
318+
'1.7.0': (store: Conf<StoreType>) => {
319+
store.set('version', '1.7.0');
320+
store.set('windowState.changelogDismissed', null);
321+
322+
const settings = store.get('settings') as unknown as v1_6_0_Settings;
323+
324+
const newSettings: v1_7_0_Settings = {
325+
...settings,
326+
chordDisplay: settings.chordDisplay.map(
327+
(chordDisplaySettings): v1_7_0_ChordDisplaySettings => ({
328+
...chordDisplaySettings,
329+
detectOnRelease: true,
330+
chordNotation: 'preferred',
331+
})
332+
),
333+
chordQuiz: {
334+
...settings.chordQuiz,
335+
chordNotation: 'preferred',
336+
},
337+
chordDictionary: {
338+
interactive: 'play',
339+
hideDisabled: false,
340+
filterInKey: false,
341+
groupBy: 'none',
342+
defaultNotation: settings.chordDisplay[0]
343+
? settings.chordDisplay[0].chordNotation
344+
: 'short',
345+
disabled: [],
346+
aliases: [['maj', '']],
347+
},
348+
};
349+
350+
store.set('settings', newSettings);
351+
},
315352
};
316353

317354
export default migrations;

src/main/types/WindowState.schema.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
"type": "boolean"
66
},
77
"changelogDismissed": {
8-
"type": "boolean"
8+
"type": [
9+
"null",
10+
"string"
11+
]
912
},
1013
"height": {
1114
"type": [

src/main/types/WindowState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export type WindowState = {
55
height: number | null;
66
maximized: boolean;
77
alwaysOnTop: boolean;
8-
changelogDismissed: boolean;
8+
changelogDismissed: string | null;
99
updateDismissed: string | null;
1010
path: string;
1111
};

src/main/windowState.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import { screen, BrowserWindow, Rectangle } from 'electron';
2+
import { lt, lte } from 'semver';
3+
24
import { store, defaults } from './store';
35
import { WindowState } from './types/WindowState';
46
import { getURLHash } from './util';
57

8+
import packageJson from '../../package.json';
9+
610
export const DEFAULT_WINDOW_WIDTH = 1024;
711
export const DEFAULT_WINDOW_HEIGHT = 768;
812
export const DEFAULT_WINDOW_MIN_WIDTH = 480;
@@ -18,7 +22,21 @@ function isWindowInDisplay(wB: Rectangle, dB: Rectangle) {
1822
}
1923

2024
export function getWindowState() {
21-
return store.get('windowState') ?? defaults.windowState;
25+
const storedWindowState = store.get('windowState') ?? defaults.windowState;
26+
27+
return {
28+
...storedWindowState,
29+
updateDismissed:
30+
!storedWindowState.updateDismissed ||
31+
lte(storedWindowState.updateDismissed, packageJson.version)
32+
? null
33+
: storedWindowState.updateDismissed,
34+
changelogDismissed:
35+
!storedWindowState.changelogDismissed ||
36+
lt(storedWindowState.changelogDismissed, packageJson.version)
37+
? null
38+
: storedWindowState.changelogDismissed,
39+
};
2240
}
2341

2442
export function getWindowBoundsOnDisplay() {
@@ -56,7 +74,7 @@ export function saveWindowState(window: BrowserWindow) {
5674
}
5775

5876
export function dismissChangelog() {
59-
return store.set('windowState.changelogDismissed', true);
77+
return store.set('windowState.changelogDismissed', packageJson.version);
6078
}
6179

6280
export function dismissUpdate(version: string) {

0 commit comments

Comments
 (0)