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

feat: Migrate input bar to Lexical #15507

Merged
merged 97 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
a1c9f5d
new input bar
przemvs Jul 7, 2023
be253de
fix bug with letter by letter submit
thisisamir98 Jul 12, 2023
ac532b1
edit broken
thisisamir98 Jul 17, 2023
da00343
InputBar improvements
przemvs Jul 20, 2023
427dd5e
use theme responsive css variables for text and bg colors
V-Gira Jul 25, 2023
cbc1de1
Fix mentions and emojis popover
przemvs Jul 26, 2023
17003fe
finalize
przemvs Jul 26, 2023
6a9dc67
refactor: move send button out of lexical input (#15505)
V-Gira Jul 26, 2023
2d0869c
input bar - final version
przemvs Jul 27, 2023
30bcf10
Merge branch 'dev' into feature/WPB-460-new-input-bar
przemvs Jul 27, 2023
d7f6805
fixes
przemvs Jul 27, 2023
9df8d28
CR Fixes
przemvs Jul 31, 2023
458f263
Merge branch 'dev' into feature/WPB-460-new-input-bar
przemvs Jul 31, 2023
0dff08a
cr fixes
przemvs Jul 31, 2023
c59c5d1
spaces
przemvs Jul 31, 2023
81cc7d0
Merge branch 'dev' into feature/WPB-460-new-input-bar
przemvs Aug 3, 2023
88ec5cf
fixes
przemvs Aug 4, 2023
ba18065
Merge branch 'dev' into feature/WPB-460-new-input-bar
przemvs Aug 7, 2023
356a77f
code clean-up
przemvs Aug 7, 2023
0e986ce
CR Fixes
przemvs Aug 8, 2023
d257bb1
exports fix
przemvs Aug 8, 2023
b4866f8
chore: cleanup unused propertyRepo
atomrc Aug 8, 2023
488690a
Merge branch 'dev' into feature/WPB-460-new-input-bar
atomrc Aug 8, 2023
dbac8ac
chore: camel case
atomrc Aug 8, 2023
7ee34b0
fix emoji detection
atomrc Aug 8, 2023
79fa017
fix types
atomrc Aug 8, 2023
d26f4ba
fix multiple spaces emoji searching
atomrc Aug 8, 2023
f1b3170
feat: Replace inline emoji (#15554)
phoenixhdd Aug 8, 2023
247fd4b
refactor: Simplify mention and emoji matching
atomrc Aug 8, 2023
90432de
fix typing indicator + autofocus on input
atomrc Aug 8, 2023
1518634
fix linting
atomrc Aug 8, 2023
189406c
code review
atomrc Aug 8, 2023
4f1b849
add input bar tests
atomrc Aug 8, 2023
d18b27c
improve typing detection
atomrc Aug 8, 2023
f8eb76d
ignore tests
atomrc Aug 8, 2023
cbc9740
fix tests
atomrc Aug 8, 2023
de7b7e5
cleanup custom plugins
atomrc Aug 8, 2023
f7bde57
fix: revert mention list
atomrc Aug 9, 2023
f56e864
restore copied typeahead plugin
atomrc Aug 9, 2023
1159ace
fine tune mentions menu scroll
atomrc Aug 9, 2023
0ff4cb9
Avoid removing/re-adding menu container on each update
atomrc Aug 9, 2023
d831782
add doc
atomrc Aug 9, 2023
f9e8e13
restore undo/redo
atomrc Aug 9, 2023
1746495
reorganize components
atomrc Aug 9, 2023
7756916
cleanup
atomrc Aug 9, 2023
505e403
simplify emoji node
atomrc Aug 9, 2023
2b53554
refactor: Streamline message sending process (#15581)
atomrc Aug 10, 2023
9f2fef9
fix: detecting when enter should be disabled for sending
atomrc Aug 10, 2023
57e8fc9
fix: adding emoji or mention in the middle of a message
atomrc Aug 10, 2023
07e2a33
fix: inline replacing leading emoji
atomrc Aug 10, 2023
7962b46
fix: inline replacement of emojis
atomrc Aug 10, 2023
1a8f07e
Merge branch 'dev' into feature/WPB-460-new-input-bar
atomrc Aug 21, 2023
9e1ecf3
fix: Restore esc to cancel edit
atomrc Aug 21, 2023
0258171
fix: Restore up arrow to edit
atomrc Aug 21, 2023
58aeed8
fix: restore visual seletion of mentions
atomrc Aug 21, 2023
161fcf6
Merge branch 'dev' into feature/WPB-460-new-input-bar
atomrc Aug 21, 2023
b889c46
Merge branch 'dev' into feature/WPB-460-new-input-bar
atomrc Aug 22, 2023
aa3718f
fix setting initial draft state
atomrc Aug 23, 2023
9a84da0
fix: edit last message when hitting up arrow in mention suggestions
atomrc Aug 23, 2023
742a6ff
Merge branch 'dev' into feature/WPB-460-new-input-bar
atomrc Aug 23, 2023
ab390d7
fix: Improve autofocus plugin
atomrc Aug 24, 2023
755fb89
fix: Isolate classifiedbar changes to component
atomrc Aug 24, 2023
efc44bd
fix tests
atomrc Aug 24, 2023
fa66ad9
Merge branch 'dev' into feature/WPB-460-new-input-bar
atomrc Aug 30, 2023
af127dd
improve classified bar types and re-renders
atomrc Aug 30, 2023
ef61abe
fix: do not edit is input value is not empty
atomrc Aug 30, 2023
3bc276f
make mentions retrieval lazy and not triggering re-render
atomrc Aug 30, 2023
bc7ffb9
cleanup
atomrc Aug 30, 2023
44245f2
Merge branch 'dev' into feature/WPB-460-new-input-bar
atomrc Aug 30, 2023
402d35f
fix mention generation
atomrc Aug 30, 2023
09d8fe6
fix: Do final replacement of emoji before sending the messaage
atomrc Aug 30, 2023
a2942da
Extract logic to separate plugins
atomrc Aug 30, 2023
c84a304
fix: Use emojies from the react-emoji-picker plugin
atomrc Aug 30, 2023
e6eea6e
fix import
atomrc Aug 30, 2023
267a1ac
Merge branch 'dev' into feature/WPB-460-new-input-bar
atomrc Aug 31, 2023
1fa8c67
refactor: extract typing indicator to hook
atomrc Aug 31, 2023
de911f2
fix: restore typing stop message when editor is blurred
atomrc Aug 31, 2023
2d699d6
minor improvements
atomrc Aug 31, 2023
3406e68
improve useTypingIndicator code
atomrc Aug 31, 2023
97bfa63
Merge branch 'dev' into feature/WPB-460-new-input-bar
atomrc Sep 4, 2023
95cae5d
fix: Restore esc to cancel replying
atomrc Sep 4, 2023
beaf068
refactor: extract message edition to a plugin
atomrc Sep 4, 2023
7b060d8
refactor: move code around
atomrc Sep 4, 2023
77f8910
fix: arrow press when emoji picker is opened
atomrc Sep 4, 2023
a300d25
move more handler to generic event handler
atomrc Sep 4, 2023
7a4d20e
refactor: Extract property getter into own hook
atomrc Sep 4, 2023
b916ec4
refactor: do not leak properties repo in the rich text editor
atomrc Sep 4, 2023
37748af
refactor: reorganize dependencies
atomrc Sep 4, 2023
1403edd
doc: add comment on emoji list
atomrc Sep 5, 2023
566c8d1
refactor: use text variable
atomrc Sep 5, 2023
1247d2e
Merge branch 'dev' into feature/WPB-460-new-input-bar
atomrc Oct 5, 2023
427bbb8
fix emoji list types
atomrc Oct 5, 2023
4a36da3
doc: explain the history saving delay
atomrc Oct 9, 2023
1246684
ugprade deps
atomrc Oct 9, 2023
9d065f2
Merge branch 'dev' into feature/WPB-460-new-input-bar
atomrc Oct 9, 2023
a410be7
fix emojji types
atomrc Oct 9, 2023
f04b2f7
fix tests
atomrc Oct 9, 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
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"@datadog/browser-logs": "^4.50.0",
"@datadog/browser-rum": "^4.50.0",
"@emotion/react": "11.11.1",
"@lexical/history": "0.12.2",
"@lexical/react": "0.12.2",
"@wireapp/avs": "9.4.14",
"@wireapp/core": "42.9.4",
"@wireapp/lru-cache": "3.8.1",
Expand All @@ -18,7 +20,7 @@
"countly-sdk-web": "23.6.1",
"date-fns": "2.30.0",
"dexie-batch": "0.4.3",
"emoji-picker-react": "^4.5.2",
"emoji-picker-react": "4.5.2",
"highlight.js": "11.8.0",
"http-status-codes": "2.3.0",
"jimp": "0.22.10",
Expand All @@ -27,6 +29,7 @@
"jszip": "3.10.1",
"keyboardjs": "2.7.0",
"knockout": "3.5.1",
"lexical": "0.12.2",
"libsodium-wrappers": "0.7.13",
"linkify-it": "4.0.1",
"long": "5.2.3",
Expand Down
21 changes: 4 additions & 17 deletions src/script/components/AppContainer/hooks/useTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,16 @@
*
*/

import {useCallback, useEffect} from 'react';

import type {WebappProperties} from '@wireapp/api-client/lib/user/data';
import {amplify} from 'amplify';

import {WebAppEvents} from '@wireapp/webapp-events';

import {useUserPropertyChange} from 'src/script/hooks/useUserProperty';

const THEMES_CLASS_PREFIX = 'theme-';

export type Theme = WebappProperties['settings']['interface']['theme'];

const listenedEvents = [WebAppEvents.PROPERTIES.UPDATE.INTERFACE.THEME, WebAppEvents.PROPERTIES.UPDATED];

function setTheme(theme: Theme) {
const classes = document.body.className
.split(' ')
Expand All @@ -39,16 +36,6 @@ function setTheme(theme: Theme) {
}

export function useTheme(getTheme: () => Theme) {
const updateTheme = useCallback(() => {
setTheme(getTheme());
}, [getTheme]);

updateTheme();

useEffect(() => {
listenedEvents.forEach(event => amplify.subscribe(event, updateTheme));
return () => {
listenedEvents.forEach(event => amplify.unsubscribe(event, updateTheme));
};
}, [updateTheme]);
setTheme(getTheme());
useUserPropertyChange(getTheme, WebAppEvents.PROPERTIES.UPDATE.INTERFACE.THEME, setTheme);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I needed the same logic for the "replaceEmoji" user preference, I extracted that logic to a more generic hook

}
3 changes: 2 additions & 1 deletion src/script/components/Conversation/Conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ export const Conversation: FC<ConversationProps> = ({
/>

<InputBar
conversationEntity={activeConversation}
key={activeConversation?.id}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will reset the input bar everytime we switch conversation

conversation={activeConversation}
conversationRepository={repositories.conversation}
eventRepository={repositories.event}
messageRepository={repositories.message}
Expand Down
Loading
Loading