Commit Graph

6193 Commits

Author SHA1 Message Date
Penar Musaraj
c6ead3f5c4
FEATURE: Allow users to confirm session with passkeys (#24337)
We ask users to confirm their session if they are making a sensitive
action, such as adding/updating second factors or passkeys. This
commit adds the ability to confirm sessions with passkeys as an option
to the password confirmation.
2023-11-14 11:38:10 -05:00
Kris
797da5870b
FEATURE: remove category badge style options, set bullet style as default (#24198) 2023-11-13 10:46:15 -05:00
Joffrey JAFFEUX
ab832cc865
FEATURE: introduces group channels (#24288)
Group channels will allow users to create channels with a name and invite people. It's possible to add people even after creation of the channel. Removing users is not yet possible but will be added in the near future.

Technically a group channel is `direct_message_channel` with a group attribute set to true on its direct message (chatable). This model might evolve in the future but offers much flexibility for now without having to rely on a complex migration.

The commit essentially consists of:
- a migration to set existing direct message channels with more than 2 users to a group
- a new message creator which allows to search, add members, and create groups
- a new `AddUsersToChannel` service
- a modified `SearchChatable` service
2023-11-10 11:29:28 +01:00
Penar Musaraj
6183d9633d SECURITY: Limit height of pre/svg elements
Ensures posts cannot have SVG or PRE elements that are too tall.
2023-11-09 13:39:13 +11:00
Jordan Vidrine
37fda6d479
FIX: Adjust border radius (#24301) 2023-11-08 18:36:30 -06:00
Jarek Radosz
daf7608905
DEV: Migrate reorder-categories to the new modal API (#24209) 2023-11-08 16:28:53 +01:00
Kris
1185458b17
UX: adjust bulk selection position to avoid edits (#24231) 2023-11-08 08:08:33 -06:00
Jordan Vidrine
5e3a54eb74
prettier (#24295) 2023-11-08 08:07:04 -06:00
Roman Rizzi
3c29a84d98
DEV: Add support for radar charts when displaying reports. (#24274)
Reports can have the radar type, which will get rendered by the `admin-report-radar` component.
2023-11-08 10:48:12 -03:00
chapoi
fe0b0edf57
UX: Invite signup page styling + separation (#24293)
* UX: separate invite-signup styling

* UX: invite page centering

* remove old invites-show css

* UX: invite signup page – mobile

* remove class references in general file

* add styling for instructions
2023-11-08 12:57:06 +01:00
Penar Musaraj
a1c1f7ce75
DEV: Standardize session confirmation prompt (#24212)
Switches to using a dialog to confirm a session (i.e. sudo mode for
account changes where we want to be extra sure the current user is who
they say they are) to match what we do with passkeys.
2023-11-07 11:26:10 -05:00
Kris
d5e4b85e82
UX: render reviewable table with cooked styles (#24230) 2023-11-03 16:29:20 -04:00
David Battersby
b2ec92390a
FIX: remove background image from lightbox backdrop (#24225)
This change removes the background image (which is the small version of the uploaded image) from the lightbox backdrop.

Now a solid color (dark grey) is used for the backdrop so we can distinguish between the lightbox's head, body and footer.
2023-11-03 16:10:04 +08:00
Jordan Vidrine
2cda894e00
UX: Small tweaks to recent search changes (#24220) 2023-11-02 14:33:41 -05:00
chapoi
c38bbdf88a
UX: update search menu styling to cmd-k style (#24181)
* UX: update search menu styling to cmd-k style

* put back focus style
2023-11-02 06:55:58 +01:00
Martin Brennan
77a009397b
FIX: Broken hashtags on embed and publish pages (#24210)
Since we don't have icons or access to the JS that transforms
hashtag icon placeholders into their proper icons and colours
on embed and publish pages, we need to at least show _something_
and make sure the hashtags are not totally broken on these pages.
2023-11-02 11:43:55 +10:00
Martin Brennan
b53449eac9
DEV: Automatically generate all admin links for app for new sidebar (#24175)
NOTE: Most of this is experimental and will be removed at a later
time, which is why things like translations have not been added.

The new /admin-revamp UI uses a sidebar for admin nav. This initial
step adds a script to generate a map of all the current admin nav
into a format the sidebar to read. Then, people can experiment
with different changes to this structure.

The structure can then be edited from `/admin-revamp/config/sidebar-experiment`,
and it is saved to local storage so people can visually experiment with different ways
of showing the admin sidebar links.
2023-11-02 10:34:37 +10:00
Jordan Vidrine
88bb5fa773
FIX: Adjust placement and animation of labels for custom user fields (#24201) 2023-11-01 14:51:40 -05:00
David Taylor
9c01937ec6
FIX: Use correct location for wizard background image (#24183)
Files in `/assets/*` are given digests by sprockets, and we don't have any infrastructure for accessing those URLs in SCSS files. Instead, we should put this image with other similar images in the `public/images` directory, and then use the `absolute-image-url` helper so that it correctly uses the CDN where available.
2023-10-31 15:57:47 +00:00
Jarek Radosz
1c8eaa9390
DEV: QUnit CSS tweaks (#24180)
1. Prevent a white background flash
2. Dark-mode support for two more inputs
2023-10-31 14:53:42 +01:00
chapoi
05e810e3bf
UX: update composer border colour (#24176) 2023-10-31 13:51:10 +01:00
Kris
97f4df6d63
UX: convert share modal margin to gap (#24157) 2023-10-30 12:45:07 -04:00
Kris
923fe3d082
UX: fix btn-flat focus style (#24156) 2023-10-30 12:44:38 -04:00
Kris
68728806c1
UX: impove badge granted spacing with grid (#24150) 2023-10-30 10:55:01 -04:00
Jarek Radosz
351cbab1a8
DEV: Migrate create-account to the new modal API (#24098)
plugin/theme-breaking changes:

1. `controller:create-account` is gone (use `component:modal/create-account` in modifyClass, **if** absolutely necessary)
2. `create-account-body` css class is gone (target `.d-modal.create-account` or any of the inner classes: `.modal-outer-container`, `.modal-middle-container`, `.modal-inner-container`, or `.modal-body`)
2023-10-30 11:01:09 +01:00
Jarek Radosz
125ab9f31d
UX: Update user field styling in the create-account modal (#24091)
1. Removes accidental bold from `text` and `multiselect` labels/placeholders
2. Adds the animated label/placeholder combo to `multiselect`
3. Makes the `multiselect` placeholder lighter to match other fields
4. Makes the `dropdown` values darker to match other fields
5. Removes the extra 5px spacing before `confirmation` fields
2023-10-25 13:03:20 +02:00
Joffrey JAFFEUX
043b4a4187
FIX: replaces data-tooltip usage by <DTooltip /> (#24062)
As much as possible I would like us to avoid having to go the with a global event listener on click/mouseover. For now I have removed all cases of `data-tooltip`, if we clearly identify a use case of a global event listener we might reconsider this.

The following changes are also included:
- by default tooltips won't attempt to focus first focusable element anymore
- tooltip will now use `cursor: pointer` by default
- a new service has been introduced: `InternalTooltip` which is responsible to track the current instance displayed by a `<DTooltip />`. Portal elements when replaced are not properly cleaned and I couldn't figure out a way to have a proper hook to ensure the previous `DTooltipInstance` is properly set as not expanded; this problem was very visible when using a tooltip as interactive and hovering another tooltip, which would replace the interactive tooltip as not closed.
2023-10-23 21:09:02 +02:00
chapoi
e2d9117378
UX: change to input field + label styling (#24060) 2023-10-23 17:36:36 +02:00
Penar Musaraj
f9eec939e5
UX: Fixes for mobile "create account" modal (#24043)
- Don't include login buttons on mobile
- Fix padding/spacing
2023-10-23 10:48:46 -04:00
Joffrey JAFFEUX
552cf56afe
DEV: toasts improvements (#24046)
- more subtle animation when showing a toast
- resumes auto close when removing the mouse from the toast
- correctly follows reduced motion
- uses output with role status as element: https://web.dev/articles/building/a-toast-component
- shows toasts inside a section element
- prevents toast to all have the same width
- fixes a bug on mobile where we would limit the width and the close button wouldn't show correctly aligned

I would prefer to have tests for this, but the conjunction of css/animations and our helper changing `discourseLater` to 0 in tests is making it quite challenging for a rather low value. We have system specs using  toasts ensuring they show when they should.
2023-10-23 15:23:10 +02:00
Ella E
f42f54d58f
FIX: change max-width size to make the background image expand the same width as the browser (#24004) 2023-10-19 11:19:13 -06:00
Kris
7b6e32c238
UX: move global option to sidebar modal footer, shorten translation (#24024) 2023-10-19 12:20:03 -04:00
Penar Musaraj
00aa81a271
UX: Fix form template mobile issues (#24019)
- allows scrolling on mobile when form template is present
- hides upload, preview buttons on mobile
2023-10-19 11:09:34 -04:00
Kris
d7474e643a
UX: video placeholder icon should always be white (#23990) 2023-10-19 09:35:43 -04:00
Martin Brennan
9ef3a18ce4
DEV: Add new experimental admin UI route and sidebar (#23952)
This commit adds a new admin UI under the route `/admin-revamp`, which is
only accessible if the user is in a group defined by the new `enable_experimental_admin_ui_groups` site setting. It
also adds a special `admin` sidebar panel that is shown instead of the `main`
forum one when the admin is in this area.

![image](https://github.com/discourse/discourse/assets/920448/fa0f25e1-e178-4d94-aa5f-472fd3efd787)

We also add an "Admin Revamp" sidebar link to the community section, which
will only appear if the user is in the setting group:

![image](https://github.com/discourse/discourse/assets/920448/ec05ca8b-5a54-442b-ba89-6af35695c104)

Within this there are subroutes defined like `/admin-revamp/config/:area`,
these areas could contain any UI imaginable, this is just laying down an
initial idea of the structure and how the sidebar will work. Sidebar links are
currently hardcoded.

Some other changes:

* Changed the `main` and `chat` panels sidebar panel keys to use exported const values for reuse
* Allowed custom sidebar sections to hide their headers with the `hideSectionHeader` option
* Add a `groupSettingArray` setting on `this.siteSettings` in JS, which accepts a group site setting name
  and splits it by `|` then converts the items in the array to integers, similar to the `_map` magic for ruby
  group site settings
* Adds a `hidden` option for sidebar panels which prevents them from showing in separated mode and prevents
  the switch button from being shown

---------

Co-authored-by: Krzysztof Kotlarek <kotlarek.krzysztof@gmail.com>
2023-10-19 14:23:41 +10:00
Penar Musaraj
6837888b8b
UX: Update highlight.js styles (#23999) 2023-10-18 19:07:39 -04:00
Ella E
bec53210e8
DEV: remove unused root max width in wizard (#23996) 2023-10-18 16:25:04 -06:00
Ella E
7af291b40d
UX: Wizard static confetti (#23973)
* UX: add static confetti bacgkround image on wizard steps

* DEV: slow down speed animation for confetti

* DEV: compress image file size

* UX: use an image that has transparent background

* DEV: use correct image file name
2023-10-18 15:19:00 -06:00
Penar Musaraj
a125c9e63e
UX: Minor fixes to passkey handling (#23947)
- don't try to guess the name of the manager (too many options)
- improve error message when registration is not allowed
- output error in console when registration fails
- minor fix to rename dialog layout
- hides action buttons in DiscourseHub (because adding passkeys there is not possible)
- adds acceptance test to ensure action buttons are hidden for admins seeing another user's profile
2023-10-18 11:46:51 -04:00
Kris
31797ebc40
UX: improve handling of long theme names in admin (#23963) 2023-10-18 09:41:21 -04:00
Bianca Nenciu
2e68ead45b
FEATURE: Use async search for category dropdowns (#23774)
This commit introduces a new endpoint to search categories and uses it
instead of the categories map that is preloaded using SiteSerializer.

This feature is enabled only when the hidden site setting
lazy_load_categories is enabled and should be used only on sites with
many categories.
2023-10-17 19:46:54 +03:00
Penar Musaraj
87a635ed32
UX: Fix icon color for video placeholder (#23957)
Also adds a small effect on hover.
2023-10-17 10:25:57 -04:00
Jeff Wong
d208396c5c
UX: improve touch, swipe, panning performance on mobile menus (#23775)
PERF: improve touch, swipe, panning performance on mobile menus
---

* stop event propagation on swipe events: other touch events were stealing a huge amount of time here. Stop event
propagation when handling pan events.
* animate with [web animations api](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API/Using_the_Web_Animations_API)
* prefer translate3d to hint for gpu rendering.
* query document for elements only on start move event, not on subsequent move
events
* remove unused calculations for directioned velocity and distance: all swipe/pan elements function in x/y direction only.
* re-implement scroll locking behavior.

re-implemented scroll lock behavior
---

With stop event propagation, we need to re-implement scroll locking on menu swipes.
Previously, this was using onTouchMove which was costly.

We may now use styling with overflow-y:hidden to lock scroll behavior.

overflow:hidden on html/body elements is now supported by iOS as of 2022
https://bugs.webkit.org/show_bug.cgi?id=153852
https://bugs.webkit.org/show_bug.cgi?id=220908

UX: improve swipe
---

Some improvements to get gestures and swipes feeling a little more polished.

This focuses on end gesture, and how we transfer it to a css animation to
complete a menu open/close action.

Multitouch: events may pan, scroll, and zoom - especially on iOS safari.
Cancelling the swipe event allows for a more pleasant zooming experience.

* ease-out on menus opening, linear on close
* calculate animation duration for opening and closing,
attempt to better transfer user swipe velocity to css animation.
* more timely close/open and cleanup from calculated animation timing.
* add animation to closing menus on cloak tap
* correctly animate menus with ease-in and ease-out
* add swipe cancel event on multitouch event

DEV
---

* lean on promises

js animations api gives us promises to listen to. Update test waiters
to use waitForPromise from @ember/test-waiters instead of reigster/unregister.

* convert swipe mixin to its own class.

Convert swipe callbacks to custom events on the element.
Move shared functions for max animation time and close logic to
new shared class.

swipe-events lib uses custom events to trigger callbacks, rather than assuming
implemented hard coded function from the mixin's base class. Custom events are
triggered from the bound element as swipestart, swipeend, swipe

Add shared convenience functions for swipe events so they can be more easily
shared.

A client receives an initial swipe event and can check some state to see if it
wants to handle the swipe event and if it doesn't, calling
`event.preventDefault();` will prevent `swipe` and `swipeend` events from firing
until another distinct swipestart event is fired. Swipe events will auto-cancel on multitouch.

The scroll lock has also exposed as its own utility class.
2023-10-16 11:27:00 -07:00
Penar Musaraj
1a70817962
DEV: Add UI for passkeys (3/3) (#23853)
Adds UI elements for registering a passkey and logging in with it. The feature is still in an early stage, interested parties that want to try it can use the `experimental_passkeys` site setting (via Rails console). 

See PR for more details. 
---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2023-10-13 12:24:06 -04:00
Martin Brennan
9762e65758
FEATURE: Add Revise... option for queued post reviewable (#23454)
This commit adds a new Revise... action that can be taken
for queued post reviewables. This will open a modal where
the user can select a Reason from a preconfigured list
(or by choosing Other..., a custom reason) and provide feedback
to the user about their post.

The post will be rejected still, but a PM will also be sent to
the user so they have an opportunity to improve their post when
they resubmit it.
2023-10-13 11:28:31 +10:00
Blake Erickson
2443446e62
DEV: Prevent videos from preloading metadata (#23807)
Preloading just metadata is not always respected by browsers, and
sometimes the whole video will be downloaded. This switches to using a
placeholder image for the video and only loads the video when the play
button is clicked.
2023-10-12 13:47:48 -06:00
Kris
76cbfcd60c
A11Y: move new account disclaimer above buttons (#23884) 2023-10-12 11:30:03 -04:00
Jan Cernik
5d632fd30a
FIX: Chat layout shift with GitHub onebox (#23909) 2023-10-12 07:54:11 -03:00
Meghna
90be6f304f
UX: fix likes notification for multiple users on mobile (#23896) 2023-10-11 20:41:19 +05:30
chapoi
7f580a3083
UX: Composer and sidebar better fit (#23841) 2023-10-10 20:01:08 +02:00