diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 44822900ff..84e6c79ab5 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -205,51 +205,6 @@ jobs: with: source-path: win32 - #E2E - Start - # - name: E2E - electron-builder - # env: - # CERTIFICATE_PATH: ${{ steps.write_file.outputs.filePath }} - # WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} - # WINDOWS_ALIAS: ${{ secrets.WIN_ALIAS }} - # working-directory: ./packages/desktop - # run: node_modules/.bin/electron-builder --win - # shell: bash - - # - name: E2E - Extract version - # id: extract_version - # uses: Saionaro/extract-package-version@v1.2.1 - # with: - # path: packages/desktop - - # - name: E2E - FILE_NAME env - # working-directory: ./packages/desktop/dist - # run: echo "FILE_NAME=Quiet Setup ${{ steps.extract_version.outputs.version }}.exe" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - # shell: powershell - - # - name: E2E - Chmod - # working-directory: ./packages/desktop/dist - # run: chmod +x "$FILE_NAME" - # shell: bash - - # - name: E2E - Install exe - # run: Start-Process "Quiet Setup ${{ steps.extract_version.outputs.version }}.exe" -Wait - # working-directory: ./packages/desktop/dist - # shell: powershell - - # - name: E2E - Kill exe - # run: Stop-Process -Name "Quiet" -Force - # working-directory: ./packages/desktop/dist - # shell: powershell - - # - name: E2E - Run smoke test - # uses: nick-fields/retry@v2 - # with: - # timeout_minutes: 25 - # max_attempts: 3 - # shell: bash - # command: cd packages/e2e-tests && npm run test smoke.crossplatform.test.ts - #E2E - End - - name: "Set electron-builder props" shell: bash run: echo "ELECTRON_BUILDER_PROPS=-c.publish.bucket=$S3_BUCKET" >> $GITHUB_ENV diff --git a/.github/workflows/e2e-linux.yml b/.github/workflows/e2e-linux.yml index 3e957e1fe7..2ed3a4995e 100644 --- a/.github/workflows/e2e-linux.yml +++ b/.github/workflows/e2e-linux.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-latest-m] timeout-minutes: 180 @@ -74,10 +74,10 @@ jobs: - name: Chmod App Image 1.2.0 working-directory: ./packages/e2e-tests/Quiet run: chmod +x Quiet-1.2.0.AppImage - + - name: Run Backwards Compatibility test uses: nick-fields/retry@v2 with: timeout_minutes: 15 max_attempts: 3 - command: cd packages/e2e-tests && npm run test backwardsCompatibility.test.ts \ No newline at end of file + command: cd packages/e2e-tests && npm run test backwardsCompatibility.test.ts diff --git a/.github/workflows/e2e-win.yml b/.github/workflows/e2e-win.yml index 8a8b0fd498..9f614ca00f 100644 --- a/.github/workflows/e2e-win.yml +++ b/.github/workflows/e2e-win.yml @@ -3,8 +3,8 @@ name: E2E Windows on: [workflow_call] jobs: windows: - runs-on: windows-2019 - + runs-on: windows-latest-l + timeout-minutes: 180 env: @@ -36,7 +36,7 @@ jobs: - name: electron-builder working-directory: ./packages/desktop - run: node_modules/.bin/electron-builder --win + run: node_modules/.bin/electron-builder --win shell: bash - name: Extract version @@ -106,4 +106,4 @@ jobs: timeout_minutes: 25 max_attempts: 3 shell: bash - command: cd packages/e2e-tests && npm run test invitationLink.test.ts \ No newline at end of file + command: cd packages/e2e-tests && npm run test invitationLink.test.ts diff --git a/.github/workflows/mobile-deploy-android.yaml b/.github/workflows/mobile-deploy-android.yaml index 8ecd603c97..ccb0aed4ee 100644 --- a/.github/workflows/mobile-deploy-android.yaml +++ b/.github/workflows/mobile-deploy-android.yaml @@ -2,7 +2,7 @@ name: Deploy Android to Google Play on: release: - types: + types: [prereleased, released] jobs: @@ -34,7 +34,7 @@ jobs: with: ndk-version: r21e add-to-path: false - + - name: "Setup environment" uses: ./.github/actions/setup-env with: @@ -77,7 +77,7 @@ jobs: mkdir -p distribution/whatsnew git log -1 --pretty=format:%s > distribution/whatsnew/whatsnew-pl-PL echo ${{ SECRETS.SERVICE_ACCOUNT_JSON }} | base64 --decode > google-play.json - + - name: "Upload to Google Play" uses: r0adkll/upload-google-play@v1.1.2 with: diff --git a/packages/desktop/src/renderer/components/widgets/channels/ChannelInput/ChannelInput.tsx b/packages/desktop/src/renderer/components/widgets/channels/ChannelInput/ChannelInput.tsx index 35b46473f1..7f5d2d2aac 100644 --- a/packages/desktop/src/renderer/components/widgets/channels/ChannelInput/ChannelInput.tsx +++ b/packages/desktop/src/renderer/components/widgets/channels/ChannelInput/ChannelInput.tsx @@ -269,23 +269,6 @@ export const ChannelInputComponent: React.FC = ({ } } - const caretLineTraversal = (focusLine: Node | null | undefined, anchorLinePosition = 0) => { - if (!focusLine?.nodeValue) return - // Create an empty range - const range = document.createRange() - // Set the focusLineLength - // Make it zero if between newlines - const focusLineLength = focusLine?.nodeValue?.length || 0 - // Set the range start to the position on the anchor line - // or the focus line length, whichever is shorter - range.setStart(focusLine, anchorLinePosition < focusLineLength ? anchorLinePosition : focusLineLength) - // Remove the range from the anchor line - const selection = window.getSelection() - selection?.removeAllRanges() - // and set it to the focus line - selection?.addRange(range) - } - const onChangeCb = useCallback( (e: React.ChangeEvent) => { if (inputState === INPUT_STATE.AVAILABLE) { @@ -303,57 +286,6 @@ export const ChannelInputComponent: React.FC = ({ const onKeyDownCb = useCallback( (e: React.KeyboardEvent) => { - if (e.key === 'ArrowDown') { - const anchorNode: Node | null | undefined = window?.getSelection()?.anchorNode - - // If the current line is empty, go directly to the next node. - let nextNode: Node | null | undefined = null - if (anchorNode?.nodeValue === null || anchorNode?.nodeValue === '\n') { - nextNode = anchorNode?.nextSibling - } else { - // Otherwise skip the break node at the end of the current line. - nextNode = anchorNode?.nextSibling?.nextSibling - } - // If we're on the bottom line, go to the end - if (!nextNode) { - const endOfNode = anchorNode?.nodeValue?.length || anchorNode?.textContent?.length - caretLineTraversal(anchorNode, endOfNode) - return - } - // If the next line is empty, go the beginning - if (nextNode.nodeValue === null || nextNode.nodeValue === '\n') { - caretLineTraversal(nextNode, 0) - return - } - caretLineTraversal(nextNode, window?.getSelection()?.anchorOffset) - } - if (e.key === 'ArrowUp') { - const anchorNode = window?.getSelection()?.anchorNode - - // If pervious line is empty, go directly to it - let previousNode: Node | null | undefined = null - if ( - anchorNode?.previousSibling?.previousSibling?.nodeValue === null || - anchorNode?.previousSibling?.previousSibling?.nodeValue === '\n' - ) { - previousNode = anchorNode?.previousSibling - } else { - // Otherwise skip the break node at the end of the previous line - previousNode = anchorNode?.previousSibling?.previousSibling - } - // If we're on the top line, go to the beginning - if (!previousNode) { - caretLineTraversal(anchorNode, 0) - return - } - // If previous line is empty, go to the beginning - if (previousNode.nodeValue === null || previousNode.nodeValue === '\n') { - caretLineTraversal(previousNode, 0) - return - } - caretLineTraversal(previousNode, window?.getSelection()?.anchorOffset) - } - if (e.nativeEvent.key === 'Enter') { if (e.shiftKey) { // Accept this input for additional lines in the message box