Skip to content
Merged
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
6 changes: 3 additions & 3 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
"dotenv": "16.4.5",
"etag": "1.8.1",
"express": "5.2.0",
"express-rate-limit": "7.5.1",
"express-rate-limit": "8.5.2",
"firebase-admin": "12.0.0",
"helmet": "4.6.0",
"ioredis": "4.28.5",
"lru-cache": "11.5.1",
"mjml": "4.15.0",
"mongodb": "6.3.0",
"mustache": "4.2.0",
"nodemailer": "8.0.5",
"nodemailer": "8.0.10",
"object-hash": "3.0.0",
"prom-client": "15.1.3",
"rate-limiter-flexible": "5.0.3",
Expand All @@ -69,7 +69,7 @@
"@types/mjml": "4.7.4",
"@types/mustache": "4.2.2",
"@types/node": "24.9.1",
"@types/nodemailer": "6.4.15",
"@types/nodemailer": "8.0.0",
"@types/object-hash": "3.0.6",
"@types/readline-sync": "1.4.8",
"@types/string-similarity": "4.0.2",
Expand Down
20 changes: 10 additions & 10 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,15 @@
"@monkeytype/util": "workspace:*",
"@sentry/browser": "10.44.0",
"@sentry/vite-plugin": "5.2.0",
"@solid-devtools/overlay": "0.33.5",
"@solid-primitives/refs": "1.1.3",
"@solid-primitives/transition-group": "1.1.2",
"@solidjs/meta": "0.29.4",
"@tanstack/pacer-lite": "0.2.1",
"@tanstack/query-db-collection": "1.0.36",
"@tanstack/solid-db": "0.2.19",
"@tanstack/solid-devtools": "0.8.2",
"@tanstack/solid-form": "1.29.1",
"@tanstack/solid-hotkeys": "0.9.1",
"@tanstack/solid-hotkeys-devtools": "0.6.6",
"@tanstack/solid-query": "5.100.3",
"@tanstack/solid-query-devtools": "5.100.3",
"@tanstack/pacer-lite": "0.2.2",
"@tanstack/query-db-collection": "1.0.38",
"@tanstack/solid-db": "0.2.21",
"@tanstack/solid-form": "1.33.0",
"@tanstack/solid-hotkeys": "0.10.0",
"@tanstack/solid-query": "5.100.14",
"@tanstack/solid-table": "8.21.3",
"@ts-rest/core": "3.52.1",
"animejs": "4.2.2",
Expand Down Expand Up @@ -81,9 +77,13 @@
"@fortawesome/fontawesome-free": "5.15.4",
"@monkeytype/oxlint-config": "workspace:*",
"@monkeytype/typescript-config": "workspace:*",
"@solid-devtools/overlay": "0.33.5",
"@solidjs/testing-library": "0.8.10",
"@tailwindcss/vite": "4.2.1",
"@tanstack/eslint-plugin-query": "5.100.3",
"@tanstack/solid-devtools": "0.8.2",
"@tanstack/solid-hotkeys-devtools": "0.6.6",
"@tanstack/solid-query-devtools": "5.100.3",
"@testing-library/dom": "10.4.1",
"@testing-library/jest-dom": "6.9.1",
"@testing-library/user-event": "14.6.1",
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/ts/collections/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,6 @@ export async function waitForResultsReady(): Promise<void> {
await resultsCollection.stateWhenReady();
}

export function getResultsSize(): number {
return resultsCollection.size;
}

/**
*
*/
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ts/components/modals/CookiesModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function CookiesModal(): JSXElement {
return (
<AnimatedModal
id="Cookies"
modalClass="min-w-[500px]"
modalClass="max-w-[500px]"
wrapperClass="justify-end items-end"
closeOnEscape={false}
closeOnWrapperClick={false}
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/ts/components/modals/CustomTextModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,12 @@ export function CustomTextModal(): JSXElement {
form.setFieldValue("limitSection", "");
} else if (previousMode === "simple") {
const text = cleanUpText();
form.setFieldValue("limitWord", `${text.length}`);
form.setFieldValue("limitTime", "");
form.setFieldValue("limitSection", `${text.length}`);
if (form.getFieldValue("pipeDelimiter")) {
form.setFieldValue("limitSection", `${text.length}`);
} else {
form.setFieldValue("limitWord", `${text.length}`);
}
}
});
};
Expand Down
12 changes: 8 additions & 4 deletions frontend/src/ts/components/pages/account/AccountPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { createMemo, createSignal, JSXElement, Show } from "solid-js";
import {
createResultsQueryState,
getResultsQueryOnce,
getResultsSize,
useResultsLiveQuery,
} from "../../../collections/results";
import { SnapshotResult } from "../../../constants/default-snapshot";
Expand Down Expand Up @@ -46,7 +45,11 @@ export function AccountPage(): JSXElement {
);
const [isExporting, setIsExporting] = createSignal(false);

