Skip to content

Commit f212ab1

Browse files
authored
Merge pull request #529 from bitfinexcom/staging
Release version 4.34.1
2 parents 5a66602 + 20dc93b commit f212ab1

File tree

10 files changed

+99
-20
lines changed

10 files changed

+99
-20
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10+
## [4.34.1] - 2025-04-09
11+
12+
### Added
13+
14+
- Added ability to avoid queuing sync by scheduler if sync is already in progress to prevent redundant sync in case a user has lots of data and sync takes time until the run of the scheduler. PR: [bfx-reports-framework#446](https://github.com/bitfinexcom/bfx-reports-framework/pull/446)
15+
- Added `Margin trading` and `Derivative` support to the `Tax Report` sources. PR: [bfx-report-ui#909](https://github.com/bitfinexcom/bfx-report-ui/pull/909)
16+
17+
### Changed
18+
19+
- Changed the order of getting the price of the pub trades moving from the end to the start by timestamps to overcome some rare cases. Related to this issue: [bfx-report-electron#493](https://github.com/bitfinexcom/bfx-report-electron/issues/493). PR: [bfx-reports-framework#445](https://github.com/bitfinexcom/bfx-reports-framework/pull/445)
20+
- Disabled `Average Win/Loss` refresh button during initial synchronization to prevent report generation errors. Added a corresponding notice to communicate this to the user. PR: [bfx-report-ui#916](https://github.com/bitfinexcom/bfx-report-ui/pull/916)
21+
- Improved derivative currencies formatting (like `ETHF0` -> `ETH (deriv)` etc.) for a more consistent looking and representation. PR: [bfx-report-ui#910](https://github.com/bitfinexcom/bfx-report-ui/pull/910)
22+
- Improved sync info popup proportions for a better look after the changing used font family. PR: [bfx-report-ui#901](https://github.com/bitfinexcom/bfx-report-ui/pull/901)
23+
- Disabled `Traded Volume` refresh button during initial synchronization to prevent report generation errors. Added a corresponding notice to communicate this to the user. PR: [bfx-report-ui#906](https://github.com/bitfinexcom/bfx-report-ui/pull/906)
24+
25+
### Fixed
26+
27+
- Fixed `auto-update-toast:width` listener by adding `uid` to define `alert` instance and ajusts toast position and theme colors. Related to this issue: [bfx-report-electron#526](https://github.com/bitfinexcom/bfx-report-electron/issues/526). PR: [bfx-report-electron#527](https://github.com/bitfinexcom/bfx-report-electron/pull/527)
28+
- Fixed query builder for `null` operator for sub-query. PR: [bfx-reports-framework#444](https://github.com/bitfinexcom/bfx-reports-framework/pull/444)
29+
- Prevented `getLastFinishedSyncMts` requests and sync progress checking after the logout to avoid auth errors. PR: [bfx-report-ui#917](https://github.com/bitfinexcom/bfx-report-ui/pull/917)
30+
- Fixed the `Electron` menu functionality to be available before login. PR: [bfx-report-ui#907](https://github.com/bitfinexcom/bfx-report-ui/pull/907)
31+
1032
## [4.34.0] - 2025-03-26
1133

1234
### 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.0",
3+
"version": "4.34.1",
44
"repository": "https://github.com/bitfinexcom/bfx-report-electron",
55
"description": "Reporting tool",
66
"author": "bitfinex.com",

src/auto-updater/index.js

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const Alert = require('electron-alert')
1313
const yaml = require('js-yaml')
1414
const i18next = require('i18next')
1515

16+
const isMac = process.platform === 'darwin'
17+
1618
const log = require('../error-manager/log')
1719
const BfxMacUpdater = require('./bfx.mac.updater')
1820
const wins = require('../window-creators/windows')
@@ -77,6 +79,16 @@ const _sendProgress = (progress) => {
7779
progress
7880
)
7981
}
82+
const _sendUid = (alert) => {
83+
if (!alert?.uid) {
84+
return
85+
}
86+
87+
alert?.browserWindow?.webContents.send(
88+
'auto-update-toast:uid',
89+
alert.uid
90+
)
91+
}
8092

8193
const _fireToast = (
8294
opts = {},
@@ -113,12 +125,16 @@ const _fireToast = (
113125
})
114126
}
115127
const autoUpdateToastRepositionHandler = () => {
128+
const macOffset = wins.mainWindow?.isFullScreen()
129+
? 0
130+
: 28
131+
const heightOffset = isMac ? macOffset : 40
116132
const { x, y, width } = win.getContentBounds()
117133
const { width: alWidth } = alert.browserWindow.getContentBounds()
118134

119135
const boundsOpts = {
120136
x: (x + width) - alWidth,
121-
y,
137+
y: y + heightOffset,
122138
height
123139
}
124140

@@ -127,11 +143,11 @@ const _fireToast = (
127143

128144
const bwOptions = {
129145
frame: false,
130-
transparent: false,
146+
transparent: true,
131147
thickFrame: false,
132148
closable: false,
133149
hasShadow: false,
134-
backgroundColor: ThemeIpcChannelHandlers.getWindowBackgroundColor(),
150+
backgroundColor: ThemeIpcChannelHandlers.getWindowTitleBackgroundColor(),
135151
darkTheme: false,
136152
height,
137153
width: opts?.width ?? 1000,
@@ -185,11 +201,11 @@ const _fireToast = (
185201
didClose: () => {
186202
eventHandlerCtx.removeListener()
187203
ipcMain.removeListener(
188-
'auto-update-toast:width',
204+
`${alert.uid}auto-update-toast:width`,
189205
autoUpdateToastWidthHandler
190206
)
191207
ipcMain.removeListener(
192-
alert.uid + 'reposition',
208+
`${alert.uid}reposition`,
193209
autoUpdateToastRepositionHandler
194210
)
195211

@@ -206,8 +222,9 @@ const _fireToast = (
206222
sound
207223
)
208224

209-
ipcMain.on('auto-update-toast:width', autoUpdateToastWidthHandler)
210-
ipcMain.on(alert.uid + 'reposition', autoUpdateToastRepositionHandler)
225+
_sendUid(alert)
226+
ipcMain.on(`${alert.uid}auto-update-toast:width`, autoUpdateToastWidthHandler)
227+
ipcMain.on(`${alert.uid}reposition`, autoUpdateToastRepositionHandler)
211228

212229
return res
213230
}

src/auto-updater/toast-src/toast.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
html, body {
2-
background-color: var(--bgColor, #172d3e);
2+
background-color: var(--bgColor2, #0B1923);
33
}
44

55
.swal2-container.swal2-backdrop-show,
@@ -40,7 +40,7 @@ body.swal2-toast-shown .swal2-container {
4040
justify-content: space-between;
4141
align-items: center;
4242
box-sizing: content-box;
43-
background-color: var(--bgColor, #172d3e);
43+
background-color: var(--bgColor2, #0B1923);
4444
overflow: revert;
4545
}
4646

@@ -100,7 +100,7 @@ body.swal2-toast-shown .swal2-container {
100100

101101
.swal2-styled.swal2-cancel {
102102
border-radius: 2px;
103-
background-color: var(--bgColor, #172d3e);
103+
background-color: var(--bgColor2, #0B1923);
104104
border: 1px solid var(--borderColor, #334A59);
105105
color: var(--btnColor, #ffffff);
106106
box-shadow: none;

src/auto-updater/toast-src/toast.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
'use strict'
22

3+
const { ipcRenderer } = require('electron')
4+
let uid = ''
5+
6+
ipcRenderer.once('auto-update-toast:uid', (event, autoUpdateUid) => {
7+
uid = autoUpdateUid
8+
})
9+
310
window.addEventListener('load', () => {
411
try {
5-
const { ipcRenderer } = require('electron')
6-
712
const container = document.body
813
const processWrapper = document.createElement('div')
914
const htmlContainers = document.getElementsByClassName('swal2-popup')
@@ -64,7 +69,7 @@ window.addEventListener('load', () => {
6469
)
6570
}
6671

67-
ipcRenderer.send('auto-update-toast:width', { width })
72+
ipcRenderer.send(`${uid}auto-update-toast:width`, { width })
6873
} catch (err) {
6974
console.error(err)
7075
}

src/window-creators/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,10 @@ const createMainWindow = async ({
251251
: {
252252
titleBarOverlay: {
253253
height: 40,
254-
color: '#0b1923ff',
255-
symbolColor: '#fff'
254+
color: ThemeIpcChannelHandlers.getWindowTitleBackgroundColor(),
255+
symbolColor: ThemeIpcChannelHandlers.getWindowTitleBackgroundColor(
256+
{ isSymbolColor: true }
257+
)
256258
}
257259
}
258260
const titleBarOpts = showNativeTitleBar

src/window-creators/main-renderer-ipc-bridge/theme-ipc-channel-handlers.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const IpcChannelHandlers = require('./ipc.channel.handlers')
77
const { getConfigsKeeperByName } = require('../../configs-keeper')
88
const wins = require('../windows')
99
const isMainWinAvailable = require('../../helpers/is-main-win-available')
10+
const isMac = process.platform === 'darwin'
1011

1112
class ThemeIpcChannelHandlers extends IpcChannelHandlers {
1213
static channelName = 'theme'
@@ -22,6 +23,11 @@ class ThemeIpcChannelHandlers extends IpcChannelHandlers {
2223
DARK: '#172d3e'
2324
}
2425

26+
static WINDOW_TITLE_BACKGROUND_COLORS = {
27+
LIGHT: '#d8ecfb',
28+
DARK: '#0B1923'
29+
}
30+
2531
async setThemeHandler (event, args) {
2632
const {
2733
isSystemTheme,
@@ -68,6 +74,20 @@ class ThemeIpcChannelHandlers extends IpcChannelHandlers {
6874
return this.WINDOW_BACKGROUND_COLORS.LIGHT
6975
}
7076

77+
static getWindowTitleBackgroundColor (opts) {
78+
const { isSymbolColor } = opts ?? {}
79+
80+
if (nativeTheme.shouldUseDarkColors) {
81+
return isSymbolColor
82+
? this.WINDOW_TITLE_BACKGROUND_COLORS.LIGHT
83+
: this.WINDOW_TITLE_BACKGROUND_COLORS.DARK
84+
}
85+
86+
return isSymbolColor
87+
? this.WINDOW_TITLE_BACKGROUND_COLORS.DARK
88+
: this.WINDOW_TITLE_BACKGROUND_COLORS.LIGHT
89+
}
90+
7191
static isThemeAllowed (theme) {
7292
return Object.values(this.THEME_SOURCES)
7393
.some((item) => item === theme)
@@ -79,6 +99,10 @@ class ThemeIpcChannelHandlers extends IpcChannelHandlers {
7999
: this.THEME_SOURCES.SYSTEM
80100

81101
const winBgColor = this.getWindowBackgroundColor()
102+
const winTitleBgColor = this.getWindowTitleBackgroundColor()
103+
const winTitleSymbolColor = this.getWindowTitleBackgroundColor(
104+
{ isSymbolColor: true }
105+
)
82106

83107
for (const win of Object.values(wins)) {
84108
if (!isMainWinAvailable(win)) {
@@ -87,6 +111,15 @@ class ThemeIpcChannelHandlers extends IpcChannelHandlers {
87111

88112
win.setBackgroundColor(winBgColor)
89113
}
114+
115+
if (isMac) {
116+
return
117+
}
118+
119+
wins?.mainWindow?.setTitleBarOverlay({
120+
color: winTitleBgColor,
121+
symbolColor: winTitleSymbolColor
122+
})
90123
}
91124

92125
async #saveTheme (theme) {

0 commit comments

Comments
 (0)