Commit Graph

887 Commits

Author SHA1 Message Date
8367819b1b DEV: Attempt at stabilizing components listing page system spec (#32352)
This commits reworks the assertions for components shown on the components listing page to eliminate flakiness we've seen with those assertions.
2025-04-22 11:04:10 +03:00
e47b0996ed FIX: enable drafts dropdown on private categories (#32370)
Reinstates the draft dropdown on private category pages.
2025-04-18 17:38:35 +04:00
6c4e9dfbc8 DEV: Try fix composer rich text transcript spec (#32364)
This is to try fix this error by sending the keys
on the element itself:

```
Failure/Error: page.send_keys([PLATFORM_KEY_MODIFIER, "v"])

Selenium::WebDriver::Error::StaleElementReferenceError:
  stale element reference: stale element not found in the current frame
    (Session info: chrome=135.0.7049.84); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception
```
2025-04-18 15:52:35 +10:00
9b5ada304f UX: avoid auto-linking clash with code marks on rich editor (#32365)
Avoid auto-linking URLs within code marks

Avoid auto-linking URLs when there's a `` ` `` just before the matched
URL, assuming the user is about to type a closing `` ` `` to create a
code mark instead.
2025-04-18 01:11:59 -03:00
1c8646b48e DEV: Refactor forcing admin sidebar logic in hamburger nav mode (#32257)
This PR allows for other code to force the sidebar, but making the
language not admin-specific. There is a general problem to solve of "how
can I force the sidebar to appear, while keeping the hamburger menu in
the header as-is". This problem is solved for admin interface, but the
variable naming made it seem like the logic was directly tied to the
admin UI.

It is easy with this change, to have another sidebar manager force the
sidebar to be open for a route. Technically it was easy before, but it
would look like you were doing awful hacks.

---------

Co-authored-by: Isaac Janzen <isaac.janzen@discourse.org>
2025-04-17 22:36:38 -05:00
2b4521d0b3 FIX: pasting img on rich editor could be double-processed (#32356)
Without the `useCapture` as `true` on this `ComposerUpload`'s
`addEventListener`, if the clipboard contained both a Files array and a
`text/html` item, the paste event would be captured by ProseMirror
before being captured by the `ComposerUpload` setup and its
`preventDefault` call.
2025-04-18 00:20:44 -03:00
72f9714ddc FEATURE: Implement tag group selection in dropdown and multi-select for topic creation and preview when using Form Templates (#32108)
Adds support for a tag-chooser in form templates. It supports single tag
and multi tags. The source of the displayed tags has to be a tag_group
name.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-04-17 08:38:03 -05:00
a69a304f11 FEATURE: allow edit custom flags (#32344)
Allow admins to edit user custom flags. Because changing
name/description will update name/description for old reviewables,
warning has to be displayed.

Still, system flags can never be edited or deleted (only disabled).
2025-04-17 12:31:52 +08:00
f6eb2e083c DEV: Resolve flaky test due to regexp match (#32343)
The test being fixed in this commit was flaking with the following
error:

```
Capybara::Ambiguous:
  Ambiguous match, found 2 elements matching visible css ".stream-topic-title .title a[href*='/2']"
```

The regexp match on the `href` attribute has the potential to match
multiple elements if both urls contain the `/#{topic.id}` substring. For
example, both `/t/-/2/2` and `/t/-/1/2` will satisfy the regexp.
2025-04-17 09:32:22 +08:00
b724181bdf DEV: Update verbiage around remove password modal, swap button for a link (#32338)
Simplified the language around remove password to be more clear, swapped out the button for a link.
2025-04-16 14:37:54 -05:00
8ccb66a44a FEATURE: Release admin search for all sites (#32327)
This commit removes the experimental setting controlling
admin search and releases it for all admins. This search
can be triggered with Ctrl+/ or Cmd+/

For more information see
https://meta.discourse.org/t/introducing-comprehensive-admin-search/360157
2025-04-16 16:26:53 +10:00
c7d400eda2 FEATURE: Implement Form Template Preview (#32111)
![imagen](https://github.com/user-attachments/assets/db5cf334-6e92-40b6-b93a-5cfa12882e8f)
2025-04-15 23:52:02 -05:00
0b8df4b833 UX: Use 'unused' instead of 'active' for components (#32284)
This commits changes the language for components that aren't used on any themes to be "used/unused" instead of "active/inactive" throughout the new components listing page.
2025-04-15 16:12:20 +03:00
5e8778ecf7 UX: Use core description of popular components when there's no description (#32286)
When an installed component doesn't have a description in its locale
files, we should fallback to the description that core has for the
component if it's one of the popular components that core features.
2025-04-15 16:07:22 +03:00
71b31604b5 PERF: Implement infinite scrolling for new components page (#32291)
On sites with many components, serializing and rendering all components
in one-go on a page can take quite a bit of time. The new components
listing page that was introduced in
https://github.com/discourse/discourse/pull/32164 currently loads all
components in one-go, so this commit implements infinite-scrolling
pagination for the page to address this performance issue for sites with
many components.
2025-04-15 16:05:10 +03:00
fc6aaa3e49 DEV: Wizard step tweaks (#32304)
This makes two tweaks to the setup wizard:

1. Move the branding (site logo) step to after styling (look & feel).
2. Remove the corporate (your organization) step.
2025-04-15 13:53:01 +08:00
735bef9ea0 UX: Remove Ctrl+F search shortcut (#32281)
This commit removes the Ctrl+F search shortcut, which hijacks the
browser search shortcut in Discourse. We are doing this because there
has been many years of complaints around this behaviour, and now that
we have the new header search it has become even more annoying.

We originally added this because we lazy load posts in a topic, and it
might not have been immediately clear to users that they are not
searching
all the posts in the topic when pressing Ctrl+F. However, that was 10+
years
ago, most people are very familiar with lazy loading now, it doesn't
make sense
to keep this additional hijack for this one topic use case.

Search is still accessible by pressing the `/` shortcut.
2025-04-15 15:14:54 +10:00
077649fafd FIX: bugs with refresh page after save fonts (#32282)
It takes a moment to sync site settings. Therefore, it is better to pass
new values to `refreshPage` function.

Also, it was not working for some fonts like `JetBrains Mono`.
SiteSetting key is `jet_brains_mono` but font family value should be
`JetBrains Mono`.
2025-04-15 12:02:28 +08:00
d8d341ebf6 FIX: remove newline from rich editor's pasted img title/alt (#32295)
New lines on `alt`/`title` embedded media are not allowed, causing an
invalid serialized Markdown which is not supposed to contain new lines
for these attributes.

This PR removes them during HTML parsing – we are not creating this new
line scenario otherwise.
2025-04-14 19:24:21 -03:00
29ca0ae0b1 FEATURE: add footnote (plugin) rich editor extension (#31719)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `footnote` node, parser, `^[inline]` input rule, toolbar button
item, and serializer.

Also adds a NodeView with an internal ProseMirror editor to edit the
footnote content.
2025-04-14 14:25:36 -03:00
a0a5b2889f DEV: replace rich editor input rules regex lookbehind (#31909)
Refactors the rich editor input rules matches that rely on a lookbehind,
it breaks on iOS <= 16.3.
2025-04-14 14:25:17 -03:00
f0057c7353 DEV: Drop legacy topic-list and raw-handlebars compilation system (#32081) 2025-04-14 10:42:40 +01:00
ee035582e2 FIX: Rename branding to logo and fonts (#32264)
Change branding page into logo and fonts.

In addition, icon for email setting and email appearance were changed.
2025-04-14 10:49:47 +08:00
8b5da219d8 UX: header search mobile support (#31711)
## Requirements

Initially defined in
https://meta.discourse.org/t/software-engineer-frontend-ember-js-yuriy-kurant/353612/14?u=yaran.

1. On mobile devices and tablets, users can open the search input field
by tapping the search icon
2. When opened, the search input takes over the entire header area:
    - Users can tap the sliders icon to navigate to the advanced search page
(/search)
    - Users can tap Cancel to close search input
3. After submitting a search, results area will take over the entire
screen:
    - Users can tap the X icon to clear the search term from the input field
    - Users can tap Cancel to close search results area and return to their
previous page (i.e. search area overlays content)

## Implementation

1. When opened, the search input takes over the entire header area:
    - changed panel width from `90vw` to `100vw`
    - on initial render (when search input is empty), search panel hovers over the header section only (doesn't cover main content below)
    - quick tip and recent searches lists are not displayed on mobile view
2. Tap on the sliders icon navigates to the advanced search page
(`/search`)
3. Tap on the **Cancel** button:
    - closes search menu
    - if the search term is present, it is cleared
4. Tap on the left-hand side **Search** icon triggers a topics search

## Dev notes

1. Added `// TODO` questioning `search` service `noResults` default value of `false`
2. Added animation on toggling header search panel (created `delayed-destroy` custom modifier)
3. Extracted in-context search filters into a standalone component `search-menu/active-filters`:
    - mobile: active filters below search input
    - desktop: active filters inside search input
3. Removed unnecessary top padding when search results are empty
4. Added `data-test-` attrs for Ember tests. Benefits:
    - semantically `data-test-` attrs indicate that these parts of the layout are covered with tests
    - decouples selector dependency on `id/class` names for testing purposes - eliminates risk of broken tests due to `id/class` name changes
2025-04-14 10:27:48 +08:00
198dc81375 FEATURE: Ctrl+M to toggle between rich/markdown editor (#32266) 2025-04-12 09:01:41 -03:00
36f364fe11 FIX: Ensure discovery queryParams do not persist invisibly (#32178)
Sharing a controller seems to make query params behave more weirdly than
normal. This change lets Ember create a separate controller instance for
each route, even though they will still share the same class.
2025-04-11 09:44:32 +01:00
181606e0bd FIX: Prioritize the author when replying to topic (#32244)
Added in https://github.com/discourse/discourse/pull/32086 this
prioritization did not accounted for when the user was replying to the
topic/OP.

Now when replying to the topic, the author will be prioritized in the
list.

All other cases are the same as before.

Added testing for all cases and changed `replyingToUser` to
`replyingToUserId` for clarity and consistency with API.

---------

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2025-04-10 09:02:32 -03:00
7de9f79f55 FIX: hide search field on invites page (#32236)
Prevents rendering the search field on the invites page.
2025-04-10 09:54:17 +04:00
db214a38a2 DEV: Add Content admin config page (#32194)
This PR adds a dedicated page for Content related site settings. It has four different site setting tabs.
2025-04-10 11:20:22 +08:00
db68fd7046 DEV: Skip prosemirror flaky (#32231)
Example of a failure is here

https://github.com/discourse/discourse/actions/runs/14345676579/job/40214833933
2025-04-10 12:54:11 +10:00
14a42bdafe FIX: incorrect flag message when en_GB language (#32191)
Currently, this is the order of i18n translate function:
1. Translation in required language;
2. Optional `defaultValue` provided;
3. Fallback to forum default language.

When admin set language as English GB, translation was not correctly
displayed as it went to step 2 and displayed `defaultValue` instead of
correct translation from default language.
2025-04-10 08:06:52 +08:00
3106c30f16 Added button to remove password from account (#32200)
Added button to remove password from account if user has a linked
external account or passkey

The button only displays if the user has at least one associated account
or a passkey set up. Uses the ConfirmSession dialog in addition to a
warning about deleting the password.

Users can still reset their password via the Reset Password button
(which will now display "Set Password" if they've removed it).

Also prevent user from removing their last remaining associated account
or passkey if they have no password set.

Replaces PR #31489 from my personal repo, with some fixes for conflicts
since then.
2025-04-09 09:32:51 -05:00
5836a9a664 UX: backspace rich editor keymap improvements (#32234) 2025-04-09 06:54:15 -03:00
0a63c94e4d UX: improve onebox handling on rich editor (#32221)
Adjusts the rich editor onebox handling to ensure the full protocol URLs
are passed to the inline/full onebox endpoints, but when they are
resolved, we keep the original textual content as the stored URLs for
the onebox nodes, because we need to keep them as-is when serializing
them back to Markdown.

Additionally, it now re-uses the `isTopLevel` logic for inline oneboxes,
so top level domains like `example.com` are not mistakenly inline
oneboxed.
2025-04-08 21:04:59 -03:00
ad0966afa9 FEATURE: Introduce new components listing page (#32164)
Follow-up to https://github.com/discourse/discourse/pull/31887

This commit introduces a new design for the components listing page, which
is not linked from anywhere in the UI at the moment, but it can be
accessed by heading to the `/admin/config/customize/components` path
directly. We'll make this new design available from the sidebar and
remove the old page once we've tested and validated the new design
internally.

Internal topic: t/146007.

---------

Co-authored-by: Ella <ella.estigoy@gmail.com>
2025-04-08 17:58:29 +03:00
e84083ee36 FEATURE: prosemirror-codemark for a fake boundary cursor on rich editor (#32165)
Uses prosemirror-codemark to provide a fake boundary cursor to code marks, to easily
prepend/append text either code-marked or not.
2025-04-08 10:32:15 -03:00
6fb8f3ff7a FEATURE: auto-link/unlink url-like words on rich editor when typing (#32163)
Using markdown-it's linkify strategy, this plugin adds marks to regular
text that happens to be identified as a URL, and removes marks from
link-marked text that happens to not be a valid URL anymore.

Additionally, it changes the onebox handling to only act if we're not in
the same word as the link to be oneboxed.
2025-04-08 10:31:51 -03:00
a021032a35 DEV: Extract e-mail logs into their own admin page (#32211)
This is a lift-and-shift of the admin e-mail logs, moving it out of the "Server setup & logs" page and into its own dedicated admin page.
2025-04-08 17:50:12 +08:00
063d28763a FIX: flaky admin_branding_spec fonts section (#32209)
Wait for state to be updated before submit fonts form to avoid random
failures.

Form was submitted too quickly.
2025-04-08 10:56:20 +08:00
8483d09fc4 UX: Add missing admin config page titles (#32198)
A number of admin config pages are missing a page title. This PR adds them in.
2025-04-08 10:02:11 +08:00
67d083ede0 FIX: flaky admin_branding_spec (#32193)
When remove image, ensure that state is updated before saving form.

We know that state is updated when remove button is no longer available.
2025-04-08 07:27:53 +08:00
601fecde06 FIX: flaky admin_customize_themes_spec (#32169)
Ensure that translations are loaded before checking input value.
2025-04-07 10:39:21 +08:00
928f9175f0 FEATURE: fonts section for branding page (#32031)
New configure fonts section was added. Because now we have two sections
completed (logos and fonts), new /branding page was introduced and old
/logo and /font pages was removed.

When text size is changed, modal is displayed to ask if preferences of
existing users should be retrospectively updated.



https://github.com/user-attachments/assets/f6b0c92a-117f-4064-bd76-30fa05acc6d3

---------

Co-authored-by: Ella <ella.estigoy@gmail.com>
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2025-04-07 10:28:42 +08:00
aa5fd55e71 FIX: Archiving messages from group inbox (#32166)
Bulk archiving group messages can be done from two places: a) from the user's view (/u/ted/messages/group/swedes) and b) from the group's view (/g/swedes/messages/inbox). Only the former is currently working. From the latter view, the action looks like a success, but is actually a no-op.
2025-04-04 16:05:43 +08:00
0724b03fb8 DEV: Bump Capybara.default_max_wait_time to 20 on CI (#32143)
There are flaky system tests that have been exhausting the 10 seconds
default max wait time which we have set previously on CI. However, I
have yet to be able to figure out why and lack the tools to be able to
figure out why. The hope here is that the upcoming playwright driver
will provide us with better tooling to debug such problems.

I've attempted to use `Capybara::Session#using_wait_time` by there is
some race condition going on where the session's default max wait time
is sometimes not set properly. I can't figure out why and have spent too
much time trying to figure out why. Instead, I will just bump up the
`default_max_wait_time` to `20`. This may the build take longer when
there are test failures but it is a trade-off we will make right now.
2025-04-04 12:50:28 +08:00
e3e5f20cb6 FIX: flaky admin_sidebar_navigation_spec (#32168)
Wait till all sections are expanded before checking expected links.
2025-04-04 12:38:31 +08:00
c4d971ea2c FIX: Consistent search shortcuts (#32099)
We now have 3 search UX variations:

* Header search
* Welcome banner search
* Icon search

And within each of these there is a `<SearchMenu />`
component with an input that needs to be focused based
on either Ctrl+F or `/` shortcuts. This commit makes
sure that each has a unique ID, and moves the functionality
of determining the "current" input ID and focusing the
input to the search service.

This fixes issues like where pressing Ctrl+F twice on
the header search would not reveal the regular browser
search.
2025-04-04 11:54:46 +10:00
7e77b24202 DEV: Preserve unsaved site settings (#32100)
This builds onto #32013 in two major ways:

- Unsaved changes are now persisted when you browse categories inside "All site settings".
- If you're about to navigate away (and lose edits) you will be prompted if you want to save or discard changes. (This applies to individual category site setting pages as well.
2025-04-03 16:10:30 +08:00
783072e24d FIX: hide search field on auth pages (#32132)
This change prevents rendering the search field on login and sign up
pages.
2025-04-02 17:21:26 +04:00
0cb08a3d2f DEV: Double timeout in spec/email_change_spec.rb (#32131)
Checking of the database state is still flaky on CI. Double the timeout
to give the server more time to process as a workaround.

Example of test flake:
https://github.com/discourse/discourse/actions/runs/14216968060/job/39835831706
2025-04-02 20:10:57 +08:00