Commit Graph

944 Commits

Author SHA1 Message Date
b823fb297f FIX: skip flaky specs (#32786)
The proper fix was to apply what has been reverted in
7558e2c7cd
but we would have to break the API to apply this fix so I will just skip
these specs for now.
2025-05-19 09:47:37 +08:00
ae074f0c90 FIX: rely on capybara waiters (#32789) 2025-05-18 23:08:19 +02:00
920efb7fa7 FIX: uses correct capybara waiter (#32788) 2025-05-18 22:57:35 +02:00
ce03fff375 FIX: attempts to fix flaky in review media (#32787)
I suspect the within is doing a memoization of the preview at a moment
where the emoji has not been rendered yet, when we render the emoji we
might have a different instance of the preview in the within which
doesn't have the emoji.

Im not super confident about this theory, but the within is useless here
so it seems like a good thing to try first.

The error we have is:

```
Failure/Error: super

Playwright::Error:
  TypeError: Cannot read properties of null (reading 'namespaceURI')
      at eval (eval at evaluate (:313:29), <anonymous>:17:12)
      at UtilityScript.evaluate (<anonymous>:320:18)
      at UtilityScript.<anonymous> (<anonymous>:1:44)
  Call log:

[Screenshot Image]: /__w/discourse/discourse/tmp/capybara/failures_r_spec_example_groups_composer_using_review_media_does_not_flag_a_post_with_an_emoji_250.png

~~~~~~~ JS LOGS ~~~~~~~
ℹ️ Discourse v3.5.0.beta5-dev — https://github.com/discourse/discourse/commits/94932de163 — Ember v5.12.0
DEBUG: For more advanced debugging, install the Ember Inspector from https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi
Failed to load resource: net::ERR_CONNECTION_REFUSED
~~~~~ END JS LOGS ~~~~~

/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.5/lib/concurrent-ruby/concurrent/promises.rb:1268:in `raise'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.5/lib/concurrent-ruby/concurrent/promises.rb:1268:in `wait_until_resolved!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.5/lib/concurrent-ruby/concurrent/promises.rb:1482:in `value!'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/playwright-ruby-client-1.52.0/lib/playwright/connection.rb:121:in `send_message_to_server'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/playwright-ruby-client-1.52.0/lib/playwright/channel.rb:35:in `block in send_message_to_server_result'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/playwright-ruby-client-1.52.0/lib/playwright/channel.rb:67:in `with_logging'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/playwright-ruby-client-1.52.0/lib/playwright/channel.rb:34:in `send_message_to_server_result'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/playwright-ruby-client-1.52.0/lib/playwright/channel.rb:20:in `send_message_to_server'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/playwright-ruby-client-1.52.0/lib/playwright/javascript/expression.rb:10:in `evaluate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/playwright-ruby-client-1.52.0/lib/playwright/channel_owners/js_handle.rb:19:in `evaluate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/playwright-ruby-client-1.52.0/lib/playwright_api/js_handle.rb:46:in `evaluate'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-playwright-driver-0.5.6/lib/capybara/playwright/node.rb:885:in `block in path'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-playwright-driver-0.5.6/lib/capybara/playwright/node.rb:87:in `assert_element_not_stale'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-playwright-driver-0.5.6/lib/capybara/playwright/node.rb:884:in `path'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/node/element.rb:578:in `inspect'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/queries/selector_query.rb:106:in `description'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/queries/selector_query.rb:115:in `applied_description'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/queries/selector_query.rb:180:in `failure_message'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/result.rb:114:in `failure_message'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/node/matchers.rb:112:in `block in assert_selector'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/node/matchers.rb:869:in `block in _verify_selector_result'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/node/base.rb:84:in `synchronize'
./spec/rails_helper.rb:421:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/node/matchers.rb:868:in `_verify_selector_result'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/node/matchers.rb:110:in `assert_selector'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/session.rb:774:in `assert_selector'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/rspec/matchers/have_selector.rb:18:in `element_matches?'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/rspec/matchers/base.rb:52:in `matches?'
./spec/system/composer/review_media_unless_trust_level_spec.rb:20:in `block (3 levels) in <main>'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/session.rb:366:in `within'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/dsl.rb:52:in `call'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/dsl.rb:52:in `within_element'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/rspec/matcher_proxies.rb:15:in `within'
./spec/system/composer/review_media_unless_trust_level_spec.rb:20:in `block (2 levels) in <main>'
```
2025-05-18 22:57:00 +02:00
e60e832b63 DEV: fix flaky in admin site texts (#32783)
A spec could potentially go so fast that it would attempt to fill in the
input before we have gone through the various redirects resulting in an
error.

```
Failure/Error: super

Playwright::Error:
  TypeError: Cannot read properties of null (reading 'namespaceURI')
      at eval (eval at evaluate (:313:29), <anonymous>:17:12)
      at UtilityScript.evaluate (<anonymous>:320:18)
      at UtilityScript.<anonymous> (<anonymous>:1:44)
  Call log:
```

Now that we ensure that we have the current final state path we should
avoid this error.
2025-05-18 19:12:43 +02:00
19e1c0ecfd DEV: skips s3 multipart spec (#32780)
The spec is randomly failing, but it's not due to the system spec.
Sometimes the upload fails to work and we get an error from the service.
2025-05-17 15:32:22 +02:00
948939e998 FIX: uses correct waiters and APIs (#32778) 2025-05-17 15:32:07 +02:00
071ec5a240 FIX: Bug with 2FA setup right after signup (#32754) 2025-05-16 09:00:39 -04:00
7820dd2b8f FIX: Reset password link broken for non-staff user in confirm session dialog (#32765) 2025-05-16 15:09:03 +08:00
9cb3e2c5d2 DEV: Refactor tests & add animation (#32547) 2025-05-15 13:10:29 -05:00
305ebedfa1 Allow passing a redirect path to a param on the /login route (#32711)
Detects the `redirect` queryParam on the /login route. If the user is
already logged in, navigates to that page. Otherwise, sets the
"destination_url" cookie so that the user will be redirected after
logging in.

If the param doesn't start with a single slash, ignore it and follow
previous behavior (navigate to "/" or log in then navigate there)

Respects subfolder configs.
2025-05-15 08:48:06 -05:00
215a129b68 Revert UX: header search mobile support (#32748)
This reverts the complete work on "Improvements to mobile search" while
respecting all the related changes that were made after the next two
PRs:

- https://github.com/discourse/discourse/pull/32306
- https://github.com/discourse/discourse/pull/31711
2025-05-15 14:27:40 +02:00
51ebe7064c FEATURE: Show localized posts and topics based on user's locale (#32618)
Related:
- https://github.com/discourse/discourse-translator/pull/205
- https://github.com/discourse/discourse-translator/pull/274
- https://github.com/discourse/discourse-translator/pull/294

With this PR, we will start showing localized posts (if available) based
on the user's locale.

This work had been done in discourse-translator, but is now moving to
core.
2025-05-15 19:11:06 +08:00
231b3943d3 UX: simplify admin search, make more accessible (#32733)
This simplifies the admin search and adds some basic accessibility

Simplification: 
* Removes the filters for now, both in the modal and full-screen 
* Removes the link to full-screen from the modal
* Simpler input placeholder text
* Positioned to sit higher on the page, similar to a command palette 

Accessibility: 
* Results (or lack of) announced for screenreaders after query 

Bonus: 
* Makes the modal input sticky on scroll 
* Combined some styles shared between this and the chat menu (modifier +
k) under a `--quick-palette` class



Before:

![image](https://github.com/user-attachments/assets/0af2d741-e870-4ad2-b305-57dc4afc3946)


After:


![image](https://github.com/user-attachments/assets/a8492aed-03c7-4d73-a3d3-ae89834b82bc)

---------

Co-authored-by: Krzysztof Kotlarek <kotlarek.krzysztof@gmail.com>
2025-05-15 16:31:03 +10:00
ded2938700 UX: Focus on sign up form in social auth flow (#32728)
If user returns to the signup form with data from their social login,
then we shouldn't show the right side column, because it is confusing to
have buttons there that restart the social login flow. This PR makes it
so we only show the signup form.

Internal ticket: /t/154184

---------

Co-authored-by: Régis Hanol <regis@hanol.fr>
2025-05-14 13:28:43 -04:00
267736e5bc DEV: Show login-required splash in root route (take 2) (#32629) 2025-05-14 11:25:43 -04:00
33fbf19d05 FIX: ensure we can lookup identical ip addresses (#32725)
This has been broken in
b6aad28ccf

We correctly access the users object and added a test to prevent future
regressions.
2025-05-14 11:48:01 +02:00
c8d49a4d0a UX: split admin logo and fonts to separate pages (#32700)
Before we had logo and fonts page merged together. Decided to split
them.
2025-05-14 14:02:34 +08:00
a445e8cce5 DEV: Port the about page extra groups functionality into core (#32659)
We want to merge the theme component that allows admins to display extra groups on the about page. The settings for this are now under About your site.

All the code is lift-and-shift, with some minor adjustments, e.g. theme components can't use the group_list setting type, but it has been converted to that here.

Also the system tests for the admin controls are new.

This whole thing is gated behind a hidden site setting to avoid double rendering while we deprecate the theme component.
2025-05-14 09:44:25 +08:00
404e2598b3 DEV: Fix flaky system tests (#32720)
We were not correctly relying on capybara matchers leading to test
flakiness

```
ailure/Error: super

Capybara::Playwright::Node::StaleReferenceError:
  Element is not attached to the DOM

/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-playwright-driver-0.5.6/lib/capybara/playwright/node.rb:91:in `rescue in assert_element_not_stale'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-playwright-driver-0.5.6/lib/capybara/playwright/node.rb:81:in `assert_element_not_stale'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-playwright-driver-0.5.6/lib/capybara/playwright/node.rb:124:in `visible_text'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/node/element.rb:60:in `block in text'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/node/base.rb:84:in `synchronize'
./spec/rails_helper.rb:421:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/node/element.rb:60:in `text'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/result.rb:44:in `each'
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/result.rb:44:in `each'
./spec/system/page_objects/modals/sidebar_edit_categories.rb:45:in `map'
./spec/system/page_objects/modals/sidebar_edit_categories.rb:45:in `has_categories?'
./spec/system/editing_sidebar_categories_navigation_spec.rb:161:in `block (2 levels) in <main>'
```
2025-05-14 09:14:29 +08:00
4d99c839b6 FEATURE: porting type object to site settings (#32706) 2025-05-13 14:30:24 -03:00
6551bd8155 DEV: clean up review queue button classes (#32685)
These reject/approve buttons were getting `btn-default` classes rather
than `btn-danger` or `btn-success`, which meant the styles for the
colors had to be applied separately to `.approve-post` and
`.reject-post`. This also meant the styles needed an additional override
in themes.

Moving to our common button classes helps centralize the styles and
avoids a manual override being needed in themes.

Button appearance is the same before/after 


![image](https://github.com/user-attachments/assets/941514f6-90c4-477c-b2e2-a02b2f296acc)
2025-05-12 13:20:22 -04:00
d932383cf8 FIX: correct reload edit theme page (#32658)
When edit theme page is reloaded or visited directly, we should display
new layout.
2025-05-12 13:47:13 +08:00
ec24a7c3fd DEV: flaky spec (#32677) 2025-05-11 19:29:57 +02:00
7f2233b1d3 DEV: ensures type_in_search appends (#32674)
If the field had the value: "tags:" we would end up with "tag1tags:"
2025-05-10 13:03:52 +02:00
eff31e0d42 DEV: Speed up "having working core features" shared example by ~30% (#32666)
Doing a full page load in system test is expensive and takes about 1
second on average. Since this shared example is being run across 70
official
plugins, the additional time to execute these full page loads adds up.

Therefore, we are trading off some readability here for CI runtime.

Before:

```
Randomized with seed 7202
..................

Finished in 21.26 seconds (files took 1.72 seconds to load)
18 examples, 0 failures
```

After:

```
Randomized with seed 7202
........

Finished in 14.28 seconds (files took 1.74 seconds to load)
8 examples, 0 failures
```
2025-05-10 06:56:12 +08:00
38ee9a0a79 DEV: scroll to reply button before click (#32663)
This will help with reliability of specs.
2025-05-09 11:46:15 +02:00
6154fa6b45 FEATURE: Add translations to posts (#32564)
## 🔍 Overview
This update adds the ability for users to manually add translations to
specific posts. It adds a 🌐 icon on the post menu where you can click to
add translations for posts.

It also introduces a new site setting:
`content_localization_debug_allowed_groups` which is convenient when
debugging localized posts. It adds a globe icon in the post meta data
area along with a number of how many languages the post is translated
in. Hovering over the icon will show a tooltip with access to editing
and deleting the translated posts.

## 📸 Screenshots
<img width="1234" alt="Screenshot 2025-05-07 at 13 26 09"
src="https://github.com/user-attachments/assets/9d65374d-ee3e-4e8b-b171-b98db6f90f23"
/>
<img width="300" alt="Screenshot 2025-05-07 at 13 26 41"
src="https://github.com/user-attachments/assets/6ee9c5e6-16ed-4dab-97ec-9401804a4ac8"
/>
2025-05-08 10:40:36 -07:00
a1ed6f36f0 FIX: redirect to new themes page after deletion (#32638)
When a theme is deleted, we should redirect to new themes page.
2025-05-08 12:29:04 +08:00
153ee0eb9f UX: Include custom text field description in signup form (#32624)
Reported in
https://meta.discourse.org/t/signup-instructions-arent-showing-for-text-custom-user-fields/359935?u=rishabh
2025-05-07 13:05:48 -04:00
183546c2a1 UX: Various improvements to the new color palette page (#32597)
This commit makes various changes and improvements to the new color palettes
page that was introduced in
https://github.com/discourse/discourse/pull/32379. Specifically, it:

* Removes the ‘Logos and fonts’ banner
* Removes the icon from the palette names in the list
* Moves the ‘new’ button to the top of the palette list
* Excludes theme-owned color palettes from the color palettes page since
these will be editable directly from the theme page
* Makes the name the primary text if a color has no description
* Adds a button next to the name field to save just the name
* Adds a ‘Delete’ button alongside the existing ‘Duplicate’ button
* Adds a ‘Revert’ button to change a modified color back to its default
value (based on the base palette of the palette)
2025-05-07 17:53:50 +03:00
addaa03192 DEV: uses local playwright chromium for now (#32613)
We have had multiple issues while using the chrome channel:
- super slow start of the spec, I can confirm I don't have it on
chromium
- more risk of different failures between local dev machines and CI

There was a test not working on chromium, as it doesn't have mp4 codecs
out of the box. I changed the spec to use webm instead and it's now
working correctly.

This commit also fixes a bug with the video/trace paths which were
incorrect, and also makes another test less flakey with uploads event
though Im not very clear on what is going on here, we need to dig this.

We now need to figure out a way to have this on the test image, but this
is for now a better solution.
2025-05-07 10:17:25 +02:00
b6aad28ccf DEV: replace selenium driver with playwright (#31977)
This commit is replacing the system specs driver (selenium) by
Playwright: https://playwright.dev/

We are still using Capybara to write the specs but they will now be run
by Playwright. To achieve this we are using the non official ruby
driver: https://github.com/YusukeIwaki/capybara-playwright-driver

### Notable changes

- `CHROME_DEV_TOOLS` has been removed, it's not working well with
playwright use `pause_test` and inspect browser for now.

- `fill_in` is not generating key events in playwright, use `send_keys`
if you need this.

### New spec options

#### trace

Allows to capture a trace in a zip file which you can load at
https://trace.playwright.dev or locally through `npx playwright
show-trace /path/to/trace.zip`

_Example usage:_

```ruby
it "shows bar", trace: true do
  visit("/")

  find(".foo").click

  expect(page).to have_css(".bar")
end
```

#### video

Allows to capture a video of your spec.

_Example usage:_

```ruby
it "shows bar", video: true do
  visit("/")

  find(".foo").click

  expect(page).to have_css(".bar")
end
```

### New env variable

#### PLAYWRIGHT_SLOW_MO_MS

Allow to force playwright to wait DURATION (in ms) at each action.

_Example usage:_

```
PLAYWRIGHT_SLOW_MO_MS=1000 rspec foo_spec.rb
```

#### PLAYWRIGHT_HEADLESS

Allow to be in headless mode or not. Default will be headless.

_Example usage:_

```
PLAYWRIGHT_HEADLESS=0 rspec foo_spec.rb # will show the browser
```

### New helpers

#### with_logs

Allows to access the browser logs and check if something specific has
been logged.

_Example usage:_

```ruby
with_logs do |logger|
  # do something

  expect(logger.logs.map { |log| log[:message] }).to include("foo")
end
```

#### add_cookie

Allows to add a cookie on the browser session.

_Example usage:_

```ruby
add_cookie(name: "destination_url", value: "/new")
```

#### get_style

Get the property style value of an element.

_Example usage:_

```ruby
expect(get_style(find(".foo"), "height")).to eq("200px")
```

#### get_rgb_color

Get the rgb color of an element.

_Example usage:_

```ruby
expect(get_rgb_color(find("html"), "backgroundColor")).to eq("rgb(170, 51, 159)")
```
2025-05-06 10:44:14 +02:00
25dfc64b39 FEATURE: Add color palette list selection to new UI (#32379)
Follow-up to https://github.com/discourse/discourse/pull/31742

This commit adds a color palettes list to the new color palette edit page
that was introduced in the linked PR to allow navigating between color
palettes. It reuses the same UI that we already have in the legacy color
palette UI (`/admin/customize/colors`), but we may redesign the page in
the future.
2025-05-05 05:12:50 +03:00
3492819c19 DEV: Don't allow context-free system post destruction (#32523)
There are instances of posts being deleted by system_user where the context is left blank in the staff action logs, leading to confusion about why exactly they have been deleted.

This change deprecates using the PostDestroyer as system_user without providing a context, and adds a context to all call sites currently missing it in core. Plugins to be done after this is merged.
2025-05-05 09:58:29 +08:00
ffa406b0b1 UX: Add more info to theme cards (#32334)
Demo:
<img width="1431" alt="Screenshot 2025-05-02 at 2 24 41 pm"
src="https://github.com/user-attachments/assets/c8ec824e-25df-4efc-a4be-c774a2a97896"
/>
<img width="1480" alt="Screenshot 2025-05-02 at 2 24 32 pm"
src="https://github.com/user-attachments/assets/a4020283-9b6d-4f5e-a8c2-72b7608a6026"
/>

Mobile:
<img width="424" alt="Screenshot 2025-05-02 at 2 25 29 pm"
src="https://github.com/user-attachments/assets/af68669a-7bb4-46dc-92ab-6ecc7a3f3842"
/>
<img width="421" alt="Screenshot 2025-05-02 at 2 25 36 pm"
src="https://github.com/user-attachments/assets/961d9f5c-8010-4c5f-a319-6e356b088667"
/>
2025-05-05 09:06:05 +08:00
82d84af6b0 Revert "DEV: Show login-required screen in root route (#32350)" (#32562)
This reverts commit 10df7fdee060d44accdee7679d66d778d1136510.
2025-05-02 11:50:43 -04:00
4cd5e7070b FIX: wizard logo preview (#32543)
Bug introduced in this commit -
https://github.com/discourse/discourse/commit/e41897a3066
2025-05-01 09:57:14 -04:00
07a4ffdf58 UX: display search input and open modal on click (#32508)
In this PR we hide search input.

https://github.com/discourse/discourse/pull/32485

However, search input is much more intuitive. Therefore, input was
brought back and opens modal on click. In addition, search link was
removed.
2025-05-01 10:12:12 +08:00
10df7fdee0 DEV: Show login-required screen in root route (#32350)
This changes means that login-required sites will show a splash screen
on `/`. Users heading to `/login` or `/signup` will see the respective
forms.
2025-04-30 12:32:18 -04:00
19e93142e4 DEV: Introduce reactive JS API for viewport size (#32060)
Usage:

```js
@service capabilities;

...

this.capabilities.viewport.sm; // True when viewport is sm or larger
this.capabilities.viewport.md; // True when viewport is md or larger
// etc.
```
These booleans will update live when the browser is resized. Therefore,
they should only be used in an autotracking context, so that Ember will
re-render things appropriately when they change.
2025-04-30 15:26:59 +01:00
84659cd234 FEATURE: Add routeHistory service, SessionStore service and make back to forum button go back to previous page (#32260)
1000% copied from what we have in the chat

08d5cf01cd/plugins/chat/assets/javascripts/discourse/services/chat-state-manager.js (L164-L172)

Created a service that will return the last visited URLs.

Also created a sessionStore service.

And added it to the `back-to-forum` component for use.

Maybe we could use it in the `BackButton` component, too.

Then, following the [Rule of
Three](https://blog.codinghorror.com/rule-of-three/), update the chat to
use this service as well.
2025-04-30 09:48:00 -03:00
4e760f7b79 FIX: don't error when no filter is set in discovery heading (#32516)
In some rare cases, plugins can add nav items without a filter. For
example, the ActivityPub plugin does this. The recent change in
https://github.com/discourse/discourse/pull/32422 results in a JS error
on those pages, see report in
https://meta.discourse.org/t/list-of-activitypub-followers-of-a-tag-actor-not-shown-on-discourse-meta/363971

This fixes the issue.
2025-04-29 11:40:11 -04:00
ed1e0e30f2 DEV: Remove full_page_login setting (#32189)
We are making this the only option for our login/signup
pages on April 29th, 2025, per

https://meta.discourse.org/t/introducing-our-new-fullscreen-signup-and-login-pages/340401.

This commit removes the `full_page_login` setting and any logic
around it, as well as deleting the old login and signup modals,
and removing leftover problem checks and settings from the database.
2025-04-29 10:40:40 +02:00
e3b35ff2a5 FIX: remove sidebar filter (#32485)
Remove sidebar filter in favour of search.

In addition:
- Search was moved up just below Dashboard;
- Do not perform search when filter is empty;
- Display "no results".

![Screenshot 2025-04-28 at 12 37
38 pm](https://github.com/user-attachments/assets/d8cabbca-2a26-413b-abfc-5ae143ff8da6)
![Screenshot 2025-04-28 at 12 37
59 pm](https://github.com/user-attachments/assets/fbae4b8d-60a2-414e-bf40-86e8c50538e6)
![Screenshot 2025-04-28 at 12 38
12 pm](https://github.com/user-attachments/assets/e04371cd-392e-48eb-91c9-21a3d8fc44c0)
2025-04-28 15:57:29 +08:00
ffa2c192bf FIX: rich editor link backspace edge case (#32476) 2025-04-27 23:45:46 -03:00
7b062e24de DEV: refactor load-more component to glimmer and use intersection observer (#32285)
This PR makes the following key changes to the load-more component:

* Updating to a Glimmer component
* Changing from an eyeline/scrolling-based mechanism to an
IntersectionObserver to determine when to load
* Keeping track of a single invisible sentinel element to help trigger
the loadMore action instead of having to find and track the last item of
the collection upon every load
* The component can now be used without wrapping around some content to
be yielded - the intent is to use this for cases like
[DiscoveryTopicsList](f0057c7353/app/assets/javascripts/discourse/app/components/discovery/topics.gjs (L222))
where we might want more precise placement of the sentinel element.
* Added utility toggle functions to control observer behaviour in this
class for testing

We will replace the load-more mixin in DiscoveryTopicsList in another
PR.



https://github.com/user-attachments/assets/50d9763f-b5f8-40f6-8630-41bdf107baf7


### Technical Considerations
1. Keeping track of a single sentinel element simplifies the logic
greatly and is also more robust to changes in the collection that's
being loaded. (ref: a [previous
commit](2279519081)
that was following the previous approach of tracking specifically the
last item of the loaded collection); this also sidesteps odd edge cases
like if the tracked element is larger than the entire viewport.
2. Using
[isIntersecting](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry/isIntersecting)
instead of calculating manually whether the element is in the viewport
is also less flaky - I ran into issues with the boundingClientRect
inconsistently being calculated as outside the viewport on different
sized screens.
3. We need to properly bind `loadMore` functions with the action
decorator, otherwise the way we pass the loadMore callbacks through to
the observe-intersection modifier results in attempting to call it on
the loadMore component context instead. I've done this for all such
functions except for the one in
[`category-list`](0ed4b09527/app/assets/javascripts/discourse/app/models/category-list.js (L117))
which uses `@bind` that should be equivalent in terms of binding to the
correct `this`.
2025-04-28 10:22:35 +08:00
ca658a8bb0 A11Y: add H1 tags for screenreaders on discovery routes (#32422)
Over the years we've received multiple pieces of feedback around our
lack of meaningful H1 tags on our topic lists.

This adds an `<H1>`, hidden with `.sr-only`, for screenreaders that
describes the content of our discovery routes. I've tried to keep these
structured in a way that's somewhat consistent and uses natural
language.

The translations could probably be more efficiently structured, but I
think we need a good amount of flexibility here for translators to
change the sentence structure.

Ultimately this means people using screenreaders will know which page
they're on while navigating headings... and without having to parse
through our navigation.

For example (made visible to demonstrate):


![image](https://github.com/user-attachments/assets/ae397317-b167-44b9-9dfa-79ddd8f9dfda)


![image](https://github.com/user-attachments/assets/fbdb8c49-03ed-40af-ae21-c7eb841f3d3e)


![image](https://github.com/user-attachments/assets/8f36da9d-04cb-4c6b-a4c3-baffbecc64e5)


![image](https://github.com/user-attachments/assets/fc9f3f8d-35a1-4953-84cf-337a00077e26)
2025-04-25 15:08:37 -04:00
b6281d0c52 DEV: Introduce with_security_key system test helper (#32459)
Instead of having each test go incur the overhead of having to go
through the actual user flow to register a security key, we can generate
the WebAuthn credentials on the server side and adds it to the virtual
authenticator.
2025-04-25 15:40:07 +08:00
199d7fb074 DEV: Reduce runtime of spec/system/(login|signup)_spec.rb (#32436)
This commit applies a similar optimisation as
d0d755ad8c478db45e3298df9de1cdabe59d9592.

Basically, the `full_page_login` site setting is going to be dropped
this week and these extra system tests we are running due to this site
setting is accounting for a significant percentage of the overall
runtime for core system tests.

### Reviewer notes

The PR to remove the `full_page_login` site setting is at
https://github.com/discourse/discourse/pull/32189 and scheduled to be
merged by us on 29th April.
2025-04-24 17:55:29 +08:00