**Description**
Currently, we don't have a way to customize the login template layout,
this change will allow for easier customization through plugins and
themes.
Enhances inbox messages dropdown with unread icon/count per each inbox option.
Dropdown implementation is switched from `select-kit` to `float-kit`.
---------
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
In our serializers, we have a method `cache_fragment` that we use for
caching chunks of JSON that are expensive to generate. We currently
don't clear this cache between tests, which causes tests to become flaky
since a cached fragment from one test can leak to another test and make
it fail.
Building the Discourse ember app is resource-intensive process. This
commit introduces a framework for us to build these assets centrally,
and make them available for people to download.
On every commit to `main`, a new GitHub actions workflow will build
development & production versions of the core assets, and publish them
as a github release under the `discourse/discourse-assets` repository. A
separate repository is being used to avoid polluting the main
`discourse/discourse` repository with one-git-tag-per-release.
The `assemble_ember_build.rb` script is updated to fetch the relevant
asset bundle. Requests are made to `get.discourse.org`, which then
redirects to GitHub releases. This redirection service is being used so
that we have the option to switch away from GitHub releases in future
without breaking existing Discourse installations.
For now, this behavior can be enabled by setting
`DISCOURSE_DOWNLOAD_PRE_BUILT_ASSETS=1`. In the near future, we hope to
make this the default, with opt-out via
`DISCOURSE_DOWNLOAD_PRE_BUILT_ASSETS=0`.
This improves the admin email log overflow by:
* allowing tables to horizontally scroll if needed
* ensuring `code` has pre-wrap to avoid very long lines
* making all links have overflow-wrap to avoid very long email address
and link issues
I've also removed some truncation CSS, because this is data we ideally
need to see all of, even if it has to wrap.
The horizontal scrolling is implemented by
horizontal-scroll-sync-wrapper.gjs, this is a new component I pulled out
of the existing responsive-table.gjs and updated. The component adds a
top scrollbar to horiztonally overflowing areas and syncs it up with the
bottom scrollbar to make scrolling a little easier.
These templates are quite old and can use some more general
improvements, but this gets them to a place where they aren't breaking
the layout.
Before (whole page scrolls, note the header and missing nav):
<img width="2302" height="1626" alt="image"
src="https://github.com/user-attachments/assets/551973cb-e4cc-4881-a0d9-33bb1237403b"
/>
After (only table scrolls):
<img width="2350" height="1354" alt="image"
src="https://github.com/user-attachments/assets/739b1f37-ae39-424e-8603-715bbc872e31"
/>
I'd like to unify our admin filtering around a central component that
achieves some simple styling. It looks like this:
<img width="2190" height="328" alt="image"
src="https://github.com/user-attachments/assets/ae223ab9-e12f-4e99-a2b8-968aa3a51805"
/>
This sort of filter has already been implemented in the AI plugin, for
the plugin index, and for color palettes. These implementations haven't
been all tied up into a single component yet.
In this PR I've put some stand-alone filters through the new
`AdminFilterControls` component.
This includes:
* Filtering by theme (when you have 8 or more themes). We didn't have a
filter here yet, but it's useful in some extreme cases (including
development!)
* Filtering by color palette. This existed already, but now uses the
shared component.
* Filtering by component. We already had a filter here, but it wasn't
using this new unified style. This was a little trickier because it's
not unusual for sites to have many components, so we paginate and filter
these server-side. I've added support for callbacks in
`AdminFilterControls` so it can support either client or server based
filtering.
<img width="2206" height="1108" alt="image"
src="https://github.com/user-attachments/assets/6ce6d2f1-1ed1-4168-a6fc-77760fd34384"
/>
<img width="2204" height="1182" alt="image"
src="https://github.com/user-attachments/assets/b0409bc3-9da0-4ae1-b1a3-dd3dcde2a0b3"
/>
<img width="2224" height="1156" alt="image"
src="https://github.com/user-attachments/assets/f82ef6dd-f5d4-46f0-9a57-00349522ef8f"
/>
By default, Sidekiq logs the `start` and `done` messages at the `info`
log level
when a sidekiq job executes. These log messages are not necessary in
production and is bloating our log files. Even in other environments, I
don't see how the messages are useful so we are going to just disable
this.
### Reviewer notes
See https://github.com/sidekiq/sidekiq/pull/6200
This commit adds a new dropdown preference to set the default color mode for
the user and change the color mode for the current device. It works the same way
as the interface color selector in the sidebar footer (or header), but it also allows
setting the default mode for the user that gets used when the user logs in on a
new device. It remains possible to set a color mode per device using the
sidebar/header selector or this new preference.
Internal topic: t/159358.
Some of the deprecated settings tests set our site settings to be global settings. When the settings are reloaded between tests (see `stub_deprecated_settings!()`), the setting loader (`SiteSettingExtension.setting()`) will check to see if there's a global setting that would override the site setting, and use that value from previous tests.
To fix this, we need to un-global the site setting after the test finishes.
These tests have a race condition when updating their models, they're using a `expect(page).to_not have_css(...)` check that may look at the DOM before the model update has been reflected in the DOM.
Switching to using `expect(page).to have_no_css(...)` lets Capybara wait until the DOM has finished updating.
In a previous PR I had to work with TopicGuardian#can_delete_topic? and I had to whip out pen and paper to untangle the single conditional that governs it. Now that that task is done, I'm going back to it to clear it up.
Commit by commit:
1. Move the tests to topic_guardian_spec.rb.
2. Add missing test cases for trashed- and category topics.
3. Break the conditional into individual code paths using guard clauses.
The edit_all_post_groups used to have TL4 as the default setting. This update:
- Adds in admins and moderators as well as makes those mandatory values.
- Gets rid of now-redundant is_staff? check.
- Makes use of the magic #edit_all_post_groups_map method.
## ✨ What's This?
Ref: t/158747
This test is ensuring that uploads work correctly when starting a new
conversation with a bot.
There's a race condition where the test can try to send a message before
the uploads have finished process, this fix waits until the uploads have
completed before continuing.
Currently, clicking on a mention of user who has set a custom status
causes the user card to fail to load. This happens because when the
username is extracted from the mention `<a>` element, the space between
the username and the status emoji is captured with the username and is
sent to the server which fails to lookup the user due to the erroneously
appended space.
To fix this, we should cleanup the captured username and remove
surrounding spaces using `trim()`.
On a27e20c we made an emergency perf fix to speedup generating text from
a topic for embeddings generation.
This introduced some issues, like missing separators between posts,
including to line breaks per included post all at the top of the
generated text, and resulted in using a lot less content per topics,
as we count the cooked size before stripping all the HTML tags.
This commit helps alleviate by:
- removing the "\n\n" * quantity of posts at the top
- adding a space between posts
- generating text 3 times longer than the max allowed lenght, since
it's getting shrinked after it's built by the Nokogiri.text call.
Ensures the textarea version of indentSelection only returns true when
the replaceText/selectText actions are applied. This is important
because its return is used to determine if itsatrap/prosemirror will
preventDefault or not when tabbing/shift-tabbing inside the editor.
If an anon Japanese user views Jane's summary page, then subsequently an
anon German user views Jane's summary page, the German user will see
topic titles in Japanese.
This commit prevents cache poisoning on the user summary page when content
localization is enabled.
Followup to 5873ea104d
Also remove the `scrollTop()`, which is now handled by `services/route-scroll-manager`.
Co-authored-by: Martin Brennan <martin@discourse.org>
This PR fixes 2 things.
1. If a `post` was written in `ja` (Japanese) and for some reason also
had a `post_localization` that is `ja`, it becomes 200%
2. When getting completion progress for "English (US)", if there exists
a "English (UK)" localization, we want to include that
3. Previously the completion count was also getting `post_localization`
from posts that are not candidates. If the user switches
`ai_translation_backfill_limit_to_public_content` from false to true, it
would include previously localized PMs when it should not.
Follow up: https://github.com/discourse/discourse/pull/33927