const resultsQuery = useResultsLiveQuery({ queryState, sorting, limit });
const resultsQuery = useResultsLiveQuery({
queryState,
sorting,
limit: () => limit() + 1,
});

return (
<Page id="account" needsAuthentication>
Expand Down Expand Up @@ -117,14 +120,15 @@ export function AccountPage(): JSXElement {
{({ resultsQueryData }) => (
<>
<Table
data={[...resultsQueryData()]}
data={resultsQueryData().slice(0, limit())}
onSortingChange={(val) => setSorting(val)}
selectedRowId={selectedResultId}
/>
<Button
text="load more"
disabled={
resultsQuery.isLoading || getResultsSize() < limit() + 10
resultsQuery.isLoading ||
resultsQueryData().length <= limit()
}
onClick={() => setLimit((limit) => limit + 10)}
class="w-full text-center"
Expand Down
1 change: 1 addition & 0 deletions frontend/src/ts/constants/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const LanguageGroups: Record<string, Language[]> = {
"english_shakespearean",
"english_old",
"english_medical",
"english_legal",
],
spanish: ["spanish", "spanish_1k", "spanish_10k", "spanish_650k"],
french: [
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/ts/test/events/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { calculateWpm } from "../../utils/numbers";
import { mean, roundTo2 } from "@monkeytype/util/numbers";
import { InputEvent, TestEvent } from "./types";
import { Config } from "../../config/store";
import { isFunboxActive } from "../funbox/list";
import { isFunboxActiveWithProperty } from "../funbox/list";

function getTimerBoundaries(events: TestEvent[]): number[] {
const boundaries: number[] = [];
Expand Down Expand Up @@ -247,7 +247,7 @@ function getTargetWord(
wordEnd = " ";
}

if (isFunboxActive("nospace") || isFunboxActive("underscore_spaces")) {
if (isFunboxActiveWithProperty("nospace")) {
wordEnd = "";
}

Expand Down
52 changes: 48 additions & 4 deletions frontend/src/ts/test/test-logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,8 @@ function buildCompletedEvent(

const ALWAYSREPORT = false;

// window.ce2 = buildCompletedEvent2;

function compareCompletedEvents(
ce: Omit<CompletedEvent, "hash" | "uid">,
): void {
Expand Down Expand Up @@ -1149,11 +1151,53 @@ function compareCompletedEvents(
showSuccessNotification("Completed events match", { important: true });
}
} else {
let ignoreMismatch = false;
if (
mismatchedKeys.includes("testDuration") &&
Math.abs(ce2.testDuration - ce.testDuration) <= 0.2
) {
ignoreMismatch = true;
console.warn("Ignoring completed event mismatch on testDuration", {
ceTestDuration: ce.testDuration,
ce2TestDuration: ce2.testDuration,
});
}
if (mismatchedKeys.includes("keyOverlap")) {
ignoreMismatch = true;
console.warn("Ignoring completed event mismatch on keyOverlap", {
ceKeyOverlap: ce.keyOverlap,
ce2KeyOverlap: ce2.keyOverlap,
});
}
if (
mismatchedKeys.includes("afkDuration") &&
Math.abs(ce2.afkDuration - ce.afkDuration) <= 1
) {
ignoreMismatch = true;
console.warn("Ignoring completed event mismatch on afkDuration", {
ceAfkDuration: ce.afkDuration,
ce2AfkDuration: ce2.afkDuration,
});
}
if (
mismatchedKeys.includes("chartData.wpm") &&
mismatchedKeys.length === 1
) {
ignoreMismatch = true;
}

if (ALWAYSREPORT) {
showErrorNotification(
`Completed event mismatch: ${notMatching.join(", ")}`,
{ important: true },
);
if (ignoreMismatch) {
showNoticeNotification(
`Completed event ok with ignored mismatches: ${notMatching.join(", ")}`,
{ important: true },
);
} else {
showErrorNotification(
`Completed event mismatch: ${notMatching.join(", ")}`,
{ important: true },
);
}
}
mismatchedKeys.sort();
const groupKey = mismatchedKeys.join(",");
Expand Down
Loading
Loading