Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #419 keyboard shortcuts with different language layouts #438

Open
wants to merge 71 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
a7e4f2f
WIP: Adding layout dims to payload and restoring on connection
eyal-sasson Aug 30, 2023
85ccc36
Fixing mouse selection with scaled terminal
eyal-sasson Aug 31, 2023
bf6c7a1
WIP: Adding layout sync
eyal-sasson Aug 31, 2023
49f63b3
WIP: Fixing window focus on layout update
eyal-sasson Aug 31, 2023
88872c5
WIP: Syncing layouts
daonb Aug 31, 2023
c01bfc5
Fixing the offline indicator
daonb Sep 3, 2023
539e6d5
WIP: Imprving layout sync
daonb Sep 3, 2023
8e4aaac
WIP: Syncing is almost there
daonb Sep 4, 2023
0305e9a
Fixing gate's send state and font size
daonb Sep 4, 2023
886aaa9
Fixing nack handling
daonb Sep 4, 2023
3683c47
WIP: Adding a 'Fit my screen' resize option
daonb Sep 4, 2023
c82c377
Improving messaging on web version
daonb Sep 5, 2023
853276c
Adding PeerBook status on the map
daonb Sep 5, 2023
df10316
Removing redundent set_payload messages
daonb Sep 6, 2023
065f7d7
Fixing fit screen mode
daonb Sep 6, 2023
e19996f
Fixing the peerbook spinner
daonb Sep 6, 2023
7339329
Linting
daonb Sep 6, 2023
29f9ba2
Fixing the version display
daonb Sep 5, 2023
f36cd62
Fixing the tests - new menu option to consider
daonb Sep 7, 2023
53a9b5b
Fixing the PeerBook spinner
daonb Sep 7, 2023
a0d7b9f
Revert "Fixing the tests - new menu option to consider"
daonb Sep 7, 2023
c2ef913
Improving the welcome message
daonb Sep 7, 2023
6c4a877
Owning the screen on resize
daonb Sep 7, 2023
5adb77a
Fixing the reset and its tests
daonb Sep 7, 2023
6925fd9
Fixing screen scaling on larger screens
daonb Sep 7, 2023
1775dee
Releasing 1.8
daonb Sep 7, 2023
053ebb7
WIP: Improving tests
daonb Sep 7, 2023
d3ab027
Fixing webexec's docker entry
daonb Sep 10, 2023
87f6123
Marking a test more stable
daonb Sep 10, 2023
f4cd1de
Improving the suport command
daonb Sep 10, 2023
cb4b593
Upgrading build
daonb Sep 10, 2023
e1d6631
Fixing map links and version click
daonb Sep 10, 2023
23d9091
Improving support command text
daonb Sep 10, 2023
b7e670c
Replacing a ned font with an emoji
daonb Sep 10, 2023
d7ebbce
Improving messages
daonb Sep 11, 2023
8665d97
Fixing peerbook ws legend
daonb Sep 11, 2023
acc7d5e
Removing a double doubble TWR message
daonb Sep 12, 2023
dc04fa2
Releasing 1.8.0
daonb Sep 12, 2023
f0b8f8e
Updating the canned actions
daonb Sep 12, 2023
7128ad3
Updating the test workflow
daonb Sep 12, 2023
1387e32
Moving the workflows to latest node
daonb Sep 12, 2023
bc43127
Polishing PeerBook status indicator
daonb Sep 12, 2023
b624af6
Upgrading the the latest pruchases-capacitor
daonb Sep 14, 2023
d724b4c
Releasing 1.8.1
daonb Sep 14, 2023
6f6e13a
Releasing 1.8.1 for the android
daonb Sep 20, 2023
6e79d2c
Polishing
daonb Sep 20, 2023
9815b65
#417 Fixing the issue when switching from a zoomed tab
DmitryPorotov Sep 26, 2023
006b622
removed ;
DmitryPorotov Sep 26, 2023
ffe499e
Running validate workflow on pull requesr
daonb Sep 27, 2023
8077a4b
switch everything to TypeScript
DmitryPorotov Sep 26, 2023
fcecc52
switch everything to TS, removed KEY_CODES usage left by mistake
DmitryPorotov Sep 27, 2023
e1bc3ef
fixed lint complaints
DmitryPorotov Oct 1, 2023
ec25895
added types to src/ directory, moved some methods from cell to pane, …
DmitryPorotov Oct 4, 2023
79abd95
added eslintrc.cjs to enable @ts-ignore
DmitryPorotov Oct 4, 2023
4c27a4e
added eslintrc.cjs to enable @ts-ignore, for real now
DmitryPorotov Oct 4, 2023
a66a97f
removed eslint warning for empty code blocks
DmitryPorotov Oct 4, 2023
6ad89e3
fixes on Benny's comments
DmitryPorotov Oct 5, 2023
10ecb78
removed import of terminal7 in commands.ts
DmitryPorotov Oct 5, 2023
26a3b34
split a type casting into 2 lines, added await in some places
DmitryPorotov Oct 5, 2023
d629ccc
split one more type cast
DmitryPorotov Oct 5, 2023
c3c8007
fixes on comments from github
DmitryPorotov Oct 11, 2023
b827e81
using global terminal7 instead of this.t7
DmitryPorotov Oct 12, 2023
6b30a9c
Upgrading purchases version and CI's node version
daonb Oct 18, 2023
bf40b17
Setting node verstion to 20.8.1
daonb Oct 18, 2023
7e3cb14
Bump @babel/traverse from 7.22.15 to 7.23.2
dependabot[bot] Oct 18, 2023
189be30
Improving fit by sending rows&cols (#430)
DmitryPorotov Oct 30, 2023
51e9b34
Bump postcss from 8.4.29 to 8.4.31
dependabot[bot] Oct 8, 2023
3fca15b
Bump get-func-name from 2.0.0 to 2.0.2
dependabot[bot] Sep 27, 2023
244b3a5
Adding greggman/virtual-webgl to support more panes (#432)
DmitryPorotov Oct 30, 2023
3f70385
Adding html titles (tooltips) to buttons for mouse users (#425)
DmitryPorotov Nov 1, 2023
68394d3
fixes #419 keyboard shortcuts with different language layouts
DmitryPorotov Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* eslint-env node */
module.exports = {
extends: ['plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
root: true,
rules: {
"@typescript-eslint/ban-ts-comment": "off"
}
};
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Node setup
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16
node-version: latest
- name: Install yarn
run: npm install --global yarn
- name: Install dependecies
Expand All @@ -31,7 +31,10 @@ jobs:
- name: Unit Tests
run: yarn test
- name: Acceptance Tests
run: PEERBOOK_REF="${{ github.event.inputs.pbRef }}" WEBEXEC_REF="${{ github.event.inputs.weRef }}" bash -x aatp/run
run: >
PEERBOOK_REF="${{ github.event.inputs.pbRef }}"
WEBEXEC_REF="${{ github.event.inputs.weRef }}"
bash -x aatp/run
- name: Upload acceptance test results
if: ${{ failure() }}
uses: actions/upload-artifact@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Validate

on: push
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Node setup
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20.8.1
- name: Install yarn
run: npm install --global yarn
- name: Install dependecies
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ aatp/**/authorized_fingerprints

# Local Netlify folder
.netlify

# idea
.idea/
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.8.1] - 2023/9/14

### Fixed

- PeerBook status indicator is always an emoji, no kanji chars

## [1.8.0] - 2023/9/10

### Added

- dashed underline to link on the map - just like in TWR
- Progressive Web App support
- synchronizing layout across all connected client
- the login command for web clients
- peerbook spinner and indicator

## 1.7.1 - 2023/8/27

### Fixed
Expand Down
7 changes: 7 additions & 0 deletions __mocks__/@revenuecat/purchases-capacitor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { vi } from "vitest"

export const configure = vi.fn().mockResolvedValue(undefined);
export const setMockWebResults = vi.fn().mockResolvedValue(undefined);
export const getOfferings = vi.fn().mockResolvedValue({ offerings: [] });
export const getProducts = vi.fn().mockResolvedValue({ products: [] });
// ...mock other methods as needed
17 changes: 17 additions & 0 deletions __mocks__/xterm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ export class Terminal {
}
element = {
addEventListener: vi.fn(),
parentElement: {
clientHeight: 480,
clientWidth: 640
}
}
constructor (props) {
this.out = ""
Expand Down Expand Up @@ -62,5 +66,18 @@ export class Terminal {
const ev = new KeyboardEvent("keydown", { key })
this.keyHandler( { domEvent: ev } )
}
resize:(columns: number, rows: number) => void = vi.fn();
_core = {
_renderService: {
dimensions: {
css: {
cell: {
width: 5,
height: 11
}
}
}
}
}
}

6 changes: 3 additions & 3 deletions aatp/http_webrtc/http_webrtc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ pinch_max_y_velocity = 0.1`
await page.screenshot({ path: `/result/2.png` })
await expect(page.locator('.pane')).toHaveCount(2)
})
test('a pane can be close', async() => {
sleep(500)
test('a pane can be closed', async() => {
await sleep(500)
const exitState = await page.evaluate(() => {
try {
window.terminal7.activeG.activeW.activeP.d.send("exit\n")
Expand All @@ -120,7 +120,7 @@ pinch_max_y_velocity = 0.1`
await page.screenshot({ path: `/result/second.png` })
const lines = await page.evaluate(() =>
window.terminal7.activeG.activeW.activeP.t.buffer.active.length)
expect(lines).toEqual(38)
await expect(lines).toEqual(38)
await page.evaluate(async() => {
const gate = window.terminal7.activeG
gate.disengage().then(() => {
Expand Down
5 changes: 2 additions & 3 deletions aatp/infra/webexec/docker_entry.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

set -x
EXE="/usr/local/bin/webexec"

HOME=/home/runner
CONF=/conf

Expand All @@ -19,8 +19,7 @@ if [[ $PEERBOOK == "1" ]]
then
/scripts/wait-for-it.sh -h peerbook -p 17777
fi
su -c "$EXE start --debug" runner
while true
do
sleep 1
su - runner -c '/usr/local/bin/webexec start --debug'
done
2 changes: 1 addition & 1 deletion aatp/peerbook_webrtc/admin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test.describe('peerbook administration', () => {
expect(pbOpen).toBeFalsy()
})
test('purchase update with an active subscription and bad otp', async () => {
await sleep(500)
await page.keyboard.press("Enter")
await redisClient.set("tempid:$ValidBearer", "1")
await sleep(1500)
await page.evaluate(async () => {
Expand Down
4 changes: 1 addition & 3 deletions aatp/peerbook_webrtc/lab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ services:
PB_HOME_URL: http://peerbook:17777
redis:
image: "redis:alpine"
command: [sh, -c, "rm -f /data/dump.rdb && redis-server"] # disable persistence
revenuecat:
image: "mockserver/mockserver"
environment:
Expand All @@ -65,8 +64,7 @@ services:
volumes:
- ./aatp/peerbook_webrtc:/config
smtp:
image: mailhog:local
build: https://github.com/mailhog/MailHog.git
image: jcalonso/mailhog
expose:
- 1025
- 8025
33 changes: 14 additions & 19 deletions aatp/peerbook_webrtc/session.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,32 +144,27 @@ insecure = true
await expect(page.locator('.pane')).toHaveCount(1)
})
test('disengage and reconnect', async() => {
await page.evaluate(async() => {
const gate = window.terminal7.activeG
gate.activeW.activeP.d.send("seq 10; sleep 1; seq 10 20\n")
await page.evaluate(async() =>
await window.terminal7.activeG.activeW.activeP.d.send(
"seq 10; sleep 1; seq 10 20\n"))
await page.screenshot({ path: `/result/first.png` })
const y1 = await page.evaluate(async() => {
const ret = window.terminal7.activeG.activeW.activeP.t.buffer.active.cursorY
window.terminal7.onAppStateChange({isActive: false})
return ret
})
await sleep(100)
await page.screenshot({ path: `/result/second.png` })
const lines1 = await page.evaluate(async() => {
const gate = window.terminal7.activeG
await gate.disengage().then(() => {
window.terminal7.clearTimeouts()
window.terminal7.activeG.session = null
})
return gate.activeW.activeP.t.buffer.active.length
})
await sleep(1000)
await page.screenshot({ path: `/result/third.png` })
await page.evaluate(async() => {
window.terminal7.activeG.connect()
})
await page.evaluate(async() =>
window.terminal7.onAppStateChange({isActive: true}))
await expect(page.locator('.pane')).toHaveCount(1)
await sleep(1500)
const lines2 = await page.evaluate(() =>
window.terminal7.activeG.activeW.activeP.t.buffer.active.length)
const y2 = await page.evaluate(() =>
window.terminal7.activeG.activeW.activeP.t.buffer.active.cursorY)
await page.screenshot({ path: `/result/fourth.png` })
console.log(lines1, lines2)
expect(lines2-lines1).toEqual(11)
console.log(y1, y2)
expect(y2-y1).toEqual(11)
})
test('after disengage & reconnect, a a pane can be close', async() => {
await page.screenshot({ path: `/result/fifth.png` })
Expand Down
2 changes: 1 addition & 1 deletion aatp/ui/ui.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ insecure=true`)
await page.screenshot({ path: `/result/2.png` })
await page.locator('.tabbar .reset').click()
await expect(page.locator('#t0')).toBeVisible()
sleep(20)
await sleep(20)
await page.keyboard.press('Enter')
await expect(page.locator('#t0')).toBeHidden()
await expect(page.locator('.pane')).toHaveCount(1)
Expand Down
2 changes: 1 addition & 1 deletion android/.idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion android/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "dev.terminal7"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 5
versionName "1.7.1"
versionCode 6
versionName "1.8.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
2 changes: 1 addition & 1 deletion android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies {
implementation project(':capacitor-network')
implementation project(':capacitor-preferences')
implementation project(':capacitor-status-bar')
implementation project(':capgo-capacitor-purchases')
implementation project(':revenuecat-purchases-capacitor')
implementation project(':capacitor-native-biometric')
implementation project(':capacitor-rate-app')
implementation project(':capacitor-ssh-plugin')
Expand Down
4 changes: 2 additions & 2 deletions android/app/src/main/assets/capacitor.plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"classpath": "com.capacitorjs.plugins.statusbar.StatusBarPlugin"
},
{
"pkg": "@capgo/capacitor-purchases",
"classpath": "ee.forgr.plugin.capacitor_purchases.CapacitorPurchasesPlugin"
"pkg": "@revenuecat/purchases-capacitor",
"classpath": "com.revenuecat.purchases.capacitor.PurchasesPlugin"
},
{
"pkg": "capacitor-native-biometric",
Expand Down
4 changes: 2 additions & 2 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ project(':capacitor-preferences').projectDir = new File('../node_modules/@capaci
include ':capacitor-status-bar'
project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')

include ':capgo-capacitor-purchases'
project(':capgo-capacitor-purchases').projectDir = new File('../node_modules/@capgo/capacitor-purchases/android')
include ':revenuecat-purchases-capacitor'
project(':revenuecat-purchases-capacitor').projectDir = new File('../node_modules/@revenuecat/purchases-capacitor/android')

include ':capacitor-native-biometric'
project(':capacitor-native-biometric').projectDir = new File('../node_modules/capacitor-native-biometric/android')
Expand Down
43 changes: 32 additions & 11 deletions css/terminal7.css
Original file line number Diff line number Diff line change
Expand Up @@ -367,17 +367,27 @@ button.rename-close {
position: absolute;
top: 128px;
left: 20px;
max-width: 35vw;
padding: 10px;
border: 1px dotted;
border-radius: 4px;
text-align: center;
line-height: 12px;
}
#version a {
text-decoration: underline;
text-decoration-style: dashed;
text-decoration-line: underline;
cursor: pointer;
}
#version ul {
list-style: none;
text-align: left;
padding-left: 0;

}
#version li .status {
float: right;
padding-left: 0;
}
#version footer {
font-size: 10px;
}
Expand Down Expand Up @@ -475,10 +485,30 @@ label {
height: 100%;
width: 100%;
}
@media (min-width: 600px) {
#title-short {
display: none;
}
#title-long {
display: block;
}
#version {
max-width: 35vw;
}
}
@media (max-width: 600px) {
#log {
width: 90vw;
}
#title-short {
display: block;
}
#title-long {
display: none;
}
#version {
max-width: 35vw;
}
}
.search-container {
margin: 0 auto;
Expand Down Expand Up @@ -787,17 +817,8 @@ div.boarding {
text-decoration: none;
}
#title-short {
display: none;
letter-spacing: 0.1em;
}
@media (max-width: 600px) {
#title-short {
display: block;
}
#title-long {
display: none;
}
}
.expand-gate {
display: block;
position: absolute;
Expand Down
Loading