Skip to content

Commit

Permalink
release-3.24 (#4884)
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflorian authored Mar 29, 2021
2 parents 8bc4337 + dd59c14 commit ea658a3
Show file tree
Hide file tree
Showing 18 changed files with 326 additions and 278 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.5.0
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ secrets.OTTO_THE_BOT_GH_TOKEN }}
access_token: ${{github.token}}
- name: Checkout repository
uses: actions/checkout@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/download_translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
uses: actions/checkout@v2

- name: Download translations
uses: crowdin/github-action@1.0.9
uses: crowdin/github-action@1.1.0
env:
GITHUB_TOKEN: ${{ secrets.OTTO_THE_BOT_GH_TOKEN }}
GITHUB_TOKEN: ${{secrets.OTTO_THE_BOT_GH_TOKEN}}
CROWDIN_PROJECT_ID: 342373
with:
upload_sources: false
Expand All @@ -28,7 +28,7 @@ jobs:
localization_branch_name: 'chore/update-translations'
create_pull_request: true
pull_request_title: 'chore: Update translations'
token: ${{ secrets.CROWDIN_TOKEN }}
token: ${{secrets.CROWDIN_TOKEN}}
source: '/electron/locale/en-US.json'
translation: '/electron/locale/%locale%.json'
base_path: '.'
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
steps:
- uses: srvaroa/[email protected]
env:
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
GITHUB_TOKEN: ${{secrets.OTTO_THE_BOT_GH_TOKEN}}
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Cross platform desktop app, wrapping the [wire-webapp](https://github.com/wireap

### Prerequisites

- [Node.js](https://nodejs.org/)
- [Node.js](https://nodejs.org/) >= 10
- Git

### Clone
Expand Down Expand Up @@ -54,6 +54,11 @@ yarn test
| 3 (Internal release) | [staging](https://github.com/wireapp/wire-desktop/tree/staging) | merge (don't squash) from [dev](https://github.com/wireapp/wire-desktop/tree/dev) | x.y+1 (e.g. 3.18) |
| 4 (Production release) | [main](https://github.com/wireapp/wire-desktop/tree/main) | merge (don't squash) from [staging](https://github.com/wireapp/wire-desktop/tree/staging) | x.y (e.g. 3.17) |

**Compare Views**

1. Updates from "dev" to "staging" (changelog): https://github.com/wireapp/wire-desktop/compare/staging...dev
1. Updates from "staging" to "main" (changelog): https://github.com/wireapp/wire-desktop/compare/main...staging

### Tasks

```shell
Expand Down
2 changes: 1 addition & 1 deletion electron/locale/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"wrapperLogOut": "Abmelden",
"wrapperManageTeam": "Team verwalten",
"wrapperRemoveAccount": "Konto entfernen",
"menuEnableSpellChecking": "Rechtschreibprüfung Aktivieren",
"menuEnableSpellChecking": "Rechtschreibprüfung aktivieren",
"menuCopyPicture": "Bild kopieren",
"menuActualSize": "Originalgröße",
"menuZoomIn": "Vergrößern",
Expand Down
6 changes: 3 additions & 3 deletions electron/locale/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"menuVideoCall": "ビデオ通話",
"menuView": "ビュー",
"menuWindow": "ウィンドウ",
"noInternet": "No Internet",
"noInternet": "インターネットに接続されていません",
"proxyPromptHeadline": "プロキシ認証のためにユーザー名とパスワードが必要です。",
"proxyPromptPassword": "パスワード",
"proxyPromptTitle": "プロキシ認証",
Expand All @@ -89,8 +89,8 @@
"wrapperManageTeam": "チームを管理する",
"wrapperRemoveAccount": "アカウントを削除",
"menuEnableSpellChecking": "スペルチェックを有効にする",
"menuCopyPicture": "Copy Picture",
"menuActualSize": "Actual Size",
"menuCopyPicture": "画像をコピー",
"menuActualSize": "元のサイズ",
"menuZoomIn": "ズームイン",
"menuZoomOut": "ズームアウト",
"wrapperAddAccountErrorTitlePlural": "{{maximumAccounts}} accounts already active",
Expand Down
4 changes: 2 additions & 2 deletions electron/locale/si-LK.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"menuServices": "සේවාවන්",
"menuSettings": "සැකසුම්",
"menuShowAll": "සියල්ල පෙන්වන්න",
"menuShowHide": "මෙනුව පෙන්වන්න",
"menuShowHide": "Show Menu",
"menuSignOut": "නික්මෙන්න",
"menuStart": "ආරම්භ කරන්න",
"menuStartup": "ආරම්භයේදී {brandName} දියත් කරන්න",
Expand Down Expand Up @@ -101,5 +101,5 @@
"promptCancel": "අවලංගු කරන්න",
"promptWarning": "අවවාදයයි!",
"promptError": "දෝෂය",
"urlBlockedPromptText": "අනාරක්ෂිත වෙබ් ලිපිනයක් (URL) අවහිර කර ඇත. ඔබට තවමත් එය විවෘත කිරීමට අවශ්‍ය නම්, එය පිටපත් කර සුදුසු මෘදුකාංගයක් හරහා විවෘත කරන්න."
"urlBlockedPromptText": "අනාරක්ෂිත ඒ.ස.නි. (URL) අවහිර කර ඇත. ඔබට තවමත් එය විවෘත කිරීමට අවශ්‍ය නම්, එය පිටපත් කර සුදුසු මෘදුකාංගයක් හරහා විවෘත කරන්න."
}
2 changes: 1 addition & 1 deletion electron/locale/uk-UA.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"menuVideoCall": "Відеодзвінок",
"menuView": "Вигляд",
"menuWindow": "Вікно",
"noInternet": "No Internet",
"noInternet": "Відсутнє підключення до інтернету",
"proxyPromptHeadline": "Проксі-сервер вимагає аутентифікацію з ім'ям користувача і паролем.",
"proxyPromptPassword": "Пароль",
"proxyPromptTitle": "Аутентифікація на проксі-сервері",
Expand Down
4 changes: 1 addition & 3 deletions electron/src/lib/eventType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,8 @@ export const EVENT_TYPE = {
NAVIGATE_WEBVIEW: 'EVENT_TYPE.WRAPPER.NAVIGATE_WEBVIEW',
RELAUNCH: 'EVENT_TYPE.WRAPPER.RELAUNCH',
RELOAD: 'EVENT_TYPE.WRAPPER.RELOAD',
SET_ZOOM_LEVEL: 'EVENT_TYPE.WRAPPER.SET_ZOOM_LEVEL',
UPDATE: 'EVENT_TYPE.WRAPPER.UPDATE',
UPDATE_AVAILABLE: 'EVENT_TYPE.WRAPPER.UPDATE_AVAILABLE',
ZOOM_IN: 'EVENT_TYPE.WRAPPER.ZOOM_IN',
ZOOM_OUT: 'EVENT_TYPE.WRAPPER.ZOOM_OUT',
ZOOM_RESET: 'EVENT_TYPE.WRAPPER.ZOOM_RESET',
},
};
21 changes: 21 additions & 0 deletions electron/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,24 @@ Object.entries(config).forEach(([key, value]) => {
// Squirrel setup
app.setAppUserModelId(`com.squirrel.wire.${config.name.toLowerCase()}`);

try {
logger.info('GPUFeatureStatus:', app.getGPUFeatureStatus());
const has2dCanvas = app.getGPUFeatureStatus()?.['2d_canvas']?.startsWith('enabled');

if (!has2dCanvas) {
/*
* If the 2D canvas is unavailable, and we rely on hardware acceleartion,
* Electron can't render anything and will only display a white screen. Thus
* we disable hardware acceleration completely.
*/
logger.warn('2D canvas unavailable, disabling hardware acceleration');
app.disableHardwareAcceleration();
}
} catch (error) {
logger.warn(`Can't read GPUFeatureStatus, disabling hardware acceleration`);
app.disableHardwareAcceleration();
}

// IPC events
const bindIpcEvents = (): void => {
ipcMain.on(EVENT_TYPE.ACTION.SAVE_PICTURE, (_event, bytes: Uint8Array, timestamp?: string) => {
Expand Down Expand Up @@ -192,6 +210,7 @@ const initWindowStateKeeper = (): windowStateKeeper.State => {
// App Windows
const showMainWindow = async (mainWindowState: windowStateKeeper.State): Promise<void> => {
const showMenuBar = settings.restore(SettingsType.SHOW_MENU_BAR, true);
const zoomFactor = settings.restore(SettingsType.ZOOM_FACTOR, 1.0);

const options: BrowserWindowConstructorOptions = {
autoHideMenuBar: !showMenuBar,
Expand Down Expand Up @@ -315,6 +334,8 @@ const showMainWindow = async (mainWindowState: windowStateKeeper.State): Promise
}
});

main.webContents.setZoomFactor(zoomFactor);

const mainURL = new URL(fileUrl(INDEX_HTML));
mainURL.searchParams.set('env', encodeURIComponent(webappURL.href));
mainURL.searchParams.set('focus', String(!startHidden));
Expand Down
18 changes: 9 additions & 9 deletions electron/src/menu/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {SettingsType} from '../settings/SettingsType';
import {WindowManager} from '../window/WindowManager';
import {downloadLogs} from '../lib/download';
import {zipFiles, createFile} from '../lib/zip';
import * as WindowUtil from '../window/WindowUtil';
import {ZOOM_DIRECTION, openExternal, zoomWindow} from '../window/WindowUtil';

const launchCmd = process.env.APPIMAGE || process.execPath;

Expand Down Expand Up @@ -250,19 +250,19 @@ const windowTemplate: MenuItemConstructorOptions = {
accelerator: 'CmdOrCtrl+0',
// we are using a manual implementation for all zoom actions (and not roles)
// since the native behavior would be to only zoom into the webview, not the whole page.
click: (_menuItem, browserWindow) => browserWindow?.webContents.send(EVENT_TYPE.WRAPPER.ZOOM_RESET),
click: (_menuItem, browserWindow) => zoomWindow(ZOOM_DIRECTION.RESET, browserWindow),
label: locale.getText('menuActualSize'),
},
{
// `Ctrl+Plus` does not actually trigger `+` while `Ctrl+=` does.
// See https://github.com/electron/electron/issues/1507#issuecomment-118424331.
accelerator: 'CmdOrCtrl+=',
click: (_menuItem, browserWindow) => browserWindow?.webContents.send(EVENT_TYPE.WRAPPER.ZOOM_IN),
click: (_menuItem, browserWindow) => zoomWindow(ZOOM_DIRECTION.IN, browserWindow),
label: locale.getText('menuZoomIn'),
},
{
accelerator: 'CmdOrCtrl+-',
click: (_menuItem, browserWindow) => browserWindow?.webContents.send(EVENT_TYPE.WRAPPER.ZOOM_OUT),
click: (_menuItem, browserWindow) => zoomWindow(ZOOM_DIRECTION.OUT, browserWindow),
label: locale.getText('menuZoomOut'),
},
],
Expand All @@ -283,23 +283,23 @@ const helpTemplate: MenuItemConstructorOptions = {
role: 'help',
submenu: [
{
click: () => WindowUtil.openExternal(config.legalUrl, true),
click: () => openExternal(config.legalUrl, true),
label: locale.getText('menuLegal'),
},
{
click: () => WindowUtil.openExternal(config.privacyUrl, true),
click: () => openExternal(config.privacyUrl, true),
label: locale.getText('menuPrivacy'),
},
{
click: () => WindowUtil.openExternal(config.licensesUrl, true),
click: () => openExternal(config.licensesUrl, true),
label: locale.getText('menuLicense'),
},
{
click: () => WindowUtil.openExternal(config.supportUrl, true),
click: () => openExternal(config.supportUrl, true),
label: locale.getText('menuSupport'),
},
{
click: () => WindowUtil.openExternal(EnvironmentUtil.web.getWebsiteUrl(), true),
click: () => openExternal(EnvironmentUtil.web.getWebsiteUrl(), true),
label: locale.getText('menuAppURL'),
},
downloadLogsTemplate,
Expand Down
20 changes: 0 additions & 20 deletions electron/src/preload/preload-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {AutomatedSingleSignOn} from '../sso/AutomatedSingleSignOn';

const logger = getLogger(path.basename(__filename));

webFrame.setZoomFactor(1.0);
webFrame.setVisualZoomLevelLimits(1, 1);

window.locStrings = locale.LANGUAGES[locale.getCurrent()];
Expand Down Expand Up @@ -73,25 +72,6 @@ const subscribeToMainProcessEvents = (): void => {
ipcRenderer.on(EVENT_TYPE.ACTION.SWITCH_ACCOUNT, (event, accountIndex: number) => {
window.dispatchEvent(new CustomEvent(EVENT_TYPE.ACTION.SWITCH_ACCOUNT, {detail: {accountIndex}}));
});

ipcRenderer.on(EVENT_TYPE.WRAPPER.ZOOM_IN, () => {
logger.info(`Received event "${EVENT_TYPE.WRAPPER.ZOOM_IN}", zooming in ...`);
const currentZoomFactor = webFrame.getZoomFactor();
const newZoomFactor = Math.min(currentZoomFactor + 0.1, 2.0);
webFrame.setZoomFactor(newZoomFactor);
});

ipcRenderer.on(EVENT_TYPE.WRAPPER.ZOOM_OUT, () => {
logger.info(`Received event "${EVENT_TYPE.WRAPPER.ZOOM_OUT}", zooming out ...`);
const currentZoomFactor = webFrame.getZoomFactor();
const newZoomFactor = Math.max(currentZoomFactor - 0.1, 0.5);
webFrame.setZoomFactor(newZoomFactor);
});

ipcRenderer.on(EVENT_TYPE.WRAPPER.ZOOM_RESET, () => {
logger.info(`Received event "${EVENT_TYPE.WRAPPER.ZOOM_RESET}", resetting zoom ...`);
webFrame.setZoomFactor(1.0);
});
};

const setupIpcInterface = (): void => {
Expand Down
15 changes: 9 additions & 6 deletions electron/src/preload/preload-webview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ const nativeTheme = remote.nativeTheme;
const logger = getLogger(path.basename(__filename));

function subscribeToThemeChange(): void {
if (WebAppEvents.PROPERTIES.UPDATE.INTERFACE) {
nativeTheme.on('updated', () => {
const shouldUseDarkMode = nativeTheme.shouldUseDarkColors;
window.amplify.publish(WebAppEvents.PROPERTIES.UPDATE.INTERFACE.USE_DARK_MODE, shouldUseDarkMode);
});
}
const updateWebAppTheme = (): void => {
if (WebAppEvents.PROPERTIES.UPDATE.INTERFACE) {
const useDarkMode = nativeTheme.shouldUseDarkColors;
window.amplify.publish(WebAppEvents.PROPERTIES.UPDATE.INTERFACE.USE_DARK_MODE, useDarkMode);
}
};

updateWebAppTheme();
nativeTheme.on('updated', () => updateWebAppTheme());
}

webFrame.setZoomFactor(1.0);
Expand Down
1 change: 1 addition & 0 deletions electron/src/settings/SettingsType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ export enum SettingsType {
LOCALE = 'locale',
SHOW_MENU_BAR = 'showMenu',
WINDOW_BOUNDS = 'bounds',
ZOOM_FACTOR = 'zoomFactor',
}
28 changes: 28 additions & 0 deletions electron/src/window/WindowUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import {getLogger} from '../logging/getLogger';
import {showWarningDialog} from '../lib/showDialog';
import * as locale from '../locale/locale';
import {config} from '../settings/config';
import {settings} from '../settings/ConfigurationPersistence';
import {SettingsType} from '../settings/SettingsType';

const logger = getLogger(path.basename(__filename));

Expand All @@ -35,6 +37,12 @@ interface Rectangle {
y: number;
}

export enum ZOOM_DIRECTION {
IN = 'IN',
OUT = 'OUT',
RESET = 'RESET',
}

export const pointInRectangle = (point: [number, number], rectangle: Rectangle): boolean => {
const [xCoordinate, yCoordinate] = point;
const xInRange = xCoordinate >= rectangle.x && xCoordinate <= rectangle.x + rectangle.width;
Expand Down Expand Up @@ -77,3 +85,23 @@ export const openExternal = async (url: string, httpsOnly: boolean = false): Pro
logger.error(error);
}
};

export const zoomWindow = (direction: ZOOM_DIRECTION, browserWindow?: BrowserWindow): void => {
let newZoomFactor = 1.0;

switch (direction) {
case ZOOM_DIRECTION.IN: {
const currentZoomFactor = browserWindow?.webContents.getZoomFactor() || 1.0;
newZoomFactor = Math.min(currentZoomFactor + 0.1, 2.0);
break;
}
case ZOOM_DIRECTION.OUT: {
const currentZoomFactor = browserWindow?.webContents.getZoomFactor() || 1.0;
newZoomFactor = Math.max(currentZoomFactor - 0.1, 0.5);
break;
}
}

browserWindow?.webContents.setZoomFactor(newZoomFactor);
settings.save(SettingsType.ZOOM_FACTOR, newZoomFactor);
};
2 changes: 1 addition & 1 deletion electron/wire.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"privacyUrl": "https://wire.com/privacy/",
"supportUrl": "https://support.wire.com",
"updateUrl": "https://wire-app.wire.com/win/prod/",
"version": "3.23.0",
"version": "3.24.0",
"websiteUrl": "https://wire.com"
}
Loading

0 comments on commit ea658a3

Please sign in to comment.