Skip to content

Commit

Permalink
Merge branch 'develop' into feature/1897-psk
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiM committed Oct 31, 2023
2 parents 3e1f0f3 + 0622c93 commit 68b4139
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 123 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/desktop-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
# 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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
os: [ubuntu-latest-m]

timeout-minutes: 180

Expand Down Expand Up @@ -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
command: cd packages/e2e-tests && npm run test backwardsCompatibility.test.ts
8 changes: 4 additions & 4 deletions .github/workflows/e2e-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -106,4 +106,4 @@ jobs:
timeout_minutes: 25
max_attempts: 3
shell: bash
command: cd packages/e2e-tests && npm run test invitationLink.test.ts
command: cd packages/e2e-tests && npm run test invitationLink.test.ts
6 changes: 3 additions & 3 deletions .github/workflows/mobile-deploy-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy Android to Google Play

on:
release:
types:
types:
[prereleased, released]

jobs:
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
with:
ndk-version: r21e
add-to-path: false

- name: "Setup environment"
uses: ./.github/actions/setup-env
with:
Expand Down Expand Up @@ -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/[email protected]
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,23 +269,6 @@ export const ChannelInputComponent: React.FC<ChannelInputProps> = ({
}
}

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<HTMLTextAreaElement>) => {
if (inputState === INPUT_STATE.AVAILABLE) {
Expand All @@ -303,57 +286,6 @@ export const ChannelInputComponent: React.FC<ChannelInputProps> = ({

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
Expand Down

0 comments on commit 68b4139

Please sign in to comment.