Skip to content

Commit a0ea3a4

Browse files
authored
Merge pull request #534 from bitfinexcom/staging
Release version 4.35.0
2 parents f212ab1 + 205f0b2 commit a0ea3a4

13 files changed

Lines changed: 146 additions & 58 deletions

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [4.35.0] - 2025-04-23
11+
12+
### Added
13+
14+
- Added warning message styles for PDF reports. PR: [bfx-report#429](https://github.com/bitfinexcom/bfx-report/pull/429)
15+
- Added ability to continue the `Tax Report` generation without `delisted` currencies. PR: [bfx-reports-framework#449](https://github.com/bitfinexcom/bfx-reports-framework/pull/449)
16+
- Added ability to deduct trading fees in the `Tax Report`. Added a flag `shouldFeesBeDeducted` to use that via a checkbox in the UI. PR: [bfx-reports-framework#450](https://github.com/bitfinexcom/bfx-reports-framework/pull/450)
17+
- Added native behavior to minimize and close the loading window. The main reason is to provide the ability to `minimize` and then `restore` the loading window on all OSs as each OS has a specific behavior. Also added a close button to be able to interrupt the app startup. PR: [bfx-report-electron#530](https://github.com/bitfinexcom/bfx-report-electron/pull/530)
18+
- Implemented `Credit Line` wallet representation in the `Balances` section. Added `Credit Line` wallet support in the columns filters. PR: [bfx-report-ui#920](https://github.com/bitfinexcom/bfx-report-ui/pull/920)
19+
- Implemented UI theme selection binding with Electron wrapper. The main idea is to have synchronized theme in UI and Electron-specific menus, modals, etc. PR: [bfx-report-ui#921](https://github.com/bitfinexcom/bfx-report-ui/pull/921)
20+
21+
### Changed
22+
23+
- Actualized the `Tax Report` data handling. PR: [bfx-report-ui#922](https://github.com/bitfinexcom/bfx-report-ui/pull/922)
24+
- Disabled `Concentration Risk` refresh button during initial synchronization to prevent report generation errors. Added a corresponding notice to communicate this to the user. PR: [bfx-report-ui#923](https://github.com/bitfinexcom/bfx-report-ui/pull/923)
25+
1026
## [4.34.1] - 2025-04-09
1127

1228
### Added

package-lock.json

Lines changed: 2 additions & 2 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bfx-report-electron",
3-
"version": "4.34.1",
3+
"version": "4.35.0",
44
"repository": "https://github.com/bitfinexcom/bfx-report-electron",
55
"description": "Reporting tool",
66
"author": "bitfinex.com",

src/enforce-macos-app-location.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ module.exports = async () => {
5050
description: i18next
5151
.t('enforceMacOSAppLocation.loadingWindow.description'),
5252
isRequiredToCloseAllWins: true,
53-
isIndeterminateMode: true
53+
isIndeterminateMode: true,
54+
shouldCloseBtnBeShown: true,
55+
shouldMinimizeBtnBeShown: true
5456
})
5557

5658
app.moveToApplicationsFolder({

src/helpers/manage-window.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ const hideWindow = (win, opts) => {
1313
!win ||
1414
typeof win !== 'object' ||
1515
win.isDestroyed() ||
16-
!win.isVisible()
16+
(
17+
!win.isVisible() &&
18+
!win.isMinimized()
19+
)
1720
) {
1821
resolve()
1922

@@ -25,6 +28,9 @@ const hideWindow = (win, opts) => {
2528
if (shouldWinBeBlurred) {
2629
win.blur()
2730
}
31+
if (win.isMinimized()) {
32+
win.restore()
33+
}
2834

2935
win.hide()
3036
} catch (err) {
@@ -45,7 +51,10 @@ const showWindow = (win, opts) => {
4551
!win ||
4652
typeof win !== 'object' ||
4753
win.isDestroyed() ||
48-
win.isVisible()
54+
(
55+
win.isVisible() &&
56+
!win.isMinimized()
57+
)
4958
) {
5059
resolve()
5160

@@ -60,6 +69,9 @@ const showWindow = (win, opts) => {
6069
resolve()
6170
})
6271

72+
if (win.isMinimized()) {
73+
win.restore()
74+
}
6375
if (shouldWinBeShownInactive) {
6476
win.showInactive()
6577

src/window-creators/change-loading-win-visibility-state.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const _closeAllWindows = () => {
2424
return Promise.all(promises)
2525
}
2626

27-
const _setParentWindow = (noParent) => {
27+
const setParentToLoadingWindow = (noParent) => {
2828
// TODO: The reason for it related to the electronjs issue:
2929
// `[Bug]: Wrong main window hidden state on macOS when using 'parent' option`
3030
// https://github.com/electron/electron/issues/29732
@@ -198,7 +198,9 @@ const showLoadingWindow = async (opts) => {
198198
isRequiredToCloseAllWins = false,
199199
isNotRunProgressLoaderRequired = false,
200200
isIndeterminateMode = false,
201-
noParent = false
201+
noParent = false,
202+
shouldCloseBtnBeShown,
203+
shouldMinimizeBtnBeShown
202204
} = opts ?? {}
203205

204206
if (
@@ -210,7 +212,7 @@ const showLoadingWindow = async (opts) => {
210212
.createLoadingWindow()
211213
}
212214

213-
_setParentWindow(isRequiredToCloseAllWins || noParent)
215+
setParentToLoadingWindow(isRequiredToCloseAllWins || noParent)
214216

215217
const _progress = Number.isFinite(progress)
216218
? Math.floor(progress * 100) / 100
@@ -223,6 +225,11 @@ const showLoadingWindow = async (opts) => {
223225
_runProgressLoader({ progress: _progress, isIndeterminateMode })
224226
}
225227

228+
GeneralIpcChannelHandlers
229+
.sendLoadingBtnStates(wins.loadingWindow, {
230+
shouldCloseBtnBeShown: shouldCloseBtnBeShown ?? false,
231+
shouldMinimizeBtnBeShown: shouldMinimizeBtnBeShown ?? false
232+
})
226233
await setLoadingDescription({ progress: _progress, description })
227234

228235
if (!wins.loadingWindow.isVisible()) {
@@ -269,5 +276,6 @@ const hideLoadingWindow = async (opts) => {
269276
module.exports = {
270277
showLoadingWindow,
271278
hideLoadingWindow,
272-
setLoadingDescription
279+
setLoadingDescription,
280+
setParentToLoadingWindow
273281
}

src/window-creators/index.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ const windowStateKeeper = require('./window-state-keeper')
1616
const createMenu = require('../create-menu')
1717
const {
1818
showLoadingWindow,
19-
hideLoadingWindow
19+
hideLoadingWindow,
20+
setParentToLoadingWindow
2021
} = require('./change-loading-win-visibility-state')
2122
const {
2223
showWindow,
@@ -176,15 +177,20 @@ const _createWindow = async (
176177
}
177178

178179
if (!pathname) {
179-
const props = await createLoadingWindow()
180-
props.win.setAlwaysOnTop(true)
180+
await showLoadingWindow({
181+
shouldCloseBtnBeShown: true,
182+
shouldMinimizeBtnBeShown: true,
183+
noParent: true
184+
})
185+
wins.loadingWindow.setAlwaysOnTop(true)
181186

182187
return res
183188
}
184189
if (props.center) {
185190
centerWindow(wins[winName])
186191
}
187192

193+
setParentToLoadingWindow()
188194
await showWindow(wins[winName])
189195

190196
return res
@@ -197,7 +203,8 @@ const _createChildWindow = async (
197203
) => {
198204
const {
199205
width = 500,
200-
height = 500
206+
height = 500,
207+
noParent
201208
} = { ...opts }
202209

203210
const point = electron.screen.getCursorScreenPoint()
@@ -224,7 +231,12 @@ const _createChildWindow = async (
224231
// TODO: The reason for it related to the electronjs issue:
225232
// `[Bug]: Wrong main window hidden state on macOS when using 'parent' option`
226233
// https://github.com/electron/electron/issues/29732
227-
parent: isMac ? null : wins.mainWindow,
234+
parent: (
235+
isMac ||
236+
noParent
237+
)
238+
? null
239+
: wins.mainWindow,
228240
alwaysOnTop: isMac,
229241

230242
...opts
@@ -317,24 +329,15 @@ const createMainWindow = async ({
317329
}
318330

319331
const createLoadingWindow = async () => {
320-
if (
321-
wins.loadingWindow &&
322-
typeof wins.loadingWindow === 'object' &&
323-
!wins.loadingWindow.isDestroyed()
324-
) {
325-
await showLoadingWindow()
326-
327-
return { win: wins.loadingWindow }
328-
}
329-
330332
const winProps = await _createChildWindow(
331333
pathToLayoutAppInit,
332334
'loadingWindow',
333335
{
334336
width: 350,
335337
height: 350,
336338
maximizable: false,
337-
fullscreenable: false
339+
fullscreenable: false,
340+
noParent: true
338341
}
339342
)
340343

src/window-creators/layouts/app-init.html

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
padding: 5px;
3636
}
3737

38-
.minimize-btn {
38+
.window-btn {
3939
position: relative;
40-
display: block;
40+
display: inline-block;
4141
width: 30px;
4242
height: 30px;
4343
border-radius: 50%;
@@ -46,21 +46,44 @@
4646
cursor: pointer;
4747
}
4848

49-
.minimize-btn::after {
49+
.window-btn__minimize::after {
5050
content: "";
5151
display: block;
5252
position: absolute;
5353
width: 12px;
5454
height: 1px;
55-
background-color: var(--btnMinimizeAfterBg, #9b9a9a);
55+
background-color: var(--btnWindowAfterBg, #9b9a9a);
5656
bottom: 9px;
5757
left: calc((30px - 12px) / 2);
5858
}
5959

60-
.minimize-btn:hover,
61-
.minimize-btn:active,
62-
.minimize-btn:focus {
63-
background-color: var(--btnMinimizeHoverBg, #9b9a9a);
60+
.window-btn__close::before, .window-btn__close::after {
61+
content: "";
62+
display: block;
63+
position: absolute;
64+
width: 17px; /* sqrt(12^2 + 12^2) where 12px width */
65+
height: 1px;
66+
background-color: var(--btnWindowAfterBg, #9b9a9a);
67+
bottom: calc((11px / 2) + 9px);
68+
left: calc((30px - 17px) / 2);
69+
}
70+
71+
.window-btn__close::before {
72+
transform: rotate(45deg);
73+
}
74+
75+
.window-btn__close::after {
76+
transform: rotate(-45deg);
77+
}
78+
79+
.window-btn:hover,
80+
.window-btn:active,
81+
.window-btn:focus {
82+
background-color: var(--btnWindowHoverBg, #9b9a9a);
83+
}
84+
85+
.window-btn--disabled {
86+
display: none;
6487
}
6588

6689
.lds-roller {
@@ -236,7 +259,8 @@
236259

237260
<body class="body">
238261
<div class="win-control-btn">
239-
<div id="minBtn" class="minimize-btn"></div>
262+
<div id="minBtn" class="window-btn window-btn__minimize window-btn--disabled"></div>
263+
<div id="closeBtn" class="window-btn window-btn__close window-btn--disabled"></div>
240264
</div>
241265
<div class="lds-roller">
242266
<div></div>
@@ -259,10 +283,18 @@
259283
const rollers = document.getElementsByClassName('lds-roller')
260284
const descriptionElem = document.getElementById('description')
261285
const minBtnElem = document.getElementById('minBtn')
286+
const closeBtnElem = document.getElementById('closeBtn')
262287

263288
minBtnElem.onclick = async () => {
264289
try {
265-
await window.bfxReportElectronApi?.hideLoadingWindow()
290+
await window.bfxReportElectronApi?.minimizeLoadingWindow()
291+
} catch (err) {
292+
console.error(err)
293+
}
294+
}
295+
closeBtnElem.onclick = async () => {
296+
try {
297+
await window.bfxReportElectronApi?.closeLoadingWindow()
266298
} catch (err) {
267299
console.error(err)
268300
}
@@ -274,6 +306,22 @@
274306
}
275307
}, 2500)
276308

309+
window.bfxReportElectronApi?.onLoadingBtnStates((args) => {
310+
try {
311+
if (args?.shouldMinimizeBtnBeShown) {
312+
minBtnElem.classList.remove('window-btn--disabled')
313+
} else {
314+
minBtnElem.classList.add('window-btn--disabled')
315+
}
316+
if (args?.shouldCloseBtnBeShown) {
317+
closeBtnElem.classList.remove('window-btn--disabled')
318+
} else {
319+
closeBtnElem.classList.add('window-btn--disabled')
320+
}
321+
} catch (err) {
322+
console.debug(err)
323+
}
324+
})
277325
window.bfxReportElectronApi?.onLoadingDescription((args) => {
278326
try {
279327
if (typeof args?.description !== 'string') {

0 commit comments

Comments
 (0)