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

Support for generic reactions #2708

Merged
merged 125 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
48cf487
Initial support for Hand Raise feature
mgcm Aug 7, 2024
2d1917c
Refactored to use reaction and redaction events
mgcm Sep 8, 2024
f6ae6a0
Replacing button svg with raised hand emoji
mgcm Sep 8, 2024
ac7321d
SpotlightTile should not duplicate the raised hand
mgcm Sep 8, 2024
bcad500
Update src/room/useRaisedHands.tsx
fkwp Sep 9, 2024
0730ba5
Use relations to load existing reactions when joining the call
mgcm Sep 10, 2024
ab5654c
Links to sha commit of matrix-js-sdk that exposes the call membership…
mgcm Sep 10, 2024
7ac5642
Removing RaiseHand.svg
mgcm Sep 10, 2024
69a50fb
Check for reaction & redaction capabilities in widget mode
mgcm Sep 19, 2024
42a7b1e
Fix failing GridTile test
mgcm Sep 19, 2024
16afb56
Center align hand raise.
Half-Shot Oct 25, 2024
1c8e547
Add support for displaying the duration of a raised hand.
Half-Shot Oct 25, 2024
7f268a3
Add a sound for when a hand is raised.
Half-Shot Oct 25, 2024
a23d256
Refactor raised hand indicator and add tests.
Half-Shot Oct 28, 2024
43b4fc0
lint
Half-Shot Oct 28, 2024
4501e67
Refactor into own files.
Half-Shot Oct 28, 2024
4a712dc
Redact the right thing.
Half-Shot Oct 28, 2024
ba921f8
Tidy up useEffect
Half-Shot Oct 28, 2024
9d01e8c
Lint tests
Half-Shot Oct 28, 2024
38878d3
Remove extra layer
Half-Shot Oct 28, 2024
33724ef
Add better sound. (woosh)
Half-Shot Oct 28, 2024
198859d
Add a small mode for spotlight
Half-Shot Oct 28, 2024
07d3451
Fix timestamp calculation on relaod.
Half-Shot Oct 28, 2024
b7e8236
Fix call border resizing video
Half-Shot Oct 29, 2024
23d849b
lint
Half-Shot Oct 29, 2024
f13bd79
Fix and update tests
Half-Shot Oct 29, 2024
dbabf45
Allow timer to be configurable.
Half-Shot Oct 29, 2024
e1a4310
Add preferences tab for choosing to enable timer.
Half-Shot Oct 29, 2024
0b6cf18
Drop border from raised hand icon
Half-Shot Oct 29, 2024
528e692
Handle cases when a new member event happens.
Half-Shot Oct 29, 2024
cd73ad8
Prevent infinite loop
Half-Shot Oct 29, 2024
5a5c1be
Major refactor to support various state problems.
Half-Shot Oct 29, 2024
ff7da13
Tidy up and finish test rewrites
Half-Shot Oct 29, 2024
a45b01d
Add some explanation comments.
Half-Shot Oct 29, 2024
3229498
Even more comments.
Half-Shot Oct 29, 2024
2d95d4f
Use proper duration formatter
Half-Shot Oct 31, 2024
7229f4b
Remove rerender
Half-Shot Oct 31, 2024
a354a40
Fix redactions not working because they pick up events in transit.
Half-Shot Oct 31, 2024
e49eb55
More tidying
Half-Shot Oct 31, 2024
ec9dec8
Use deferred value
Half-Shot Oct 31, 2024
21380c7
linting
Half-Shot Oct 31, 2024
a9e6aa3
Add tests for cases where we got a reaction from someone else.
Half-Shot Oct 31, 2024
167caa3
Merge remote-tracking branch 'origin/livekit' into raise-hand-button
Half-Shot Oct 31, 2024
748cc58
Be even less brittle.
Half-Shot Nov 1, 2024
f54e1e2
Transpose border to GridTile.
Half-Shot Nov 1, 2024
373a12a
First PoC for reactions
Half-Shot Nov 1, 2024
a207536
hide menu by default
Half-Shot Nov 1, 2024
80b40b6
Add lightbulb.
Half-Shot Nov 1, 2024
edc4142
Add reaction indicator.
Half-Shot Nov 1, 2024
fd46f8a
Add sounds.
Half-Shot Nov 1, 2024
dfe9569
Tidy up + add support for floating emoji.
Half-Shot Nov 1, 2024
e3c23fa
Linting and general stability improvements.
Half-Shot Nov 1, 2024
a60d489
Subscribe to the ecall reaction event type.
Half-Shot Nov 1, 2024
28bef94
fix import
Half-Shot Nov 1, 2024
0f4fec4
Center emoji picker
Half-Shot Nov 1, 2024
27e3cec
Overflow buttons when screen is too narrow
Half-Shot Nov 1, 2024
3e69e25
Merge remote-tracking branch 'origin/livekit' into hs/emoji-reactions
Half-Shot Nov 4, 2024
c9fe0bd
lint
Half-Shot Nov 4, 2024
41c5a80
Add settings for disabling animations / sounds.
Half-Shot Nov 4, 2024
844379a
Make vertical divider more visually distinct.
Half-Shot Nov 4, 2024
d251af4
Make event listener more resillient.
Half-Shot Nov 4, 2024
c64c4e6
lint
Half-Shot Nov 4, 2024
ece04fd
Fix some tests.
Half-Shot Nov 4, 2024
4e6ffd6
Remove old raised hand component
Half-Shot Nov 4, 2024
8b4bd16
Add new icon
Half-Shot Nov 4, 2024
abfcba9
Update text
Half-Shot Nov 4, 2024
c9e375f
Update compound hand raised icon.
Half-Shot Nov 5, 2024
714ed35
Add deer.
Half-Shot Nov 5, 2024
56c4072
Fix case where you could send larger strings as emoji
Half-Shot Nov 5, 2024
4db7b4f
Const the active time.
Half-Shot Nov 5, 2024
f556e61
Document time in css.
Half-Shot Nov 5, 2024
8863b7c
Add rock emoji
Half-Shot Nov 5, 2024
d5122f6
Add licence file.
Half-Shot Nov 5, 2024
05b56c7
Add type def for custom reaction type.
Half-Shot Nov 5, 2024
0e22964
better reaction description
Half-Shot Nov 5, 2024
2eb62d8
Factor out reactions test structure to utils file.
Half-Shot Nov 5, 2024
9ff8197
Add tests for ReactionToggleButton
Half-Shot Nov 5, 2024
507663d
Add keyboard shortcuts for reaction sending.
Half-Shot Nov 5, 2024
c9b6c7f
type tidyups
Half-Shot Nov 5, 2024
b1246f9
lint
Half-Shot Nov 5, 2024
d3ceccc
Add tests for ReactionAudioRenderer
Half-Shot Nov 5, 2024
69b18a9
lint
Half-Shot Nov 5, 2024
9c6ab58
prettier
Half-Shot Nov 5, 2024
d387050
i18n sort
Half-Shot Nov 5, 2024
b4a126d
final lint?
Half-Shot Nov 5, 2024
6294fbb
Preload reaction sounds to prevent delays.
Half-Shot Nov 7, 2024
b1d90f8
Update rock sounds
Half-Shot Nov 7, 2024
a262c4b
Merge remote-tracking branch 'origin/livekit' into hs/emoji-reactions
Half-Shot Nov 7, 2024
e8e905c
add onclick back
Half-Shot Nov 7, 2024
f4f0821
Fix test
Half-Shot Nov 7, 2024
fabbdac
lint
Half-Shot Nov 7, 2024
83eb5b4
simplify
Half-Shot Nov 7, 2024
29d562a
Tweak line height
Half-Shot Nov 7, 2024
60300c2
modal impl
Half-Shot Nov 7, 2024
54b495c
Modal refactor attempts.
Half-Shot Nov 7, 2024
5a9eddf
Remove closed menu test since we're using Modal.
Half-Shot Nov 7, 2024
234bdaa
Swap icon, make mobile view better.
Half-Shot Nov 7, 2024
54f7afa
Fix mobile view for emoji picker.
Half-Shot Nov 7, 2024
17f2647
Use Intl.Segmenter
Half-Shot Nov 8, 2024
63f1b73
Clear timeouts on component close.
Half-Shot Nov 8, 2024
1962632
Remove useless useCallback
Half-Shot Nov 8, 2024
63137a5
Use prefers-reduced-motion
Half-Shot Nov 8, 2024
230c85e
Merge remote-tracking branch 'origin/livekit' into hs/emoji-reactions
Half-Shot Nov 8, 2024
688e7a1
Add toggle for raise hand.
Half-Shot Nov 8, 2024
c2162a3
Add lower hand text
Half-Shot Nov 8, 2024
3b62522
Add lower motion mode.
Half-Shot Nov 8, 2024
afe64cf
Decomplicate className system for Modal
Half-Shot Nov 8, 2024
e98f84e
Add error for failured to send reaction.
Half-Shot Nov 8, 2024
0a8e53e
i18n
Half-Shot Nov 8, 2024
f6e3274
Spacing for emoji buttons search
Half-Shot Nov 8, 2024
f628809
Remove unrequired media query
Half-Shot Nov 8, 2024
e97c779
Fix generic sound not playing.
Half-Shot Nov 8, 2024
90fa6d0
Clear reactions if we're clearing timeouts.
Half-Shot Nov 8, 2024
caf2d6b
Fix tests
Half-Shot Nov 8, 2024
d6d6efd
Relabel lower hand
Half-Shot Nov 8, 2024
fbb3882
More translations
Half-Shot Nov 8, 2024
a50198d
Add comments on reaction interface
Half-Shot Nov 8, 2024
0d94d9a
Move polyfill.
Half-Shot Nov 8, 2024
251d1c8
lint
Half-Shot Nov 8, 2024
1062b98
Replace deer sound
Half-Shot Nov 8, 2024
689f94b
Another attempt to fix the sizing of the reactions
Half-Shot Nov 8, 2024
a6d1edb
cleanup
Half-Shot Nov 8, 2024
9a9a479
fix button
Half-Shot Nov 8, 2024
31bf036
fix
Half-Shot Nov 8, 2024
1a95c57
Merge remote-tracking branch 'origin/livekit' into hs/emoji-reactions
Half-Shot Nov 8, 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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.23.0",
"@formatjs/intl-durationformat": "^0.6.1",
"@formatjs/intl-segmenter": "^11.7.3",
"@livekit/components-core": "^0.11.0",
"@livekit/components-react": "^2.0.0",
"@opentelemetry/api": "^1.4.0",
Expand Down Expand Up @@ -57,7 +58,7 @@
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"@use-gesture/react": "^10.2.11",
"@vector-im/compound-design-tokens": "^1.0.0",
"@vector-im/compound-design-tokens": "^1.9.1",
"@vector-im/compound-web": "^6.0.0",
"@vitejs/plugin-basic-ssl": "^1.0.1",
"@vitejs/plugin-react": "^4.0.1",
Expand Down
18 changes: 17 additions & 1 deletion public/locales/en-GB/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
},
"action": {
"close": "Close",
"close_search": "Close search",
"copy_link": "Copy link",
"edit": "Edit",
"go": "Go",
"invite": "Invite",
"lower_hand": "Lower hand",
"no": "No",
"open_search": "Open search",
"pick_reaction": "Pick reaction",
"raise_hand": "Raise hand",
"raise_hand_or_send_reaction": "Raise hand or send reaction",
"register": "Register",
"remove": "Remove",
"sign_in": "Sign in",
Expand Down Expand Up @@ -55,8 +61,10 @@
"password": "Password",
"preferences": "Preferences",
"profile": "Profile",
"raise_hand": "Raise hand",
"reaction": "Reaction",
"search": "Search",
"settings": "Settings",
"something_went_wrong": "Something went wrong",
"unencrypted": "Not encrypted",
"username": "Username",
"video": "Video"
Expand Down Expand Up @@ -120,6 +128,7 @@
"rageshake_sending": "Sending…",
"rageshake_sending_logs": "Sending debug logs…",
"rageshake_sent": "Thanks!",
"reaction_search": "Search reactions…",
"recaptcha_caption": "This site is protected by ReCAPTCHA and the Google <2>Privacy Policy</2> and <6>Terms of Service</6> apply.<9></9>By clicking \"Register\", you agree to our <12>End User Licensing Agreement (EULA)</12>",
"recaptcha_dismissed": "Recaptcha dismissed",
"recaptcha_not_loaded": "Recaptcha not loaded",
Expand Down Expand Up @@ -147,6 +156,13 @@
"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.",
"preferences_tab": {
"reactions_play_sound_description": "Play a sound effect when anyone sends a reaction into a call.",
"reactions_play_sound_label": "Play reaction sounds",
"reactions_show_description": "Show reactions",
"reactions_show_label": "Show an animation when anyone sends a reaction.",
"reactions_title": "Reactions"
},
"preferences_tab_body": "Here you can configure extra options for an improved experience",
"preferences_tab_h4": "Preferences",
"preferences_tab_show_hand_raised_timer_description": "Show a timer when a participant raises their hand",
Expand Down
18 changes: 18 additions & 0 deletions src/@types/matrix-js-sdk.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Copyright 2024 New Vector Ltd.

SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
*/

import {
ElementCallReactionEventType,
ECallReactionEventContent,
} from "../reactions";

// Extend Matrix JS SDK types via Typescript declaration merging to support unspecced event fields and types
declare module "matrix-js-sdk/src/types" {
export interface TimelineEvents {
[ElementCallReactionEventType]: ECallReactionEventContent;
}
}
60 changes: 44 additions & 16 deletions src/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,21 @@ import { useMediaQuery } from "./useMediaQuery";

export interface Props {
title: string;
/**
* Hide the modal header. Used for smaller popups where the context is readily apparent.
* A title should still be specified for users using assistive technology.
*/
hideHeader?: boolean;
children: ReactNode;
className?: string;
/**
* Class name to be used when in drawer mode (touchscreen).
*/
classNameDrawer?: string;
/**
* Class name to be used when in modal mode (desktop).
*/
classNameModal?: string;
/**
* The controlled open state of the modal.
*/
Expand All @@ -54,8 +67,11 @@ export interface Props {
*/
export const Modal: FC<Props> = ({
title,
hideHeader,
children,
className,
classNameDrawer,
classNameModal,
open,
onDismiss,
tabbed,
Expand Down Expand Up @@ -84,6 +100,7 @@ export const Modal: FC<Props> = ({
<Drawer.Content
className={classNames(
className,
classNameDrawer,
overlayStyles.overlay,
styles.modal,
styles.drawer,
Expand All @@ -109,6 +126,28 @@ export const Modal: FC<Props> = ({
</Drawer.Root>
);
} else {
const titleNode = (
<DialogTitle asChild>
<Heading as="h2" weight="semibold" size="md">
{title}
</Heading>
</DialogTitle>
);
const header = (
<div className={styles.header}>
{titleNode}
{onDismiss !== undefined && (
<DialogClose
className={styles.close}
data-testid="modal_close"
aria-label={t("action.close")}
>
<CloseIcon width={20} height={20} />
</DialogClose>
)}
</div>
);

return (
<DialogRoot open={open} onOpenChange={onOpenChange}>
<DialogPortal>
Expand All @@ -126,6 +165,7 @@ export const Modal: FC<Props> = ({
<Glass
className={classNames(
className,
classNameModal,
overlayStyles.overlay,
overlayStyles.animate,
styles.modal,
Expand All @@ -134,22 +174,10 @@ export const Modal: FC<Props> = ({
)}
>
<div className={styles.content}>
<div className={styles.header}>
<DialogTitle asChild>
<Heading as="h2" weight="semibold" size="md">
{title}
</Heading>
</DialogTitle>
{onDismiss !== undefined && (
<DialogClose
className={styles.close}
data-testid="modal_close"
aria-label={t("action.close")}
>
<CloseIcon width={20} height={20} />
</DialogClose>
)}
</div>
{!hideHeader ? header : null}
{hideHeader ? (
<VisuallyHidden asChild>{titleNode}</VisuallyHidden>
) : null}
<div className={styles.body}>{children}</div>
</div>
</Glass>
Expand Down
126 changes: 0 additions & 126 deletions src/button/RaisedHandToggleButton.tsx

This file was deleted.

Loading