Commit Graph

1161 Commits

Author SHA1 Message Date
7da33ad6ba UX: user threads styling tweaks 2023-12-13 14:10:52 +01:00
7d0562f10e Update translations (#24848) 2023-12-12 14:23:51 +01:00
875966cc9e FIX: ensures border and shadow of header is visible (#24847) 2023-12-12 14:18:36 +01:00
41942357ed DEV: Use class attribute instead of @class arg (#24804) 2023-12-12 13:09:05 +01:00
fca67117ee FIX: incorrect spacing with my threads on ios (#24843)
- sticky doesn't work well with overflow: hidden parents. These overflows were used to hide other issues which shouldn't exist anyways. If it causes issues we should fix the root cause.

- our `--header-offset` is changing a lot on safari while scrolling, sometimes with very unexpected value like: negative or very high value, which causes the navbar to appear at unexpected positions for few ms, this commit is using the value of the header on insert and not changing it after, it shouldn't cause any issue.
2023-12-12 11:32:36 +01:00
22d8978eb4 FIX: increase default max length of chat message excerpts (#24842)
Increases the default max length of message excerpts to allow for longer titles in threads index.
2023-12-12 18:24:07 +08:00
223e413a6c DEV: Render glimmer notification items for user notification list (#24802)
This removes the widget notifications list and renders the glimmer user menu notification items instead.
2023-12-11 11:04:43 -06:00
4904c2f11b DEV: Skip chat transcript spec (#24819) 2023-12-11 13:09:22 -03:00
dacb06842e FIX: allow to click on thread indicator (#24821)
We can also now control tabindex, and other html attributes, which allows to lick on the thread indicator but not tab to it for example.

By default the tabindex will be 0.
2023-12-11 16:35:29 +01:00
a7a4aaa6b9 FIX: ensures side panel is closed (#24822)
When navigating to /chat/threads we were not closing the side panel. It would not show as the route doesn't support it, but after if we would open a channel from the sidebar it would open the channel with an empty opened sidepanel .
2023-12-11 16:35:18 +01:00
2e25e95ce1 UI: ensures emojis are correctly aligned in reactions (#24814)
Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
2023-12-11 14:29:16 +01:00
72872297f5 FIX: Allow quoting thread's original message (#24773) 2023-12-11 09:58:00 -03:00
54724f7c09 UX: allow users to click thread title to open it (#24816) 2023-12-11 13:54:00 +01:00
549513e25d DEV: Unskip chat transcript spec (#24778) 2023-12-11 09:46:46 -03:00
cf9bef0499 FIX: Navigating out of thread shows other unread threads (#24693)
* FIX: Navigating out of thread shows other unread threads

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2023-12-11 09:44:50 -03:00
8e373bc167 UX: prevent chat channel avatar from getting squished (#24815) 2023-12-11 09:52:12 +01:00
09277bc543 FEATURE: my threads page (#24771)
This commit adds a new "My threads" link in sidebar and drawer. This link will open the "/chat/threads" page which contains all threads where the current user is a member. It's ordered by activity (unread and then last message created).

Moreover, the threads list of a channel page is now showing every threads of a channel, and not just the ones where you are a member.
2023-12-11 07:38:07 +01:00
694b5f108b DEV: Fix various rubocop lints (#24749)
These (21 + 3 from previous PRs) are soon to be enabled in rubocop-discourse:

Capybara/VisibilityMatcher
Lint/DeprecatedOpenSSLConstant
Lint/DisjunctiveAssignmentInConstructor
Lint/EmptyConditionalBody
Lint/EmptyEnsure
Lint/LiteralInInterpolation
Lint/NonLocalExitFromIterator
Lint/ParenthesesAsGroupedExpression
Lint/RedundantCopDisableDirective
Lint/RedundantRequireStatement
Lint/RedundantSafeNavigation
Lint/RedundantStringCoercion
Lint/RedundantWithIndex
Lint/RedundantWithObject
Lint/SafeNavigationChain
Lint/SafeNavigationConsistency
Lint/SelfAssignment
Lint/UnreachableCode
Lint/UselessMethodDefinition
Lint/Void

Previous PRs:
Lint/ShadowedArgument
Lint/DuplicateMethods
Lint/BooleanSymbol
RSpec/SpecFilePathSuffix
2023-12-06 23:25:00 +01:00
8623631a06 DEV: Fix random typos (#24756) 2023-12-06 22:25:26 +01:00
6eb1cadb73 DEV: Fix RSpec/SpecFilePathSuffix / enable 3 chat spec files (#24750)
* RSpec/SpecFilePathSuffix
* removes failing specs
* More specific selectors?

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2023-12-06 22:25:11 +01:00
6a66dc1cfb DEV: Fix Lint/BooleanSymbol (#24747) 2023-12-06 13:19:09 +01:00
138bf486d3 DEV: Fix Lint/DuplicateMethods (#24746) 2023-12-06 13:18:34 +01:00
4280c01153 DEV: Fix Lint/ShadowedArgument (#24733) 2023-12-06 13:16:10 +01:00
78c2f116e0 DEV: skip flaky upload spec for large image thumbnails (#24745) 2023-12-06 19:08:56 +08:00
6dd4937b69 update matchers to improve test suite perf for upload specs (#24744)
This change speeds up our upload specs by avoiding Capybara's default_max_wait_time.
2023-12-06 18:02:55 +08:00
8b46dc8bb5 FEATURE: Add thumbnails for chat image uploads (#24328)
Introduces the concept of image thumbnails in chat, prior to this we uploaded and used full size chat images within channels and direct messages.

The following changes are covered:
- Post processing of image uploads to create the thumbnail within Chat::MessageProcessor
- Extract responsive image ratios into CookedProcessorMixin (used for creating upload variations)
- Add thumbnail to upload serializer from plugin.rb
- Convert chat upload template to glimmer component using .gjs format
- Use thumbnail image within chat upload component (stores full size img in orig-src data attribute)
- Old uploads which don't have thumbnails will fallback to full size images in channels/DMs
- Update Magnific lightbox to use full size image when clicked
- Update Glimmer lightbox to use full size image (enables zooming for chat images)
2023-12-06 14:59:18 +08:00
30d5e752d7 DEV: Revert guardian changes (#24742)
I took the wrong approach here, need to rethink.

* Revert "FIX: Use Guardian.basic_user instead of new (anon) (#24705)"

This reverts commit 9057272ee242b3bc977e50977b4142066c36c05d.

* Revert "DEV: Remove unnecessary method_missing from GuardianUser (#24735)"

This reverts commit a5d4bf6dd28a8304ccd519536f33bd4a13232ed4.

* Revert "DEV: Improve Guardian devex (#24706)"

This reverts commit 77b6a038bae010c9e9e630a137f9ccd570f60784.

* Revert "FIX: Introduce Guardian::BasicUser for oneboxing checks (#24681)"

This reverts commit de983796e1b66aa2ab039a4fb6e32cec8a65a098.
2023-12-06 16:37:32 +10:00
ac60b9fe72 DEV: Skip chat test (#24739)
This consistently fails on core now, see
https://github.com/discourse/discourse/actions/runs/7109919490/job/19355591619?pr=24738

Error: QUnit Test Failure: Browser Id 2 - Discourse Chat | Component | chat message collapser images: escapes link
not ok 444 Chrome 120.0 - [58 ms] - Browser Id 2 - Discourse Chat | Component | chat message collapser images: escapes link
    ---
        actual: >
            false
        expected: >
            true
        stack: >

Expected value is %3Cscript%3Esomeeviltitle%3C/script%3E and actual value is
&lt;script&gt;someeviltitle&lt;/script&gt;
2023-12-06 13:58:13 +10:00
9057272ee2 FIX: Use Guardian.basic_user instead of new (anon) (#24705)
c.f. de983796e1b66aa2ab039a4fb6e32cec8a65a098

There will soon be additional login_required checks
for Guardian, and the intent of many checks by automated
systems is better fulfilled by using BasicUser, which
simulates a logged in TL0 forum user, rather than an
anon user.

In some cases the use of anon still makes sense (e.g.
anonymous_cache), and in that case the more explicit
`Guardian.anon_user` is used
2023-12-06 11:56:21 +10:00
cae2b83af8 Update translations (#24716) 2023-12-05 14:39:08 +01:00
c5aa6b5e16 FIX: correctly update replies_count on chat_threads (#24711)
The previous query would look at the existing messages, count them, and update the associated thread.

But, if for some reason messages were **ALL** deleted without updating the `replies_count`, then the query wouldn't find any message, and wouldn't update any thread's `replies_count`.
2023-12-05 13:46:58 +01:00
094d597ec8 FIX: increments message version when processed (#24713)
Incrementing version, ensures the message will re-play decorators.

Also removes a debugging line which had been forgotten.
2023-12-05 12:34:19 +01:00
c7667f791e DEV: Fix chat notifier deprecation warnings from job arguments (#24708)
We're seeing some deprecation warnings in production. This is because we're passing a raw Ruby timestamp, which gets stringified implicitly when written to Redis. As per #15842, this conversion needs to be done explicitly.
2023-12-05 18:03:30 +08:00
c805bcc7ba DEV: adds a chat-join-channel-button outlet (#24698)
This outlet allows to redefine the button displayed when asking the user to join a channel.

The following outletArgs are sent to the outlet:

```
onJoinChannel
channel
icon
title
label
disabled
```
2023-12-04 18:11:33 +01:00
0af8bbd378 FIX: Multiple nested threads and duplicated messages in chat transcripts (#24685) 2023-12-04 12:43:04 -03:00
d636ff216a DEV: Resolve transitionTo deprecation in chat-channel route (#24668) 2023-12-01 16:01:59 +00:00
bcca1692c6 FIX: disables tooltip on desktop message menu’s reaction (#24650) 2023-11-30 19:41:28 +01:00
a7a7d8e41e DEV: correctly uses link to message endpoint in spec (#24652)
- correctly uses link to message endpoint in spec
- correctly uses "chat with"
2023-11-30 19:33:41 +01:00
4fa1b0e978 FIX: show leave channel notice only on group channels (#24653) 2023-11-30 19:24:14 +01:00
a1ae9f6ab0 FIX: correctly show "chat with" and not "chat in" for users (#24651)
Prior to this fix direct message would always show "Chat in ..." when hovering the channel even if you were hovering a direct message channel with another user (or yourself).

We will now correctly show:

- `Chat in ...` for group channels
- `Chat with ...` for direct message channels
2023-11-30 19:02:19 +01:00
a1690e0401 DEV: removes dead code (message_link) (#24648)
Linking to a message ID is now handled by the frontend router: `chat.channel.near-message`
2023-11-30 11:13:37 +01:00
0b65aa8b77 DEV: ensures we have error message before message check (#24647)
Previously the spec could be flakey as the long message could show on the screen while we await for processing. Now we will first check to have the error message on screen, at this point the erroneous message should never be visible.
2023-11-30 10:55:05 +01:00
1b022457ad UX: chat leave info (#24645)
* UX: add info-warning to leave button

* Scope to groupchat

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2023-11-30 10:13:37 +01:00
dc8a727b3f COPY: secure media -> secure uploads (#24643)
Fixing up the last few holdouts
2023-11-30 14:58:55 +10:00
384a8b17a1 FIX: leaving a group channel should destroy membership (#24631)
In other kind of channels we will only unfollow but for group channels we don't want people to keep appearing in members list.

This commit also creates appropriate services:
- `Chat::LeaveChannel`
- `Chat::UnfollowChannel`

And dedicated endpoint for unfollow: `DELETE /chat/api/channels/:id/memberships/me/follows`
2023-11-29 17:48:14 +01:00
7cac167928 DEV: Fix "ember/no-empty-glimmer-component-classes" lint (#24629) 2023-11-29 15:14:30 +01:00
c90772fd3a Update translations (#24599) 2023-11-29 10:41:27 +01:00
Sam
b09422428d DEV: update syntax tree to latest (#24623)
update format to latest syntax tree
2023-11-29 16:38:07 +11:00
ee5bdb3436 DEV: refactor flag message (#24604)
- Uses a chat service: `Chat::FlatMessage`
- Moves logic inside chat api controllers
- Create a javascript chat api helper: `chatApi.flagMessage(...)`
2023-11-28 18:24:09 +01:00
de0c761516 DEV: Skip flaky chat transcript specs (#24607) 2023-11-28 14:13:25 -03:00