Commit Graph

57608 Commits

Author SHA1 Message Date
dependabot[bot] 0c3929fc8a
Build(deps-dev): Bump parser from 3.3.6.0 to 3.3.7.0 (#30826)
Bumps [parser](https://github.com/whitequark/parser) from 3.3.6.0 to
3.3.7.0.
-
[Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/whitequark/parser/compare/v3.3.6.0...v3.3.7.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-16 23:08:00 +01:00
Krzysztof Kotlarek 029bd6feda
FEATURE: setting allowing tl0/anonymous flag illegal content (#30785)
The new site setting `allow_anonymous_and_tl0_to_flag_illegal` allows
tl0 users to flag illegal content. In addition, anonymous users are
instructed on how to flag illegal content by sending emails.

Also `email_address_to_report_illegal_content` setting is added. If not
provided, then the site contact email is used.
2025-01-17 08:57:44 +11:00
David Taylor d3a7b99699
DEV: Relax 'unexpectedly found' matcher in deprecation-silencer (#30823)
We managed to find a slightly different way to trigger the same Ember
bug. This commit makes sure that's silenced as well.
2025-01-16 17:55:56 +00:00
Régis Hanol 5c6e96720b
New "user-preferences-tracking-topics" plugin outlet (#30821)
Adds the "user-preferences-tracking-topics" plugin outlet to allow the
`discourse-assign` plugin to add a new "notification level when
assigned" user preference.

There's also a new `customAttrNames` tracked property that allows
plugins to add new user option to be saved from this screen / plugin
outlet.

Also changed the text used for the "notification level when replying" to
match the one that is used for the "notification level when assigned" in
https://github.com/discourse/discourse-assign/pull/626.

## BEFORE

<img width="375" alt="image"
src="https://github.com/user-attachments/assets/178ba47e-f783-46d2-adae-28afec49b259"
/>

## AFTER

<img width="363" alt="Screenshot 2025-01-16 at 16 11 26"
src="https://github.com/user-attachments/assets/215e9f86-62f7-48ea-b665-72cbf28abd21"
/>

DEV: remove unused topic-tracking component
2025-01-16 17:58:43 +01:00
David Taylor 892d02fda1
DEV: Fix source-identifier for plugins when using `.gz` assets (#30820) 2025-01-16 15:33:28 +00:00
Penar Musaraj 1ae35ecce8
DEV: Remove isTablet capability (#30799)
Reverts 02113fc. 

This is an imperfect detection of tablets and more generally, we want to
move away from detecting specific devices. THere's a broader effort to
remove mobile/desktop detection and rely instead on viewport-width-based
patterns and feature detection (touch, hover, etc.). See
https://github.com/discourse/discourse/pull/30642

To reach the same results in CSS/jS, we can use the `touch` and `hover`
media queries.

In CSS, something like: 

```
@media (hover: none) {
  // hover non excludes touchscreen desktops
  .discourse-touch {
    // we detect touch capability on the JS side, a bit of a belts and suspenders approach
  }
}
```

And in JS: 

```
this.capabilities.touch` plus `window.matchMedia("(hover: none)").matches
```
2025-01-16 10:19:01 -05:00
Joffrey JAFFEUX 6c3a7f2a67
FIX: do not store 0 has min width for thead panel (#30818)
When we had no width stored for the side panel in the local storage,
essentially the computation would end up being:

```javascript
Math.min(null, 1000);
```

Which would output: 0. This commit ensures we have a default for store
width: MIN_PANEL_WIDTH. And also uses the same value in CSS and JS.

I had to change z-layers of chat-side-panel resizer as it was
interfering with system specs changing the notification level of a
thread, when trying to click the option in the dropdown, it would
instead click the resizer as it would appear on top of the dropdown.

Tried to write a test but couldn't get something reliable.
2025-01-16 16:03:35 +01:00
Mark VanLandingham e6272e0497
DEV: applyBehaviorTransformer for composer-position editTouchMove (#30811)
In a theme or plugin, if you have a scrollable mobile composer, you may
want to allow scrolling events on the composer editor.. this allows for
it!
2025-01-16 08:04:15 -06:00
David Taylor 72f4588d3b
DEV: Do not trigger floatkit 'hover' for touch events (#30793)
When tapping something on a touch-enabled device, `mouseMove` events are
still fired, so floatkit would still be triggered even if configured for
'hover' only. For links, this would be particularly strange, because the
tooltip would appear for a split-second, before the page navigation
occured.

To avoid this problem, we can use the more-modern 'pointerMove' event,
and check the `pointerType` to exclude 'touch'
2025-01-16 12:36:47 +00:00
Joffrey JAFFEUX f28eb5b0dc
FIX: ensures scrolls work in chat when touch is on text (#30817)
The stacking context fix we use in chat to avoid:
https://bugs.webkit.org/show_bug.cgi?id=262287 was causing this weird
behavior in chat where the scroll event wouldn't fire when the finger is
on text and not an empty area of the scrollable div.

This simplified implementation seems to work reliably and avoids the
issue.
2025-01-16 13:02:23 +01:00
David Taylor 41bf8ddfd0
DEV: Add topic-list-after-category outlet (#30797) 2025-01-16 11:24:01 +00:00
Tomas Vavrda bb920326c9
UX: Removed a redundant git pull statement from the docs (#30801)
`git pull` statement is now redundant and not needed
2025-01-16 11:13:51 +00:00
Tobias Eigen 60a1eedb5f
DEV: Fix typo priviledges -> privileges (#30809)
@discourse-translator-bot keep_translations
2025-01-16 11:09:17 +01:00
dependabot[bot] 6f314490a0
Build(deps): Bump @faker-js/faker from 9.3.0 to 9.4.0 (#30807)
Bumps [@faker-js/faker](https://github.com/faker-js/faker) from 9.3.0 to
9.4.0.
- [Release notes](https://github.com/faker-js/faker/releases)
- [Changelog](https://github.com/faker-js/faker/blob/next/CHANGELOG.md)
- [Commits](https://github.com/faker-js/faker/compare/v9.3.0...v9.4.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-16 11:07:43 +01:00
dependabot[bot] 686a531d0d
Build(deps-dev): Bump puppeteer-core from 24.0.0 to 24.1.0 (#30805)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from
24.0.0 to 24.1.0.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
-
[Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v24.0.0...puppeteer-core-v24.1.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-16 11:06:58 +01:00
dependabot[bot] 04708faeab
Build(deps-dev): Bump lefthook from 1.10.5 to 1.10.7 (#30804)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 1.10.5
to 1.10.7.
- [Release notes](https://github.com/evilmartians/lefthook/releases)
-
[Changelog](https://github.com/evilmartians/lefthook/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/evilmartians/lefthook/compare/v1.10.5...v1.10.7)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-16 11:06:28 +01:00
dependabot[bot] c818f7e17e
Build(deps-dev): Bump jsuites from 5.8.3 to 5.8.5 (#30802)
Bumps [jsuites](https://github.com/jsuites/jsuites) from 5.8.3 to 5.8.5.
- [Release notes](https://github.com/jsuites/jsuites/releases)
-
[Changelog](https://github.com/jsuites/jsuites/blob/master/changelog.md)
- [Commits](https://github.com/jsuites/jsuites/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-16 11:06:08 +01:00
Ted Johansson 0630bc28e7
DEV: Convert a bunch of admin UI translations to follow convention (#30816)
In the new admin UI conventions, button labels and section headings should be sentence case, rather than title case.

This PR performs a sweep of all the fragments visible when using the sidebar layout.
2025-01-16 15:14:40 +08:00
Ted Johansson 4682919744
DEV: Add base admin page page object (#30814)
This PR introduces a base page object for admin pages. Since we're standardizing using components, this makes writing tests easier by abstracting away details about selectors.
2025-01-16 12:52:41 +08:00
Gary Pendergast a46d1547ab
FIX: Add a DB migration to update font site settings types (#30813)
This PR is  a follow-up to #30636.

The previous change altered the `data_type` of the `base_font` and
`heading_font` site settings, but didn't update the corresponding
entries in the `site_settings` table to match.
2025-01-16 13:53:58 +10:00
Martin Brennan f329acba71
UX: Wizard and theme install modal improvements (#30788)
* Fix tabbing inputs on first wizard step, the user would end up on
"Skip to content"
for the page "behind" the wizard. If the wizard is showing we can just
not render the skip to content element
* Only show the required wizard steps in the counter, so we do X/4
rather than X/6 at the top of the page. 
* Change to "Setting up your theme..." by default, but if the install
takes 10s or more add a note that things are still happening and to
be patient.
2025-01-16 13:53:09 +10:00
Ted Johansson 59a2a70806
DEV: Move admin page objects to /pages directory (#30812)
A handful of the page objects for admin pages were placed directly under /page_objects rather than under /page_objects/pages with the others. This PR simply moves them.
2025-01-16 11:18:36 +08:00
Ted Johansson 5c0b7c4d70
Admin webhooks UI guidelines (#30764)
This change converts the admin webhooks UI to the new UI guidelines and modernizes the JS.
2025-01-16 10:22:18 +08:00
Martin Brennan 35507d4090
FIX: Process tag synonyms when approving reviewable queued post (#30810)
Followup 72c4709a5a

Previously we made a fix to allow skip validations when tagging
a topic via TopicCreator. However, this flow also skips a lot of
the more in-depth work on tags we do when creating a topic, like
processing tag synonyms. When approving reviewable queued posts,
we skip validations, so this would cause an issue where a topic
was approved and the tag synonyms weren't applied.

This commit changes the logic so we attempt the more complete
`DiscourseTagging.tag_topic_by_names` call first and if this fails
and skip validations is on, then we do
`DiscourseTagging.add_or_create_tags_by_name`.
This at least gives a chance for the full workflow to work first.
2025-01-16 11:01:45 +10:00
Gary Pendergast 99f5670c30
UX: Tweak plugin and customize-based admin page margins (#30808)
Admin pages that are based off the customize or plugin templates were wrapped in the `admin-container` class, which has slightly different margins to the `admin-config-page` class, which is used on most admin pages.

This change ensures that all the admin pages have the same alignment.
2025-01-16 09:44:43 +11:00
Gary Pendergast 27f278253b
UX: Use DPageHeader on the Logs page (#30786)
Update the header of the admin Logs page to be more consistent with the rest of the admin UI.

The tabs to access the different sub-pages have also been updated.
2025-01-16 07:42:34 +11:00
Penar Musaraj 35214201b8
DEV: Target tablets differently for composer position tweaks (#30798) 2025-01-15 14:09:51 -05:00
Kris adf098f21b
A11Y: move heading role to parent tag to fix voice control (#30796)
The heading role on topic lists is desirable for screenreader users
because they can easily navigate from heading to heading.

Having this role on the link tag directly becomes problematic for Voice
Control users on Apple devices because unfortunately Voice Control
assumes that when given the role of a heading, it is not a link. This
makes it difficult to click.

This PR moves the heading role to the link's wrapper. This change allows
for heading-to-heading navigation for screenreaders, and also makes it
easier to click using Voice Control. The end result is that topic lists
are both navigable for screenreaders and Voice Control users.
2025-01-15 12:53:05 -05:00
Sérgio Saquetim 34acc9fe54
DEV: Add outlets around the topic item and latest topic item poster (#30776) 2025-01-15 13:38:06 -03:00
Mark VanLandingham a647031171
DEV: Add topic_hot_score association to topic.rb (#30795)
We have the other side of this association wired up -- 

da72ad4ecd/app/models/topic_hot_score.rb (L4)

This commit simply adds the association to `Topic` model so we can
reference the hot score.
2025-01-15 10:14:33 -06:00
David Taylor da72ad4ecd
DEV: Introduce topic-link PluginOutlet (#30792) 2025-01-15 13:07:59 +00:00
dependabot[bot] 320550f289
Build(deps-dev): Bump lefthook from 1.10.4 to 1.10.5 (#30778)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 1.10.4
to 1.10.5.
- [Release notes](https://github.com/evilmartians/lefthook/releases)
-
[Changelog](https://github.com/evilmartians/lefthook/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/evilmartians/lefthook/compare/v1.10.4...v1.10.5)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-15 11:35:30 +01:00
David Taylor ed304ba196
DEV: Add URL to fa6 deprecation (#30791)
This will be displayed in the warning banner
2025-01-15 10:30:25 +00:00
Natalie Tay cfac49fb10
FIX: Include original filename in s3 uploads even if not attachment (#30789)
Related: https://github.com/discourse/discourse/pull/30535

In the PR above, the [content-disposition
header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition)
was removed for all non-svg files due to the "attachment" keyword added
to them, causing files to be downloaded instead of opening in a new tab
when requested. When removing that, it also removed the filename
attribute attached to s3 uploads.

After some testing, it turns out that `filename` is also respected when
next to `inline`, despite it not being obvious [in
docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#syntax).
This commit adds inline+filename so that users can still download files
and have filenames be respected instead of using the s3 hash.
```http
<!-- mdn docs -->
Content-Disposition: inline
Content-Disposition: attachment
Content-Disposition: attachment; filename="file name.jpg"
Content-Disposition: attachment; filename*=UTF-8''file%20name.jpg
<!-- this actually works too -->
Content-Disposition: inline; filename="file name.jpg"
```
2025-01-15 18:08:18 +08:00
Alan Guo Xiang Tan 1a70d118a8
FIX: `S3Inventory#backfill_etags_and_list_missing` need to unescape key (#30787)
The `key` provided in the S3 inventory file will esacpe any special
characters in the filename of the key so we need to unescape. Otherwise,
uploads with extensions that conatins special characters will fail to
match records which we insert into the temporary table based off the
s3 inventory file.
2025-01-15 14:52:49 +08:00
Martin Brennan 061899fee4
UX: Wizard homepage dropdown improvements (#30763)
* Do not offer "categories with latest" option anymore, it does
  not look good with our default Sidebar selection
* Display a sensible item in the dropdown if the admin has not
  chosen hot, latest, or category_boxes as the homepage style,
  before it was broken. Now we show Custom with a little blurb
  about whether topics or categories are shown, and what the landing
  page is


![image](https://github.com/user-attachments/assets/3e392583-d107-489e-9725-62d995a2d341)
2025-01-15 16:49:47 +10:00
Penar Musaraj d16a8a5ea9
UX: Adjust styling of Back button in topic progress (#30769)
Before: 
<img width="300" alt="image"
src="https://github.com/user-attachments/assets/66c07c49-9603-4eb4-84d5-db3821a7af1a"
/>

After: 
<img width="300" alt="image"
src="https://github.com/user-attachments/assets/ba90d74a-4f63-41ae-9dd7-f5999a2d21ef"
/>
2025-01-15 17:41:00 +11:00
Gary Pendergast d144826fa7
UX: Use `DPageHeader` on the Email Style page (#30784)
Update the header of the admin Email Style page to be more consistent with the rest of the admin UI.

The HTML/CSS tabs have also been updated, which required an extra check being added to the NavItem component.
2025-01-15 16:53:45 +11:00
Natalie Tay 038a391cfe
FIX: Remove /u/ from robots (#30782)
Follow up from https://github.com/discourse/discourse/pull/27712.

Currently, we already add `noindex` to /u routes. However, due to
robots.txt blocking this, search engines are not able to see the header.

This commit removes /u from our robots.txt to allow search engines to
see the header. This commit also includes a migration to remove the /u
from admins who have overridden the file. I had contemplated not
including this migration, but seeing there are existing site admins who
are trying to remove errors from their dashboard, they would probably
welcome this change.

The migration replaces overridden text at this area, and will not modify
if additional routes have been added in-between:

<img width="500" alt="Screenshot 2025-01-15 at 11 28 43 AM copy"
src="https://github.com/user-attachments/assets/60db64c9-ed33-48a5-a917-a10545282a5c"
/>


Side effect note: This might potentially result in more pageviews* from
GoogleBot (for example) for a period of time as Google starts visiting
the user routes they have been denied before.
2025-01-15 13:42:08 +08:00
Gary Pendergast 5da6a06ce3
UX: Use DPageHeader on the Emails page (#30781)
There are a few changes here to make the Emails admin page more consistent with the rest of the admin UI.

- The header and navigation menu have been updated.
- The sidebar now stays highlighted when visiting the email admin sub-pages.
- Moved the Template editor from /admin/customize/email_templates to /admin/email/templates, so it fit as a sub-page.
- Removed the link to the Template editor from the Customize section of the old top menu, since it's accessible from the Emails section, instead.
2025-01-15 15:36:16 +11:00
Gary Pendergast 698e7a17dd
UX: Use DPageHeader on the Site Settings page (#30783)
Update the header of the admin Site Settings page to be more consistent with the rest of the admin UI.
2025-01-15 15:19:11 +11:00
Martin Brennan 125e686bf2
FIX: Do not allow_any on fonts site_settings (#30780)
Both heading_font and body_font should not allow
additional user-defined values, these are lists with
predefined choices. The UI already prevents this
because the font selector dropdown is unique, but
we want to make sure the setting definition reflects
this too.
2025-01-15 14:13:34 +10:00
Martin Brennan 5bc522e836
FIX: Double trigger of close user menu (#30732)
When clicking the "new features" notification item for
admins that navigates to /whats-new, the user notification
menu was not closing. This was happening because inside
the UserMenu::Menu component, the `routeDidChange` event
was firing and calling `closeUserMenu()`, however this is already
called inside the `Header` component via `toggleHamburger()`.

This is _only_ happening for the "new features" notification
item, other items have already been destroyed and they do not get
the `routeDidChange` event. No idea why, but this fixes the issue
in a global way.
2025-01-15 10:38:08 +10:00
Penar Musaraj 73b28815e3
FIX: Safari on iOS crashes when pinch-zooming (#30779)
Not sure why, but it looks like this `z-index: -1` on the composer
causes iOS to crash super quickly when pinch zooming . This change was
introduced in 07e5f8907e and is not
strictly necessary, let's try removing.
2025-01-14 23:56:20 +01:00
dependabot[bot] e600ef02a0
Build(deps): Bump stackprof from 0.2.26 to 0.2.27 (#30777)
Bumps [stackprof](https://github.com/tmm1/stackprof) from 0.2.26 to
0.2.27.
-
[Changelog](https://github.com/tmm1/stackprof/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tmm1/stackprof/compare/v0.2.26...v0.2.27)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-14 23:38:09 +01:00
Kris a94009a57d
UX: remove redundant `text-decoration: none`, follow up to 912b002 (#30775)
This redundant `text-decoration: none` was getting in the way of showing
a strikethrough on the deleted part of the diff

before ("new strike" at the bottom missing the strikethrough): 

![image](https://github.com/user-attachments/assets/4c04696a-efe8-4bb4-a7a7-cf10fcd4b443)


after (strikethrough appears correctly):

![image](https://github.com/user-attachments/assets/22a8c658-6600-47d4-a795-dc3116971485)
2025-01-14 16:33:09 -05:00
Mark VanLandingham bad869dd81
DEV: Add div with className around Search no results header (#30774)
Another case of text node missing container with a selectable class.
2025-01-14 14:18:51 -06:00
David Taylor 0fcb832244
DEV: Setup deprecation workflow earlier (#30768)
In 0ed4b09527, this code was moved into
app.js, which means it actually ends up running after all the other
imports have been completed. That's too late, and some deprecations are
triggered before that.

This commit moves `setupDeprecationWorkflow` back into its own module,
with a 'side effect only' import from `app.js`.
2025-01-14 20:17:13 +00:00
Kris 912b002dcc
UX: show strikethrough, underline in post edit diff (#30773)
Reported here:
https://meta.discourse.org/t/strike-through-text-is-not-rendered-in-diff/347101

`text-decoration: none` needs a few exceptions here to avoid stripping
out styling that's present in posts


before (strikethrough and underline stripped): 

![image](https://github.com/user-attachments/assets/ecb8cdee-e04b-463f-93a3-16d92797f0cd)


after: 

![image](https://github.com/user-attachments/assets/b250c535-de2f-429a-8764-5a60e74ef953)
2025-01-14 15:00:12 -05:00
Mark VanLandingham c25e53db7e
FIX: Full page search result infinite scroll with added results (#30771) 2025-01-14 13:23:08 -06:00