Skip to content

Switch to Rust crypto #2467

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

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
20602c1
Implement the new unified grid layout
robintown May 2, 2024
41083c0
Refactor settings to use observables
robintown May 8, 2024
14fc148
Address some review feedback
robintown Jul 12, 2024
599d6fd
Address review feedback
robintown Jul 12, 2024
f847692
Merge pull request #2325 from robintown/unified-grid
robintown Jul 12, 2024
a534356
Merge pull request #2368 from robintown/settings-refactor
robintown Jul 12, 2024
e33fbd7
Split local and remote user media into different classes
robintown May 16, 2024
8a41401
Add always show flag to view model
robintown May 16, 2024
5647619
Add always show toggle to the UI
robintown Jun 20, 2024
0d485ef
Use always show flag in importance ordering
robintown May 16, 2024
af0bd79
Replace react-rxjs with observable-hooks
robintown May 16, 2024
34c45cb
Get the right grid offset even when offsetParent is a layout element
robintown May 21, 2024
ffbbc74
Implement the new spotlight layout
robintown May 17, 2024
54c22f4
Clean up spotlight tile code
robintown May 28, 2024
ec1b020
Add indicators to spotlight tile and make spotlight layout responsive
robintown May 30, 2024
7f40ce8
Fix advance buttons showing up for the spotlight speaker
robintown May 31, 2024
dfda753
Only switch to spotlight for remote screen shares
robintown Jun 4, 2024
12b719d
Make layout reactivity a little more fine-grained
robintown Jun 4, 2024
183d2d9
Show speaker in the spotlight in large grids
robintown Jun 7, 2024
e0b10d8
Add model for one-on-one layout
robintown Jun 7, 2024
7979493
Implement the new one-on-one layout
robintown Jun 7, 2024
45c89a2
Delete the legacy grid system
robintown Jun 7, 2024
a16f235
Fix crash in spotlight mode while connecting
robintown Jun 12, 2024
2440037
Implement most of the remaining layout changes
robintown Jul 3, 2024
f516645
Fix coverage reporting
robintown Jul 5, 2024
fb412e2
Suppress some noisy log lines
robintown Jul 5, 2024
bf2fc28
Store test files alongside source files
robintown Jul 5, 2024
1b5f8f1
Stop using Vitest globals
robintown Jul 5, 2024
5e4a028
Remove Storybook directory
robintown Jul 5, 2024
d25cf28
Switch to Rust crypto
robintown Jul 5, 2024
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
9 changes: 0 additions & 9 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ module.exports = {
"jsx-a11y/media-has-caption": "off",
// We should use the js-sdk logger, never console directly.
"no-console": ["error"],
"no-restricted-imports": [
"error",
{
name: "@react-rxjs/core",
importNames: ["Subscribe", "RemoveSubscribe"],
message:
"These components are easy to misuse, please use the 'subscribe' component wrapper instead",
},
],
"react/display-name": "error",
},
settings: {
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ jobs:
- name: Install dependencies
run: "yarn install"
- name: Vitest
run: "yarn run test"
run: "yarn run test:coverage"
- name: Upload to codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4
with:
flags: unittests
fail_ci_if_error: true
25 changes: 0 additions & 25 deletions .storybook/main.js

This file was deleted.

24 changes: 0 additions & 24 deletions .storybook/preview.jsx

This file was deleted.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
"i18n": "node_modules/i18next-parser/bin/cli.js",
"i18n:check": "node_modules/i18next-parser/bin/cli.js --fail-on-warnings --fail-on-update",
"test": "vitest",
"test:coverage": "vitest run --coverage",
"test:coverage": "vitest --coverage",
"backend": "docker-compose -f backend-docker-compose.yml up"
},
"dependencies": {
"@juggle/resize-observer": "^3.3.1",
"@livekit/components-core": "^0.10.0",
"@livekit/components-react": "^2.0.0",
"@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.14.tgz",
"@opentelemetry/api": "^1.4.0",
"@opentelemetry/context-zone": "^1.9.1",
"@opentelemetry/exporter-jaeger": "^1.9.1",
Expand All @@ -41,7 +40,6 @@
"@react-aria/tabs": "^3.1.0",
"@react-aria/tooltip": "^3.1.3",
"@react-aria/utils": "^3.10.0",
"@react-rxjs/core": "^0.10.7",
"@react-spring/web": "^9.4.4",
"@react-stately/collections": "^3.3.4",
"@react-stately/select": "^3.1.3",
Expand All @@ -66,6 +64,7 @@
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#238eea0ef5c82d0a11b8d5cc5c04104d6c94c4c1",
"matrix-widget-api": "^1.3.1",
"normalize.css": "^8.0.1",
"observable-hooks": "^4.2.3",
"pako": "^2.0.4",
"postcss-preset-env": "^9.0.0",
"posthog-js": "^1.29.0",
Expand Down Expand Up @@ -105,6 +104,7 @@
"@types/uuid": "10",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"@vitest/coverage-v8": "^1.6.0",
"babel-loader": "^9.0.0",
"babel-plugin-transform-vite-meta-env": "^1.0.3",
"eslint": "^8.14.0",
Expand Down
7 changes: 4 additions & 3 deletions public/locales/en-GB/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"analytics": "Analytics",
"audio": "Audio",
"avatar": "Avatar",
"back": "Back",
"camera": "Camera",
"copied": "Copied!",
"display_name": "Display name",
Expand All @@ -49,6 +50,7 @@
"home": "Home",
"loading": "Loading…",
"microphone": "Microphone",
"next": "Next",
"options": "Options",
"password": "Password",
"profile": "Profile",
Expand Down Expand Up @@ -138,7 +140,6 @@
"feedback_tab_title": "Feedback",
"more_tab_title": "More",
"opt_in_description": "<0></0><1></1>You may withdraw consent by unchecking this box. If you are currently in a call, this setting will take effect at the end of the call.",
"show_connection_stats_label": "Show connection stats",
"speaker_device_selection_label": "Speaker"
},
"star_rating_input_label_one": "{{count}} stars",
Expand All @@ -154,12 +155,12 @@
"unmute_microphone_button_label": "Unmute microphone",
"version": "Version: {{version}}",
"video_tile": {
"always_show": "Always show",
"change_fit_contain": "Fit to frame",
"exit_full_screen": "Exit full screen",
"full_screen": "Full screen",
"mute_for_me": "Mute for me",
"sfu_participant_local": "You",
"volume": "Volume"
},
"waiting_for_participants": "Waiting for other participants…"
}
}
5 changes: 0 additions & 5 deletions src/@types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ declare global {
webkitFullscreenElement: HTMLElement | null;
}

