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

#378 Emoji suggestions #546

Merged
merged 7 commits into from
Jan 14, 2020
Merged

#378 Emoji suggestions #546

merged 7 commits into from
Jan 14, 2020

Conversation

Mavrin
Copy link
Collaborator

@Mavrin Mavrin commented Jan 11, 2020

No description provided.

@Mavrin Mavrin changed the title #378 [POC] emoji suggestion #378 Emoji suggestions Jan 12, 2020
@Mavrin Mavrin marked this pull request as ready for review January 12, 2020 14:01
@Mavrin Mavrin requested a review from umputun as a code owner January 12, 2020 14:01
import { StaticStore } from '@app/common/static_store';
import { useEffect, useRef } from 'preact/hooks';
import '@github/text-expander-element';
import styles from './text-expander.module.pcss';
Copy link
Collaborator

@akellbl4 akellbl4 Jan 12, 2020

Choose a reason for hiding this comment

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

I realized that we should use BEM because it gives the opportunity to customize interface just by including your own CSS file.

Otherwise, we should provide permanent class names for it.

I think we can move to css-modules but we need to change the whole CSS structure. And I think it can be convenient to change theming by setting root theme class besides using theme hook in every component. But it is a theme for a big issue. I think we can discuss it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got it. I will make permanent class. About theme I think we should extract all color variable to css variables, but before we should drop support IE11 and provide some api to set that colors.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Mavrin definitely, I support it. It is exactly what I have in my mind.
I hope @umputun will support this decision.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, we can move to css-modules but with external permanent class names for customization. I think It will make the bundle smaller.

Copy link
Owner

Choose a reason for hiding this comment

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

if dropping IE11 is the decision I supposed to support - sure, go for it. My understanding - IE11 is not that popular anymore (2% ?) and we can drop it safely

Copy link
Collaborator

Choose a reason for hiding this comment

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

@umputun yep, it is less than 2% (https://caniuse.com/usage-table)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Even Jira will remove support ie 11 https://blog.developer.atlassian.com/retiring-ie11-support-for-atlassian-cloud-server-and-data-center-products/. Also we can make fallback only on light theme.

Copy link
Owner

Choose a reason for hiding this comment

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

fine with me

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Now class will be look like remark42__text-expander-module__suggesterItem

frontend/app/components/comment-form/text-expander.tsx Outdated Show resolved Hide resolved
frontend/app/components/comment-form/text-expander.tsx Outdated Show resolved Hide resolved
return Promise.resolve({ matched: false });
}
const fragment = document.createDocumentFragment();
render(<SuggestionList theme={theme} items={emojiList.slice(0, 5)} />, fragment);
Copy link
Collaborator

@akellbl4 akellbl4 Jan 12, 2020

Choose a reason for hiding this comment

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

I think the first 5 emojis are not relevant for daily use. I think we can choose "top 5 emojis" for first appear.
Screenshot 2020-01-12 at 19 25 43

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is good idea. It can be improved in the future. I don't know where I can this information, look like it depend on user.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I found the rating, but I think we need to pick the most neutral of it. Like laughing, smiling, clapping, thumbs up or something like suggesting github/facebook for comment reaction.
https://home.unicode.org/emoji/emoji-frequency/

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or it can be configurated :)

Copy link
Owner

Choose a reason for hiding this comment

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

just an idea: can we save the latest selections and display as defaults? As an initial, predefined default we can pick some from the list above.

@@ -15,6 +15,7 @@ import { SubscribeByRSS } from './__subscribe-by-rss';

import MarkdownToolbar from './markdown-toolbar';
import TextareaAutosize from './textarea-autosize';
import { TextExpander } from './text-expander';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we can make a chunk and load it only when emoji is enabled?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

expander component about 3k (https://bundlephobia.com/result?p=@github/text-expander-element@1.0.1). node-emojis will load only on first search. Of course it can be improved. But in current state will be better to move comment form to separate chunk. But it out of the scope this pull request.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes of course.

Copy link
Collaborator

@akellbl4 akellbl4 left a comment

Choose a reason for hiding this comment

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

LGTM ;)

@umputun
Copy link
Owner

umputun commented Jan 14, 2020

visually it's working nice, thx. I'm going to merge it as is and in case if you going to modify the default suggesting pls make a separate PR for this.

@umputun umputun merged commit 17be003 into umputun:master Jan 14, 2020
@Mavrin Mavrin deleted the emoji_suggestion branch January 14, 2020 11:03
@paskal paskal added this to the v1.5 milestone Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants