Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions frontend/__tests__/components/pages/test/keymapConverter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { convertLayoutToKeymap } from "../../../../src/ts/components/pages/test/

import qwertyLayout from "../../../../static/layouts/qwerty.json";
import qwertzLayout from "../../../../static/layouts/qwertz.json";
import arabic101Layout from "../../../../static/layouts/arabic_101.json";

import { LayoutObject } from "@monkeytype/schemas/layouts";
import {
Expand Down Expand Up @@ -1123,5 +1124,19 @@ describe("keymap converter", () => {
expect(row4?.length, "row4 length").toBe(15);
});
});

describe("arabic_101", () => {
it("converts arabic_101 with canonical multi-char ligatures", () => {
const [, , , row4] = convertLayoutToKeymap(
arabic101Layout as LayoutObject,
{
keymapStyle: "staggered",
showAllKeys: false,
},
);

expect(row4?.[4]).toEqual(expectLegend("لا", "لآ"));
});
Comment on lines +1136 to +1139
});
});
});
6 changes: 5 additions & 1 deletion frontend/src/ts/test/events/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ export function getKeypressesPerSecond(eventLog: EventLog): number[] {
export function getBurstHistory(eventLog: EventLog): number[] {
const { counts, boundaries } = countPerInterval(
eventLog,
(e) => e.type === "input" && e.data.inputType === "insertText",
(e) =>
e.type === "input" &&
(e.data.inputType === "insertText" ||
(eventLog.context.koreanStatus &&
e.data.inputType === "insertCompositionText")),
Comment on lines +267 to +271
);

let prevBoundary = 0;
Expand Down
6 changes: 3 additions & 3 deletions frontend/static/layouts/arabic_101.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
["ص", "ً"],
["ث", "ُ"],
["ق", "ٌ"],
["ف", ""],
["ف", "لإ"],
["غ", "إ"],
["ع", "‘"],
["ه", "÷"],
Expand All @@ -37,7 +37,7 @@
["س", "ٍ"],
["ي", "]"],
["ب", "["],
["ل", ""],
["ل", "لأ"],
["ا", "أ"],
["ت", "ـ"],
["ن", "،"],
Expand All @@ -50,7 +50,7 @@
["ء", "ْ"],
["ؤ", "}"],
["ر", "{"],
["", ""],
["لا", "لآ"],
["ى", "آ"],
["ة", "’"],
["و", ","],
Expand Down
6 changes: 3 additions & 3 deletions frontend/static/layouts/arabic_102.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
["ص", "ً"],
["ث", "ُ"],
["ق", "ٌ"],
["ف", ""],
["ف", "لإ"],
["غ", "إ"],
["ع", "‘"],
["ه", "÷"],
Expand All @@ -37,7 +37,7 @@
["س", "​"],
["ي", "]"],
["ب", "["],
["ل", ""],
["ل", "لأ"],
["ا", "أ"],
["ت", "ـ"],
["ن", "،"],
Expand All @@ -50,7 +50,7 @@
["ء", "ْ"],
["ؤ", "ِ"],
["ر", "ٍ"],
["", ""],
["لا", "لآ"],
["ى", "آ"],
["ة", "’"],
["و", ","],
Expand Down
2 changes: 1 addition & 1 deletion packages/schemas/src/layouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export const LayoutNameSchema = z.enum(

export type LayoutName = z.infer<typeof LayoutNameSchema>;

const KeyLegendsSchema = z.array(z.string().length(1)).min(1).max(4);
const KeyLegendsSchema = z.array(z.string().min(1)).min(1).max(4);
export type KeyLegends = z.infer<typeof KeyLegendsSchema>;

const commonLayoutSchema = z
Expand Down
Loading