This particular system test is taking a long time (~20 seconds) on CI
because it is doing many full page loads. This commit refactors the test
to be more efficient about the number of full page loads triggered by
the tests thus reducing the runtime by half.
Co-authored-by: Krzysztof Kotlarek <kotlarek.krzysztof@gmail.com>
The H1 doesn't work here because the same text appears on all top level
discovery pages and it doesn't describe the page content or purpose.
So for example, navigating from heading to heading with a screen
reader... on every discovery page you'd end up hitting "welcome back,
username" before jumping to the next heading level (which are topic
titles) — this is undesirable.
The H1 was adding bold and margin, so I've added that to the class.
There are no visual changes.
Without a site logo we render a the site name in the header as text,
this is a nice fallback!

...but it's marked up as an H1, and having the same H1 on every page
means it's not a meaningful page heading and can make headings fairly
annoying to navigate using screenreaders and other assistive
technologies
This converts it to a div and ensures that it retains the bold styling
previously applied by the heading tag. Font size is already handled by
the ID, so there are no visual changes as a result.
Adds support to creating an "autolink" by explicitly typing the
`<https://link>`.
Changes linkification while typing to only act when `markup` is
`linkify` (so, not a `[normal](link)` nor an `<autolink>`), and adds a
test to make sure `<http://auto.links>` won't convert to a `linkify`
while typing.
Avoids linkifying within code when pasting `text/html`.
Removes the `markup: "linkify"` when pasting a URL over a selection, as
that will create a `[normal](link)` instead.
Fixes the case on Firefox when you're typing an `example.com` URL
mid-paragraph and it stopped the link mark before the last letter,
leaving an un-linked dangling `m`.
Also uses a `linkify.test()` call before `linkify.match()` for "best
speed" as per
https://markdown-it.github.io/linkify-it/doc/#LinkifyIt.prototype.match.
When a user is silenced they can, given they have the permissions, enter anonymous mode and keep posting, essentially bypassing the silence that way.
This change delegates the silenced_till attribute to the main user record if the user is anonymous.
At the moment the reply count is labelled by the topic list's header
column, which is good — but we don't actually describe what the link
does, so it's a little ambiguous.
This adds an aria-label to describe the behavior "jump to first post" so
it will be read as:
"n replies, jump to first post"
This provides better coverage for link-to-link navigation because it
both describes the number and the function.
This is particularly important for array of primitives, eg: `["a", "b",
"c"]` where ember will struggle to know it's re-rendering the same
object.
The previous code was mostly working by chance as calling index on
something almost works for anything in javascript. But since we
introduced array of primitives in collections, we could now end up with
an `undefined` value for the items of the collection, and calling
`index` on `undefined` would raise an error.
This commit create a more general and explicit solution to this problem.
This PR addresses the issue discussed in
https://meta.discourse.org/t/failed-error-when-trying-to-un-star-the-bug-reporter-badge/330523
1. Fixed an issue in `user_badges_controller.rb` where the
`toggle_favorite` method could incorrectly treat badges already marked
as favorite as not being favorite.
2. Automatically synchronize the `is_favorite` status for new badges
when a user is granted a multiple-grant badge.
Our category cache is currently specific to the site locale.
Expanding the key to take in `I18n.locale` as well to accommodate for
category translations in core.
Over the past couple of weeks we've been adding Settings tabs to a lot of admin sections, to categorize some of the previously uncategorized site settings.
Now that all that is done, we can remove the Advanced > Other section, which used to contain them.
Previously, clicking "Groups" on the admin dashboard would bring you to the public groups page. Historically, the public and admin actions have been mixed together on that page.
This is a bit of a frustrating experience when working on the admin dashboard, and also prevented us from adding a "Settings" tab for group-related site settings.
This PR adds an "admin groups" page, which is just an exact copy of the public groups index for now. This allows us to add the "Settings" tab, and lets us gradually work un disentangling the public- and admin parts of groups.
We need to reuse some of the groups UI in the admin dashboard. This is currently a bit hairy because it's using the old controller + routes + template style design.
This PR extracts to components, GroupCard, and GroupList, and shifts the logic in there.
This change does two things:
Modernizes the admin badges UI implementation. (Routes + controllers → components + services.)
Adds a Settings tab to the new badges page.
For all intents and purposes, this change is a lift-and-shift modernization. The addition of the settings tab is trivial once that is covered.
This was refactored from an actual Mixin some time back. This PR moves
the function to the lib folder and keeps the same logic/interface
otherwise.
We'll remove the mixin file once all non-core repos change to use the
new file.
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.
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>
We don't want "ghost" `content` within mention/hashtag, as they're
already rendering their non-editable content on `toDOM`.
`atom: true` is not necessary for content-less nodes
Re-use existing heading node spec instead of re-creating.
A UX improvement from these changes is a better Cmd-Left/Home navigation
when these nodes begin a paragraph and the caret is after them.
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.
* Hides the welcome banner search in mobile, it's not necessary
since there is the header search
* Fix an issue where the positioning of the search input for
the header on mobile was affecting welcome banner search
* Make the welcome font a bit smaller and with less padding so
it takes up less room on mobile
---------
Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>
This eliminates the `/mobile` and `/desktop` `header.scss` files and
moves the relevant CSS under `common/header.scss` using `.mobile-view`
and breakpoints.
I was also able to eliminate some redundant and unused styles in the
process and move a couple more general styles to `discourse.scss`
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>
### Changes made
#### Styling
1. added `4px` spacing between search input and cancel button
2. increased cancel button size (with padding) to match input height
3. decreased search panel padding by 1/2 from 16px to 8px
4. animation show/hide changed (from vertical to horizontal) and made it
quicker (300ms->200ms)
5. set html unscrollable when search panel is open
#### Dev
1. changed `data-test-` value to be consistent with other element's
attrs values
2. clear search action tag changed from `<a>` to `<DButton>`
When a reviewable is auto-claimed, this actually claims all reviewables in a given topic, rather than just the specific post that the reviewable is about. Particularly for sites that require all posts to be reviewed, this can quickly result in many reviewables being unintentionally claimed by the first moderator to review a post in a given topic.
Unfortunately, due to `ReviewableClaimedTopic` being originally built to claim by topic, we can't fully fix this without significant re-architecture. In the mean time, however, we can ensure that reviewables are unclaimed once they've been handled, so that the next reviewable from a topic won't be automatically claimed.
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).
Followup 735bef9ea0d497ae7e04bd4a104bd86e928fc472
Remove the tip in search for users to press Ctrl+F
again to do browser search, as this is no longer relevant
This update adds randomized SVG placeholder designs for themes without
screenshots. Each placeholder pulls from the theme’s color palette to
give a better visual hint of what the theme might feel like.
There are a few different styles:
1. Envelope-style gradient – uses `tertiary`, `quaternary`, and
`highlight`
2. Soft blur gradient – uses `tertiary`, `quaternary`, and `highlight`
3. Mesh – uses `tertiary` and `secondary`
4. Layered waves – uses `tertiary`, `quaternary`, `highlight`, `danger`,
and `success`
The style is randomly picked per theme, so the grid looks more varied by
default.
<img width="1109" alt="image"
src="https://github.com/user-attachments/assets/5ede0ecf-a1e4-46c0-9fd2-bee4b6c672c2"
/>
Internal: /t/149935
---------
Co-authored-by: Jarek Radosz <jradosz@gmail.com>