Commit Graph

2881 Commits

Author SHA1 Message Date
Jarek Radosz e9356c2ec9
DEV: Fix "no-empty" lint (#24588) 2023-11-28 10:55:02 +01:00
Jarek Radosz 916e1371b3
DEV: Fix "ember/no-global-jquery" lint (#24586) 2023-11-28 10:53:38 +01:00
Jarek Radosz 22210a9c15
DEV: Fix "no-setter-return" lint (#24585) 2023-11-28 10:49:49 +01:00
Jarek Radosz cfa7dcaf0a
DEV: Remove unnecessary `await settled()` (#24584) 2023-11-28 10:45:20 +01:00
Jarek Radosz b2dfc320aa
DEV: Fix `super` calls in native chat classes (#24583) 2023-11-28 10:44:47 +01:00
Jarek Radosz a80e32fe75
DEV: Fix `no-extra-boolean-cast` lint (#24582) 2023-11-28 10:37:23 +01:00
Jarek Radosz 103fab37e3
DEV: Fix `no-unnecessary-curly-strings` lint rule (#24580) 2023-11-28 10:35:09 +01:00
Jan Cernik ac9e804dbe
FEATURE: Add threads support to chat archives (#24325)
This PR introduces thread support for channel archives. Now, threaded messages are rendered inside a `details` HTML tag in posts.

The transcript markdown rules now support two new attributes: `threadId` and `threadTitle`.

- If `threadId` is present, all nested `chat` tags are rendered inside the first one.
- `threadTitle` (optional) defines the summary content.

```
[chat threadId=19 ... ]
thread OM

  [chat ... ]
  thread reply
  [/chat]

[/chat]
```

If threads are split across multiple posts when archiving, the range of messages in each part will be displayed alongside the thread title. For example: `(message 1 to 16 of 20)` and `(message 17 to 20 of 20)`.
2023-11-27 15:47:35 +01:00
Renato Atilio 856ccb34e1
UX: fix new group chat cancel i18n label (#24554) 2023-11-25 16:54:07 -03:00
Jarek Radosz 68960b26be
DEV: Consistently use kebab-case in service lookups (#24552) 2023-11-25 18:10:10 +01:00
Joffrey JAFFEUX 2befff5101
FIX: nullifies target message id when not readable (#24540)
This bug was very reproducible when your last read was a message you didn't read and an admin would delete it. When coming back to the channel you would get a not found, in this case we will now reset last read and present you the last message of the channel.

We could be more fancy and  try to detect the next readable message but that would be more code and complexity for such a rare case.
2023-11-24 11:46:00 +01:00
chapoi 0b352ce7fb
UX: fix date time modal on mobile (#24531)
* UX: fix date time modal
2023-11-24 10:28:46 +01:00
Joffrey JAFFEUX d667c22171
FIX: prevents input to reset at wrong moment (#24536)
Before this fix we would reset the input two times:

- right before sending message
- and after it's been sent

The second one is actually not necessary, and more over with the server delay the user could have started typing a new message and that would clear it.
2023-11-24 10:59:48 +10:00
Joffrey JAFFEUX 57584c38c0
FIX: correctly uses private_email site setting in chat (#24528)
Chat will now check for the state of `SiteSetting.private_email` when sending the summary, when enabled, the mail will not display user information, channel information other than the ID and no message information, only the count of messages.
2023-11-23 15:54:22 +01:00
Jordan Vidrine fef14c004c
UX: Add category & section for syntax & BEM (#24516) 2023-11-22 17:44:04 -06:00
chapoi c766125fe8
UX: add BEM documentation to styleguide (#24512)
* UX: add BEM documentation to styleguide

* grammar fix

Co-authored-by: Jarek Radosz <jradosz@gmail.com>

* typo fix

Co-authored-by: Jarek Radosz <jradosz@gmail.com>

* add another hierarchy layer

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2023-11-22 16:04:19 +01:00
Joffrey JAFFEUX 17033d46c3
DEV: cooks messages synchronously (#24510)
Mentions and other post processing (like images) are still done asynchronously in the background. This should ensure reloading a channel while the message has not been processed yet doesn’t renders a blank message.

As a followup, we could probably simplify the staged message logic, given we have the new cooked on send.
2023-11-22 13:00:23 +01:00
Joffrey JAFFEUX 906caa63d7
FEATURE: implements drafts for threads (#24483)
This commit implements drafts for threads by adding a new `thread_id` column to `chat_drafts` table. This column is used to create draft keys on the frontend which are a compound key of the channel and the thread. If the draft is only for the channel, the key will be `c-${channelId}`, if for a thread: `c-${channelId}:t-${threadId}`.

This commit also moves the draft holder from the service to the channel or thread model. The current draft can now always be accessed by doing: `channel.draft` or `thread.draft`.

Other notable changes of this commit:
- moves ChatChannel to gjs
- moves ChatThread to gjs
2023-11-22 11:54:23 +01:00
Joffrey JAFFEUX 60535e8f3c
FIX: relies on mention mixin for size (#24503)
This commit fixes a regression where non highlighted mentions have an incorrect size.
2023-11-21 23:14:09 +01:00
Roman Rizzi 75e2c6b506
DEV: Pass the user who requested the summary to the strategy. (#24489)
This change allows the `discourse-ai` plugin to log the user who requested the summary in the `AiApiAuditLog`.
2023-11-21 13:27:27 -03:00
chapoi 18cbb37e23
UX: add height to non-highlighted mention (#24490) 2023-11-21 17:16:19 +01:00
Discourse Translator Bot c33a20cff6
Update translations (#24485) 2023-11-21 14:36:16 +01:00
Martin Brennan e37fb3042d
FEATURE: Admin plugin list redesign (#24363)
* Remove checkmark for official plugins
* Add author for plugin, which is By Discourse for all discourse
  and discourse-org github plugins
* Link to meta topic instead of github repo
* Add experimental flag for plugin metadata and show this as a
  badge on the plugin list if present

---------

Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
2023-11-21 09:37:11 +10:00
Jarek Radosz 89bd2b7df0
DEV: Remove unnecessary `js: true` options from specs (#24463) 2023-11-20 17:22:14 +01:00
Jarek Radosz 8968887e24
DEV: Fix various typos (#24461)
November 2023 edition
2023-11-20 16:49:49 +01:00
chapoi ba61ea17b6
UX: Revert grey search inputs (#24459)
* UX: search menu undo background

* UX: undo cmd-k bg + add focus
2023-11-20 13:45:59 +01:00
Martin Brennan 7cf59dc8fe
FIX: Invalid date when sending chat message in thread (#24455)
Fixes a minor issue where "Invalid date" is shown briefly
when sending a message in a chat thread. Change to use
`new Date()` instead like the channel staged message which
does not have this issue.
2023-11-20 10:21:39 +01:00
Joffrey JAFFEUX 2b7ecee06e
FIX: correctly highlights message on reply click (#24431) 2023-11-17 18:05:38 +01:00
Daniel Waterworth e34d2cfde4
DEV: Remove unnecessary fab! blocks (#24419) 2023-11-16 13:22:08 -05:00
chapoi f19fd75af9
UX: small alignment tweaks for chat thread list header (#24410) 2023-11-16 17:30:48 +01:00
Penar Musaraj f08e5c897e
UX: Apply decorators to small action posts (#24397) 2023-11-16 08:52:07 -05:00
Daniel Waterworth 0bc568f66d
FIX: Preload the right fields on categories (#24396) 2023-11-15 16:34:03 -06:00
Kris 91d5b66a9c
UX: html-safe dialog.message, clarify poll error (#24388) 2023-11-15 11:37:25 -05:00
Joffrey JAFFEUX ee2e1e04a8
UX: shorter copy link confirmation (#24380) 2023-11-15 11:30:27 +01:00
chapoi f72899401d
UX: refactor .d-modal to use BEM and improve styling (#23967)
This PR refactors the following:
* leaving all the CSS applied to the old `modal-body` classes in their respective files
* made  new clean styling for `.d-modal` and refactored the template to use the new BEM classes
  * `inner-`, `middle-`, `outer-` container classes are gone and replaced with simplified `wrapper` and `container` classes  
  * use standardised max-sizes with modifiers `-large` and `-max`
  * lighter backdrop,
  * min-width to prevent puny modals
  * other styling changes regarding padding, close button,…
* pulled out all modal overrides into a general `modal-overrides` file + cleanup of outdated CSS
* pulled out login and create account modal styling into their own file, cause it's such a big override 
* removed old general login.scss file for mobile & desktop
* only kept some remainders I don't want to touch in `app/assets/stylesheets/common/base/login.scss`
2023-11-15 10:14:47 +00:00
Kris e69f93e729
UX: use mention mixin for chat mentions (#24319) 2023-11-14 17:13:15 -05:00
Discourse Translator Bot c36ee3bc02
Update translations (#24366) 2023-11-14 14:30:11 +01:00
Godfrey Chan 3a0cdd2734 DEV: Convert components to gjs
- convert chat/channels-list -> gjs
- convert chat/chat-channel-archive-status -> gjs
- convert chat/chat-channel-card -> gjs
- convert chat/chat-channel-leave-btn -> gjs
- convert chat/chat-channel-metadata -> gjs
- convert chat/chat-channel-preview-card -> gjs
- convert chat/chat-channel-status -> gjs
- convert chat/chat-channel-unread-indicator -> gjs
- convert chat/chat-composer-dropdown -> gjs
- convert chat/chat-composer-message-details -> gjs
- convert chat/chat-composer-upload -> gjs
- convert chat/channel -> gjs
- convert chat/header -> gjs
- convert chat/back-link -> gjs
- convert chat/channel-title -> gjs
- convert chat/close-button -> gjs
- convert chat/full-page-button -> gjs
- convert chat/left-actions -> gjs
- convert chat/right-actions -> gjs
- convert chat/toggle-expand-button -> gjs
- convert chat/index -> gjs
- convert chat/chat-emoji-avatar -> gjs
- convert chat/chat-mention-warnings -> gjs
- convert chat/chat-message-in-reply-to-indicator -> gjs
- convert chat/chat-message-separator-date -> gjs
- convert chat/chat-message-separator-new -> gjs
- convert chat/chat-message-text -> gjs
- convert chat/chat-message-thread-indicator -> gjs
- convert chat/chat-notice -> gjs
- convert chat/chat-notices -> gjs
- convert chat/chat-replying-indicator -> gjs
- convert chat/chat-side-panel-resizer -> gjs
- convert chat/chat-side-panel -> gjs
- convert chat/chat-skeleton -> gjs
- convert chat/chat-upload-drop-zone -> gjs
- convert chat/chat-upload -> gjs
- convert chat/chat-user-display-name -> gjs
- convert chat/export-messages -> gjs
- convert chat/button -> gjs
- convert chat/separator -> gjs
- convert chat/avatar -> gjs
- convert chat/error -> gjs
- convert chat/info -> gjs
- convert chat/left-gutter -> gjs
- convert chat/archive-channel -> gjs
- convert chat/channel-summary -> gjs
- convert chat/delete-channel -> gjs
- convert chat/edit-channel-name -> gjs
- convert chat/move-message-to-channel -> gjs
- convert chat/thread-settings -> gjs
- convert chat/toggle-channel-status -> gjs
- convert chat/mention_without_membership -> gjs
- convert chat/scroll-to-bottom-arrow -> gjs
- convert chat/item -> gjs
- convert chat/unread-indicator -> gjs
- convert chat/user-card-button -> gjs
- convert chat/full-page-chat -> gjs
- convert chat/reviewable-chat-message -> gjs
- convert chat/chat -> gjs
- convert chat/toggle-channel-membership-button -> gjs
- convert chat/chat-preferences -> gjs
2023-11-14 10:53:54 +00:00
Godfrey Chan e1f74fcb4b DEV: prep for gjs conversion: rename .js -> .gjs
Some of these files are quite small, and if we rename them in the same
commit where we inlined the template, Git may choose to see them as
different files. This commit forces Git to recognize the rename, which
will preserve the lineage of the refactored files.
2023-11-14 10:53:54 +00:00
Joffrey JAFFEUX 016e91380c
FIX: correct online indicator for non interactive (#24364)
When introducing non interactive user avatar, the `chat-user-avatar__container` div has been omitted, which prevented the css to correctly apply.
2023-11-14 11:46:50 +01:00
Joffrey JAFFEUX b1cff6de6a
UX: shows editing title only on settings page (#24330) 2023-11-14 11:34:54 +01:00
Joffrey JAFFEUX a0769f6f43
UX: improves search of message creator
- correctly show unread indicator
- handles disabled user correctly
- do not show new-group-chat when filtering
2023-11-13 22:03:47 +01:00
David Taylor f395130429
FEATURE: Configure poll 'public' default via site setting (#24348)
Followup to 7e37e3e824
2023-11-13 18:54:21 +00:00
Kris 797da5870b
FEATURE: remove category badge style options, set bullet style as default (#24198) 2023-11-13 10:46:15 -05:00
Jordan Vidrine 70b72ee893
FIX: Hide chat message header with new argument (#24346) 2023-11-13 09:05:18 -06:00
Joffrey JAFFEUX 7f3f682f67
DEV: removes dead code (#24345) 2023-11-13 15:18:15 +01:00
Joffrey JAFFEUX 208491fa00
DEV: uses alphanumeric to avoid flakey specs (#24344)
Faker text with quotes or thread dots for example would cause issues in tests due to cooking.
2023-11-13 14:54:26 +01:00
Godfrey Chan 8444c865e9
DEV: remove slightly less trivial `{{action}}` usages (#24289)
Follow-up to #24278 that is slightly less trivial.

* Some were "trivial" usages that were missed in the previous PR because the same file that had at least one other non-trivial usage.
* These involve extra arguments or inheritance but I have checked that they seem correct.
2023-11-13 13:29:20 +01:00
David Taylor 7e37e3e824
UX: Create polls with public=true by default (#24332)
In the vast majority of cases, people want poll voters to be public. Previously, the checkbox for this was hidden behind the 'show advanced' settings in the poll builder UI.

This commit makes three changes to improve the experience:

1. Add `public=true|false` to poll markup (previously it would only be added when true

2. Bring the 'public' switch outside the 'show advanced' section for improved visibility

3. Change the default to 'true'
2023-11-13 09:07:51 +11:00
David Taylor 0878dde213
DEV: Modernise highlightjs loading (#24197)
- Remove vendored copy
- Update Rails implementation to look for language definitions in node_modules
- Use webpack-based dynamic import for hljs core
- Use browser-native dynamic import for site-specific language bundle (and fallback to webpack-based dynamic import in tests)
- Simplify markdown implementation to allow all languages into the `lang-{blah}` className
- Now that all languages are passed through, resolve aliases at runtime to avoid the need for the pre-built `highlightjs-aliases` index
2023-11-10 20:39:48 +00:00