Commit Graph

46343 Commits

Author SHA1 Message Date
3d2de7ca03 FIX: Add missing string for reviewables in user menu when reviewable post is deleted (#18295) 2022-09-21 09:05:08 +10:00
ea27079ffa FIX: Sidebar scroll fade on older iOS (#18299)
* DEV: Use explicit transparent color rather than keyword
* DEV: Use variable for dark mode
* DEV: Add mobile style
2022-09-21 09:03:40 +10:00
09cec7d6dd FIX: Fix GitHub onebox syntax highlight (#18300)
Highlight.js 11 deprecated the feature to highlight HTML blocks while
keeping the HTML structure, which broke our GitHub onebox syntax
highlight.

This patch adds it back by bringing the maintainers code as a plugin.

See https://github.com/highlightjs/highlight.js/issues/2889
2022-09-21 09:01:14 +10:00
8b044cbc28 UX: Add ability to scroll when height is limited (#18297) 2022-09-20 13:48:00 -07:00
ce21205d39 DEV: Add support for running plugin qunit in parallel (#18291)
For example, to run in three concurrent browsers and assemble the results:

```
QUNIT_PARALLEL=3 bin/rake "plugin:qunit[discourse-chat]"
```
2022-09-20 18:11:26 +01:00
496f910f03 DEV: Various A11Y improvements for the new user menu (#18288)
This commit includes various accessibility improvements for the new user menu:

* Add `title` attributes to the user menu tabs
* Properly label lists (by adding `aria-labelledby` to `<ul>` elements) for screen readers
* Change the user menu structure so that the tabs come before the content panel in the DOM, but use CSS to reverse them visually.
  Normally, changing the order of elements via CSS is bad for accessibility, but I believe this is one of the rare scenarios where it [makes sense](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Ordering_Flex_Items#use_cases_for_order). Prior to this change, if you want to reach the first notification item after you select a tab using the keyboard, you have to hit <kbd>ctrl</kbd>+<kbd>tab</kbd> because the notifications list is before the tabs list. However, with this change, <kbd>tab</kbd> will move you to the first item in the list after you select a tab using your keyboard.
* Aria-hide the unread notifications badge/count on the tabs because the `title` attribute on the tab indicates the unread count.
* Add some tests.
2022-09-20 19:31:56 +03:00
685e0da8c3 DEV: Update highlight.js to version 11 (#18282) 2022-09-20 12:43:28 -03:00
f71a981cb9 DEV: Remove testem parallel limit (#18290)
In itself, this change will not cause tests to run in parallel. It just unlocks the ability to use tools like `ember exam` to run tests in parallel. For example:

```
yarn ember exam --load-balance --parallel=3 --random
```
2022-09-20 15:43:06 +01:00
ef39193a06 DEV: Add rake plugins:turbo_spec task (#18289)
This leans on our existing `turbo_rspec` implementation to run plugin specs in parallel on all available cores
2022-09-20 15:42:54 +01:00
59071a13f4 Update translations (#18287) 2022-09-20 16:03:15 +02:00
d0243f741e UX: Use dominant color as image loading placeholder (#18248)
We previously had a system which would generate a 10x10px preview of images and add their URLs in a data-small-upload attribute. The client would then use that as the background-image of the `<img>` element. This works reasonably well on fast connections, but on slower connections it can take a few seconds for the placeholders to appear. The act of loading the placeholders can also break or delay the loading of the 'real' images.

This commit replaces the placeholder logic with a new approach. Instead of a 10x10px preview, we use imagemagick to calculate the average color of an image and store it in the database. The hex color value then added as a `data-dominant-color` attribute on the `<img>` element, and the client can use this as a `background-color` on the element while the real image is loading. That means no extra HTTP request is required, and so the placeholder color can appear instantly.

Dominant color will be calculated:
1. When a new upload is created
2. During a post rebake, if the dominant color is missing from an upload, it will be calculated and stored
3. Every 15 minutes, 25 old upload records are fetched and their dominant color calculated and stored. (part of the existing PeriodicalUpdates job)

Existing posts will continue to use the old 10x10px placeholder system until they are next rebaked
2022-09-20 10:28:17 +01:00
e7091d2f59 DEV: Remove redundant args for user-main-nav plugin outlet (#18284) 2022-09-20 17:12:15 +08:00
27bff3fcfa UX: Add icons to all navigation link on user page (#18283) 2022-09-20 12:44:40 +08:00
37777ac3a2 DEV: use sketchy favicon in dev ember proxy (#18280) 2022-09-20 10:53:18 +10:00
7b243f3955 FIX: Overriding text with admin_js.* keys didn't work (#18281) 2022-09-20 10:47:57 +10:00
f91426a7fa FIX: Empty inline BBCodes were broken (#18276)
Upgrading to Markdown.it v13 broke empty inline BBCodes. This works around the problem by adding an empty token before a closing token if the previous token was a BBCode token.

It also removes the unused `jump` attribute which was removed in Markdown.it v12.3
2022-09-20 09:50:22 +10:00
a766bf8818 UX: Welcome topic CTA adjustments (#18168)
* UX: Adjust welcome cta

* more

* FIX: Adjust test syntax
2022-09-19 16:40:44 -05:00
36aec7f546 DEV: Add two new plugin outlets in topic list (#18270) 2022-09-19 18:35:13 +02:00
0414bd00ae DEV: Tone down copy in experimental user menu for pending users (#18277)
The experimental user menu has a tab that displays recent reviewables and at the moment when a new signs up for the site and they need to be approved, admins see a very scary "suspicious user" copy in the reviewables tab in the user menu. We don't need the copy to be very scary because when a user needs to be approved, it's because the site operator has configured the site to force all new users to go through the review queue and it's not some kind of spam detector flagging the user.
2022-09-19 19:32:34 +03:00
dc6418bd8f Revert "UX: Retry "left-align title with content for sidebar (#18202)" (#18242)" (#18278)
This reverts commit 5ee760dc2c528760c7db81b8cdf650fd5ee75072.
2022-09-19 11:05:41 -04:00
ce27dbd560 FIX: header offset position was not correct in some cases (#18155)
When a topic is opened in a new tab and is fully loaded the scroll
position is a bit off.

This commit partially reverts 9a55c9c4339214ea18a73e71ab2506e4ad2967aa.
2022-09-19 14:56:34 +02:00
754ad42344 UX: Use the same text for linking to more categories and tags in sidebar (#18275)
Before this change, anonymous user and a logged in user used different
text for the links to the categories and tags routes.

Follow-up to 321aa4b4b45eacfb61ee887edf6315aae18f3efc
2022-09-19 12:01:08 +08:00
9a76456986 Build(deps): Bump image_size from 3.0.2 to 3.1.0 (#18274)
Bumps [image_size](https://github.com/toy/image_size) from 3.0.2 to 3.1.0.
- [Release notes](https://github.com/toy/image_size/releases)
- [Changelog](https://github.com/toy/image_size/blob/master/CHANGELOG.markdown)
- [Commits](https://github.com/toy/image_size/compare/v3.0.2...v3.1.0)

---
updated-dependencies:
- dependency-name: image_size
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-19 00:50:55 +02:00
97d6fb2e3f Build(deps-dev): Bump shoulda-matchers from 5.1.0 to 5.2.0 (#18272)
Bumps [shoulda-matchers](https://github.com/thoughtbot/shoulda-matchers) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/thoughtbot/shoulda-matchers/releases)
- [Changelog](https://github.com/thoughtbot/shoulda-matchers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/thoughtbot/shoulda-matchers/compare/v5.1.0...v5.2.0)

---
updated-dependencies:
- dependency-name: shoulda-matchers
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-19 00:41:09 +02:00
49560bc284 Build(deps): Bump css_parser from 1.11.0 to 1.12.0 (#18273)
Bumps [css_parser](https://github.com/premailer/css_parser) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/premailer/css_parser/releases)
- [Changelog](https://github.com/premailer/css_parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/premailer/css_parser/compare/v1.11.0...v1.12.0)

---
updated-dependencies:
- dependency-name: css_parser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-19 00:40:16 +02:00
5259198c61 DEV: Extract virtual keyboard code (#18267)
Makes it possible for other code to use `.keyboard-visible` class on `<html>` element.
2022-09-16 21:09:28 +02:00
40183080d9 DEV: Add before parameter to /posts.json API docs (#18268) 2022-09-16 15:09:15 +01:00
3679c081a9 Improve Safari 13 warning copy (#18269) 2022-09-16 14:21:54 +01:00
3904c23121 Introduce warning message for Safari 13 and below (#18258)
Discourse will be dropping support for these browsers in early 2023. https://meta.discourse.org/t/224747
2022-09-16 11:17:49 +01:00
4af080d20b Build(deps): Bump @babel/standalone in /app/assets/javascripts (#18266) 2022-09-16 02:05:44 +02:00
1863ac74c9 Build(deps): Bump connection_pool from 2.2.5 to 2.3.0 (#18265) 2022-09-16 02:05:03 +02:00
3e8b6c67ea FIX: Do not attempt to serialize Tag objects when tagging disabled (#18264)
When tagging is enabled, we were correctly serializing tags by their name. However, when tagging was disabled we were attempting to serialize an entire Tag object which raises an error since ee07f6da7d.

https://meta.discourse.org/t/232885
2022-09-15 16:17:48 +01:00
87f8bafa7e DEV: Remove obsolete CSS prefixes (#18262) 2022-09-15 16:54:08 +02:00
658eedeaa7 UX: Avoid showing text cursor on unselectables (#18261) 2022-09-15 15:56:45 +02:00
1a2bf52656 DEV: adds includes helper to templates (#18259)
Usage :

```
{{#if (includes fooArray foo)}}
```

```
{{#if (includes fooString foo)}}
```
2022-09-15 14:20:37 +02:00
e567eeb927 DEV: Log theme error names and messages (#18260) 2022-09-15 14:14:52 +02:00
2704a02e3a FIX: In-page anchor links were broken in subfolder setups (#18250)
The key fix in this commit is that it removes `this.replaceState(path)` for anchor-only URLs. We still intercept those routing changes to properly calculate the scroll position of the anchor via `jumpToElement`, but we no longer use the Ember router to override the browser's history. This fixes the subfolder issue and also lets the browser maintain its history correctly.

The commit also includes a small refactor to the `jumpToElement` helper to facilitate stubbing in tests.
2022-09-15 08:09:34 -04:00
38dab71448 Build(deps): Bump @babel/core in /app/assets/javascripts (#18256)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.19.0 to 7.19.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.19.1/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2022-09-15 12:02:05 +02:00
51ee861ab3 Build(deps): Bump @babel/standalone in /app/assets/javascripts (#18255)
Bumps [@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone) from 7.19.0 to 7.19.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.19.1/packages/babel-standalone)

---
updated-dependencies:
- dependency-name: "@babel/standalone"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-15 12:01:01 +02:00
b18f1fefda UX: Remove height CSS preventing sidebar touch scrolling on mobile (#18257) 2022-09-15 17:17:08 +08:00
468f4bcf8b Build(deps): Bump loofah from 2.18.0 to 2.19.0 (#18253) 2022-09-15 10:34:41 +02:00
61640520b6 Build(deps): Bump unicode-display_width from 2.2.0 to 2.3.0 (#18254) 2022-09-15 10:34:09 +02:00
2583d21aa7 UX: Improve styling of sidebar on mobile (#18246)
* Make sidebar footer is sticky
* Ensure that only the sidebar sections is scrollable
2022-09-15 11:35:33 +08:00
4abc323c8d DEV: Add spec for 56555a023154ce301626cdeed10e52a2d75a9d5d (#18245) 2022-09-15 11:20:52 +08:00
86ecb6c58b DEV: update yes/no confirmation dialogs (#18181) 2022-09-14 11:06:56 -04:00
04e433d286 PERF: Skip image placeholders when secure_media is enabled (#18247)
Secure media requests go through the app. In topics with many images, this makes it very easy to hit rate limiters. Skipping the low-res placeholders reduces the chance of this problem occuring.
2022-09-14 12:42:59 +01:00
09a434e2d8 DEV: emoji model should set the group of the emoji (#18237)
We do it for custom emojis but not for standard emojis which is quite unexpected and limit the use cases we can have for it.
2022-09-14 13:10:48 +02:00
56555a0231 Disallow access to raw email for non-staff users (#17569) 2022-09-14 09:57:12 +08:00
dee8a1db20 UX: Do not mark activity table heading as a cursor (#18244) 2022-09-13 18:26:41 -04:00
2f428023da DEV: ctrl+click on user menu items should open in new tab (#18243) 2022-09-13 18:25:40 -04:00