interface Window {
// TODO: https://gitlab.matrix.org/matrix-org/olm/-/issues/10
OLM_OPTIONS: Record<string, string>;
}

interface HTMLElement {
// Safari only supports this prefixed, so tell the type system about it
webkitRequestFullscreen: () => void;
Expand Down
2 changes: 1 addition & 1 deletion src/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
import { useMemo, FC } from "react";
import { Avatar as CompoundAvatar } from "@vector-im/compound-web";

import { getAvatarUrl } from "./matrix-utils";
import { getAvatarUrl } from "./utils/matrix";
import { useClient } from "./ClientContext";

export enum Size {
Expand Down
2 changes: 1 addition & 1 deletion src/ClientContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
CryptoStoreIntegrityError,
fallbackICEServerAllowed,
initClient,
} from "./matrix-utils";
} from "./utils/matrix";
import { widget } from "./widget";
import {
PosthogAnalytics,
Expand Down
2 changes: 1 addition & 1 deletion src/Header.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2022 New Vector Ltd
Copyright 2022-2024 New Vector Ltd

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
26 changes: 17 additions & 9 deletions src/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2022 New Vector Ltd
Copyright 2022-2024 New Vector Ltd

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@ limitations under the License.
*/

import classNames from "classnames";
import { FC, HTMLAttributes, ReactNode } from "react";
import { FC, HTMLAttributes, ReactNode, forwardRef } from "react";
import { Link } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { Heading, Text } from "@vector-im/compound-web";
Expand All @@ -32,13 +32,21 @@ interface HeaderProps extends HTMLAttributes<HTMLElement> {
className?: string;
}

export const Header: FC<HeaderProps> = ({ children, className, ...rest }) => {
return (
<header className={classNames(styles.header, className)} {...rest}>
{children}
</header>
);
};
export const Header = forwardRef<HTMLElement, HeaderProps>(
({ children, className, ...rest }, ref) => {
return (
<header
ref={ref}
className={classNames(styles.header, className)}
{...rest}
>
{children}
</header>
);
},
);

Header.displayName = "Header";

interface LeftNavProps extends HTMLAttributes<HTMLElement> {
children: ReactNode;
Expand Down
5 changes: 5 additions & 0 deletions src/Platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ if (/android/i.test(navigator.userAgent)) {
} else {
platform = "desktop";
}

export const isFirefox = (): boolean => {
const { userAgent } = navigator;
return userAgent.includes("Firefox");
};
7 changes: 4 additions & 3 deletions test/Toast-test.tsx → src/Toast.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { vi } from "vitest";
import { expect, test, vi } from "vitest";
import { screen, render } from "@testing-library/react";
import { Toast } from "../src/Toast";
import userEvent from "@testing-library/user-event";
import { withFakeTimers } from "./utils";

import { Toast } from "../src/Toast";
import { withFakeTimers } from "./utils/test";

test("Toast renders", () => {
render(
Expand Down
2 changes: 1 addition & 1 deletion src/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const Toast: FC<Props> = ({
<DialogOverlay
className={classNames(overlayStyles.bg, overlayStyles.animate)}
/>
<DialogContent asChild>
<DialogContent aria-describedby={undefined} asChild>
<DialogClose
className={classNames(
overlayStyles.overlay,
Expand Down
2 changes: 1 addition & 1 deletion test/UrlParams-test.ts → src/UrlParams.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { vi } from "vitest";
import { beforeAll, describe, expect, it, vi } from "vitest";

import { getRoomIdentifierFromUrl } from "../src/UrlParams";
import { Config } from "../src/config/Config";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

exports[`Toast renders 1`] = `
<button
aria-describedby="radix-:r5:"
aria-labelledby="radix-:r4:"
class="overlay animate toast"
data-state="open"
Expand Down
21 changes: 21 additions & 0 deletions src/__snapshots__/Toast.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Toast renders 1`] = `
<button
aria-labelledby="radix-:r4:"
class="overlay animate toast"
data-state="open"
id="radix-:r3:"
role="dialog"
style="pointer-events: auto;"
tabindex="-1"
type="button"
>
<h3
class="_typography_yh5dq_162 _font-body-sm-semibold_yh5dq_45"
id="radix-:r4:"
>
Hello world!
</h3>
</button>
`;
Loading