34305 Commits

Author SHA1 Message Date
Martin Brennan
08ce000647
FIX: NULL IP for similar users caused incorrect message (#30981)
When suspending a user, we check for similar users by
IP address and show a number of and a list of them.
However we were checking this if the current user had a
NULL IP address, which found all other users with a NULL
IP. This doesn't make sense, this commit fixes the issue.
2025-01-27 09:17:30 +10:00
Kris
d2efdf5282
DEV: add missing button classes (#30997)
While updating a couple of themes I noticed some buttons were missing
`.btn-default`, which resulted in some inconsistent button styling
2025-01-24 16:33:06 -05:00
Jeff Wong
4c1c4ba8d4
FIX: enforce second factor with subfolders (#30992)
fix an improper redirect when enforcing second factor under a subfolder
install
2025-01-24 11:50:52 -08:00
Rafael dos Santos Silva
59a6775848
FIX: Don't return the last post we already have when paginating /posts (#30991) 2025-01-24 16:42:22 -03:00
Sam
9cc99ef6db
FIX: double click on tag INPUT breaking expected behavior (#30975)
Double clicking on the INPUT for tag entry
was cause the INPUT to be selected but the
actual tag entry and lookup to be hidden

This adds special case handling
2025-01-24 13:36:35 -05:00
Rafael dos Santos Silva
5a94ceda54
FIX: /posts pagination uses ID not created_at (#30990) 2025-01-24 15:05:47 -03:00
Joffrey JAFFEUX
7ea2d3efe1
FIX: ensures category is rendered (#30988)
https://github.com/discourse/discourse/pull/30962 lost the rendering of
category in topic-label-content. This commit fixes it and adds a test to
ensure we render category and tags.
2025-01-24 16:28:54 +01:00
Alan Guo Xiang Tan
62c6ee0de7
FIX: Query syntax error in UserBadge.update_featured_ranks! (#30979)
This commit fixes an SQL syntax error in
`UserBadge.update_featured_ranks!` when
the `user_ids` param is an empty array `[]`.

This was causing the `Jobs::BackfillBadge` job to raise the following
exceptions:

```
Job exception: ERROR:  syntax error at or near ")"
LINE 6:   AND user_id IN ()
```

This commit fixes the same error in
`UserState.update_distinct_badge_count` as well

Follow-up to 3e4eac0fed05daedcdea50d6275e143469d55eda
2025-01-24 14:06:39 +08:00
Kelv
084ed7a457
DEV: refactor components dependent on UsernameValidation to use related tracked properties and native inputs (#30946)
This will update properties that are used by the UsernameValidation
mixin to autotracking and also updates the use of Input component in
these templates to native inputs. This will help the refactor of the
mixin to a helper class that uses the modern Ember reactivity system.
2025-01-24 13:57:16 +08:00
Keegan George
5d4bb4b54e
UX: Improvements to posts route (#30968)
This update makes some small improvements to the posts route front-end.
Specifically, it adds a title to the page, and it improves the
positioning of expand/collapse caret.
2025-01-23 19:04:43 -08:00
Renato Atilio
a8c89cbc79
FIX: broken tada emoji on subfolder account activation (#30972) 2025-01-24 00:01:37 -03:00
Alan Guo Xiang Tan
3e4eac0fed
PERF: Enqueue Job::BackfillBadge in Jobs::BadgeGrant (#30945)
This commit updates the `Jobs::BadgeGrant` scheduled job to enqueue on
`Job::BackfillBadge` regular job for each enabled badge on the site.

The rationale for this change is that we started seeing the
`Jobs::BadgeGrant` job taking hours on sites with lots of enabled badges
as well as users because the job was backfilling all enabled badges
serially within the job. This is bad as it means that a `mini_scheduler`
thread is tied up
by this job thus reducing the overall capacity of `mini_scheduler` for
hours.
2025-01-24 09:35:01 +08:00
Kelv
b195b1c8a6
DEV: raise error on deprecated icon name caught on JS in system and qunit tests (#30942)
This PR raises an error on any deprecated icon names being converted by
`icon-library.js`, which will result in any deprecated icons introduced
in JS-land to fail qunit/system tests.

We'll do the same for `svg_sprite.rb` once I've resolved pre-existing
deprecated icons in core/plugins that's caught by the same exception
logic.
2025-01-24 09:26:00 +08:00
Gary Pendergast
37d1212865
FIX: Show the correct message when no user export exists. (#30970)
Followup to 7fc8d74f3eed52116add452b5321b41e02e04499

We need to check that the user export data exists before creating a model, since having an empty model will cause the UI to incorrectly think there's a user export to display.

This change shows the correct message, instead.
2025-01-24 11:38:07 +11:00
Kris
aa90ba2992
UX: fix admin dashboard link and style regressions (#30969)
Heading link regression reported here:
https://meta.discourse.org/t/admin-panel-reports-in-the-community-health-section-are-no-longer-clickable/347631

Also noticed some style regressions
2025-01-24 10:23:34 +10:00
Gabriel Grubba
e78c937a5c
FIX: Which topic do you want to reply to rendering raw HTML (#30962)
Because of
2b63830496
`Which topic do you want to reply to rendering HTML` was rendering raw
HTML.

Added `htmlSafe` for now.

I'll work on testing for this feature.
2025-01-24 10:37:48 +11:00
Martin Brennan
1b9e2ff4f9
FEATURE: Add attribution to staff notice and rename functionality (#30920)
The name "Staff Notice" was not quite right since TL4 users
can also add these notices. This commit changes the wording to
"Official Notice".

In addition to this, currently you have to go look into the staff
action logs to see who is responsible for a notice. This commit
stores the ID of the user who created the notice, then shows this
information on each notice to staff users.

Finally, I migrated the ChangePostNoticeModal component to gjs.
2025-01-24 09:29:22 +10:00
Sérgio Saquetim
692fccb0d9
DEV: Add outlets in the top/bottom rows of the category latest topic item (#30890) 2025-01-23 20:06:15 -03:00
Gary Pendergast
7d2fcb8812
FIX: Only apply the rate limit to user exports, not downloads (#30965)
Follow-up to 7fc8d74f3eed52116add452b5321b41e02e04499.

This change moves the guardian check for whether an export has been generated too recently to the endpoint handler, since we only want this check to apply when generating an export.
2025-01-24 09:37:05 +11:00
Gary Pendergast
7fc8d74f3e
FEATURE: Allow admins to export users (#30918)
The GDPR requires all users to be able to export their data, or request an export of their data. This is fine for active users as we have a data export button on user profiles, but suspended users have no way of accessing the data export function, and the workaround for admins to export data for suspended users involves temporarily unsuspending them, then impersonating the user to export the data as them.

Since suspended users no longer have access to their account, we can safely assume that the export request will be coming via a medium outside of Discourse (eg, email). This change is built with this workflow in mind.

This change adds a new "User exports" section to the admin user page, allowing admins to start a new export, and to download the latest export file.
2025-01-24 08:13:25 +11:00
Jan Cernik
3070b8eeae
FIX: Revert "Automatic auth flow with full page login/signup" (#30960)
This reverts commit 13f86c99eaa1eae781ad8c869fcea515436eade8.
It had issues with login-required sites. I will re-merge it with a fix soon.
2025-01-23 17:51:49 -03:00
Amanda Alves Branquinho
6aa492254f
DEV: Update glimmer menu to use value transformer (#30930)
- Use the `smallUserAttrs` function in the new glimmer menu  
- Replace the sugar syntax `@data` with `this.args` to fix tests
2025-01-23 16:25:21 -03:00
Keegan George
7b76d25946
DEV: Adopt post list component and new posts route front-end (#30604)
Recently we introduced a new `PostList` component (d886c55f63). In this update, we make broader adoption of this component. In particular, these areas include using the new component in the user activity stream pages, user's deleted posts, and pending posts page. This update also takes the existing `posts` route and adds a barebones front-end for it to view posts all in one page.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-01-23 10:20:45 -08:00
David Taylor
2b63830496
DEV: Only mark translations as htmlSafe for DButton (#30958)
If a consumer is passing in their own string to `@translatedLabel`, then
they should set it as `htmlSafe` themselves (if it is indeed safe)
2025-01-23 17:59:08 +00:00
Kris
097d987332
UX: add HTML class for composer preview to manage sidebar height (#30956)
This adds the class `composer-has-preview` to the HTML element when the
composer is opened and the preview is visible.

This allows us to adjust the sidebar height, so that the previewless
composer can overlap the sidebar and better utilize the available space.


Before:

![image](https://github.com/user-attachments/assets/8780f159-5d24-4ac0-8a4f-43a9b1665532)



After: 

![image](https://github.com/user-attachments/assets/baf69856-0ece-453f-aa0f-e7be9939af97)
2025-01-23 12:41:36 -05:00
Penar Musaraj
f1bdd86a8c
FIX: Allow touchmove in composer when there is a selection (#30957)
We stop propagating the `touchmove` event in the composer to ensure that
the page doesn't scroll inadvertently. We should only do this if no text
is selected, otherwise we block making changes to the text selection on
the `textarea` element.
2025-01-23 12:29:34 -05:00
marstall
2663cb86ae
FEATURE: add new hidden site setting to show full names in user card
adds a hidden site setting, "prioritize_full_names_in_ux", whose effect is to prefer full names in user-menu notifications

Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2025-01-23 12:26:59 -05:00
Penar Musaraj
3801ccf7b0
FIX: Keep active state in sidebar button for category/tag hot routes (#30954)
Fixes issue reported in
https://meta.discourse.org/t/sidebar-links-loose-active-state-on-the-hot-list-filter/348468
2025-01-23 11:36:48 -05:00
David Taylor
26134b897a
DEV: Ensure sequential replaceText calls work correctly (#30951)
`replaceText` will replace some text, then call `selectText()` to
restore the cursor position. However, selectText was asynchronous, so
calling `replaceText()` multiple times in the same runloop iteration
would cause the cursor to jump to an unexpected place. This likely
explains some of the weird behavior we've seen with upload-markdown
replacement
2025-01-23 13:08:43 +00:00
Osama Sayegh
10f34ddf86
DEV: Backend support for light/dark mode in color palettes (#30893)
We're embarking on a project for overhauling the color palette and theme
systems in Discourse. As part of this project, we're making each color
palette include light and dark modes instead of the status quo of
requiring 2 separate color palettes to implement light and dark modes.

This commit is a first step towards that goal; it adds a code path for
generating and serving `color_definitions` stylesheets using the
built-in dark variant of a color palette. All of this code path is
behind a default-off site setting `use_overhauled_theme_color_palette`,
so there's no change in behavior unless the setting is enabled.

Internal topic: t/141467.
2025-01-23 15:54:49 +03:00
Jan Cernik
13f86c99ea
FIX: Automatic auth flow with full page login/signup (#30928)
Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2025-01-23 08:43:07 -03:00
Jarek Radosz
474bfb5757
DEV: Add a context arg to after-topic-status outlet (#30940)
…so that plugins/themes can conditionally conditionally display their
topic-status icon (e.g. just on the topic list, or everywhere but the
header)
2025-01-23 04:21:31 +01:00
Ella E.
2c8f07fe85
FIX: Adjust search menu buttons alignment (#30939)
### Before
<img width="485" alt="image"
src="https://github.com/user-attachments/assets/869a676a-604f-461e-b008-975f9e352787"
/>


### After
<img width="485" alt="image"
src="https://github.com/user-attachments/assets/3b91022c-9a7d-4237-8382-19b2174f6006"
/>
2025-01-22 19:46:37 -07:00
Jarek Radosz
94b309b05e
FIX: Display either the topic-status outlet or the fallback (#30938) 2025-01-23 03:25:34 +01:00
Jarek Radosz
248501f4c7
FIX: Incorrect i18n titles for fallback topic-status (#30937) 2025-01-23 03:25:02 +01:00
Bryce Huhtala
1820dd34fc
UX: Revert #30547 UX: use em units for code font-size (#30936)
The solution in (https://github.com/discourse/discourse/pull/30547)
using `em` units was causing readability problems for code blocks in
mobile. This reverts to the previous solution
(https://github.com/discourse/discourse/pull/30536) of using `font-size:
inherit` for code within heading elements.

The downside is that the code in heading won't be slightly smaller than
the other text like it is for inline code in paragraphs, but it seems
worth it to avoid causing other size issues.
2025-01-22 20:09:23 -05:00
Renato Atilio
99b0ae2fc1
UX: inherit font-settings on form controls (#30935) 2025-01-22 19:54:36 -03:00
Penar Musaraj
eb041085bc
UX: Fix minimized composer position on iOS PWA and app (#30926)
See
https://meta.discourse.org/t/minimized-composer-reply-control-issues/348337
2025-01-22 13:38:34 -05:00
Joffrey JAFFEUX
3be699fe2e
FIX: ensures more icon is visible on hover (#30925) 2025-01-22 14:19:01 +01:00
Joffrey JAFFEUX
2cff8c82e3
UX: adds chat send shortcut user preference (#30473)
Users can now decide if they want to send a message on:
- <kbd>enter</kbd>
- <kbd>meta + enter</kbd>

If you choose <kbd>meta + enter</kbd>, <kbd>enter</kbd> will add a
linebreak.

<img width="192" alt="Screenshot 2025-01-21 at 12 57 48"
src="https://github.com/user-attachments/assets/abfd6f8b-83b3-4e6f-be67-8f63d536ca8a"
/>
2025-01-22 13:17:45 +01:00
Osama Sayegh
a793f4843b
DEV: Introduce theme-owned color palettes (#30915)
Related to https://github.com/discourse/discourse/pull/30893

As part of the theme overhauling project, we're making each theme fully
own/control its color palette which can be edited directly on the theme
page. To make this possible, we need to introduce a special type of
color palettes that are marked as "owned by a theme" in the database
which aren't displayed in the admin color palettes page and can't be
edited from it. This commit is the first step of this change; it adds a new
join table to associate a color palette with a theme. For now, we're
keeping the relationship one-to-one (hence the `UNIQUE` indexes), but we
may later change it to one-to-many.

Internal topic: t/141648.
2025-01-22 12:03:37 +03:00
Martin Brennan
83cc97994f
FEATURE: Handle special font properties from discourse-fonts (#30891)
In https://github.com/discourse/discourse-fonts/pull/15 we are
introducing special font properties for certain fonts,
specifically the `font-variation-settings` and `font-feature-settings`.
For now this will only apply to Inter, but we may do it for other
fonts in future.

This commit makes it so the color_definitions.css file includes
these special properties for each font, either defined on the
root `html` element for the body font or on the `h1-h6` elements
for the heading font. This is done in this way because defining
them on `@font-face` is ignored by the browser.

This also ensures special CSS classes for the wizard container
e.g. wizard-container-font-FONTID are defined, this is so we can
use these special properties scoped to the font selected in the
wizard, which will affect the way the canvas preview is rendered.

Here is an example of before/after with special properties applied to
Inter,
in this case:

```css
font-variation-settings: 'opsz' 28;
font-feature-settings: 'calt' 0, 'ccmp' 0, 'ss02' 1;
```
2025-01-22 10:56:09 +10:00
Martin Brennan
32c6d3be06
FIX: Admin sidebar problem check missing -1 check (#30916)
When we initially turned on admin sidebar for new sites,
existing sites had the value set to -1. We need to show
the problem check to these sites too, but currently it only
checks if `admin_sidebar_enabled_groups` is empty.
2025-01-22 10:21:30 +10:00
David Taylor
83737aab5f
FIX: Restore footer-nav backdrop-filter for iOS < 18 (#30914)
This was inadvertantly removed in
d88ee33eb622e52cec5f442dd6416e68c8f758e4

See https://meta.discourse.org/t/348262/4
2025-01-21 23:48:14 +00:00
David Taylor
c266e4acb8
FIX: Enforce 'prefix' notation for media-query ranges (#30913)
"context" notation is not supported in iOS < 16.4, and we don't have any
post-processing on our CSS files which can automatically make that
conversion.

For now, changing the stylelint config to enforce the more-compatible
syntax, and updating all occurences.
2025-01-21 23:42:17 +00:00
Jarek Radosz
e98644fbc6
DEV: Replace remaining uses of query helper (#30019) 2025-01-22 00:25:03 +01:00
Kris
fbb90aac1b
FIX: lint issue follow-up to a3359ac (#30911)
Expected empty line before rule `rule-empty-line-before`
2025-01-21 17:58:27 -05:00
dependabot[bot]
2d9f9613bb
Build(deps-dev): Bump @swc/core from 1.10.8 to 1.10.9 (#30906)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.10.8 to
1.10.9.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/swc-project/swc/compare/v1.10.8...v1.10.9)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-21 23:51:56 +01:00
Kris
a3359ac7ad
UX: set mobile read state indicator to static size to avoid overflow (#30910)
This fixes an issue where topics could scroll horizontally on mobile:
https://meta.discourse.org/t/topic-page-layout-issue/348262?u=pmusaraj

It seems some recent core change impacted the read state size/position 

This sets the size and position to more static values (not based on
global font changes) to avoid the issue, and removes the horizontal
scroll.
2025-01-21 17:24:58 -05:00
David Taylor
d7f008d482
UX: Only lock viewport scale during focusin events for iOS PWA/Hub (#30908)
c171e3dc works well in Safari, because the browser ignores the
`user-scalable=no` directive. However, PWA/Hub do respect the directive,
which means that it stopped pinch-zooming from working.

This commit updates the strategy for those environments so that the
viewport is only locked briefly during a focusin event. The simpler
strategy is maintained for the real safari browser.
2025-01-21 22:19:59 +00:00