Commit Graph

57090 Commits

Author SHA1 Message Date
Penar Musaraj 334d3b5fa9 Replace `action` with `on click`
This seems to work much better in iOS. The focus event is respected
and the software keyboard is invoked.
2024-12-16 18:42:05 -05:00
Penar Musaraj e002d5159f update comment 2024-12-13 14:16:21 -05:00
Penar Musaraj 883304b18c another tweak 2024-12-13 14:08:53 -05:00
Penar Musaraj dfc1f9b318 extend touch-actions block a bit more 2024-12-13 14:08:53 -05:00
Penar Musaraj beb8c92eba test `touch-action` on submit panel 2024-12-13 14:08:52 -05:00
Penar Musaraj 983bdebc81 Trying this out with a body scroll lock 2024-12-13 14:08:52 -05:00
Penar Musaraj a7965297bc skip put-cursor-to-end for edits > 150 chars only 2024-12-13 14:08:52 -05:00
Penar Musaraj e09f870df4 Disable put-cursor-at-end in iOS
When editing, it messes up the layout because iOS scrolls the
composer away, especially if the post is long. This means an extra tap
for the user sadly, but much more consistent behaviour.
2024-12-13 14:08:52 -05:00
Penar Musaraj cd9f7ca45b remove safari-hacks file 2024-12-13 14:08:52 -05:00
Penar Musaraj bedccbe605 body scroll lock improvements
Limit logic to the composer state (keyboard visibility is not relevant)
2024-12-13 14:08:52 -05:00
Penar Musaraj c2686ec793 Tweaks for ipados 2024-12-13 14:08:52 -05:00
Penar Musaraj 76243fce15 Add ipados-device class, move ios-device class to clientside 2024-12-13 14:08:52 -05:00
Penar Musaraj cc901cc8e6 fine-tune scroll lock on ios
reserveScrollBarGap and allow scrolling items inside composer
2024-12-13 14:08:52 -05:00
Penar Musaraj aaf1012520 Use body scroll and full-height composer on all touch devices
Maybe a big hammer, but fixes issues on iPad
2024-12-13 14:08:51 -05:00
Penar Musaraj af282b0daf skip body scroll lock on ipad 2024-12-13 14:08:51 -05:00
Joffrey JAFFEUX 5f42e809f0 linting 2024-12-13 14:08:51 -05:00
Joffrey JAFFEUX 7ed59b3bb6 more general solution 2024-12-13 14:08:51 -05:00
Joffrey JAFFEUX 48bfb7ab0d always handle body scroll on mobile 2024-12-13 14:08:51 -05:00
Penar Musaraj e65bc07677 Fix issues with topic-footer changes in main 2024-12-13 14:08:51 -05:00
Penar Musaraj 4679ea3dc3 DEV: Address composer mobile positioning issues 2024-12-13 14:08:51 -05:00
Penar Musaraj 0806975c4e Reapply "UX: Fix Android Firefox Mobile reply position (#29751)"
This reverts commit 3a8fb299261d346d36e399d054dcf8f6dfb12fd1.
2024-12-13 14:08:23 -05:00
Penar Musaraj a84b514148 Revert "UX: Fix Android Firefox Mobile reply position (#29751)"
This reverts commit f62ed063fb.
2024-12-13 14:08:23 -05:00
Mark VanLandingham 85773eee21
DEV: Pass in old post to post_moved DiscourseEvent (#30274) 2024-12-13 12:30:00 -06:00
dependabot[bot] 316ba67aac
Build(deps): Bump irb from 1.14.1 to 1.14.2 (#30248) 2024-12-13 19:08:28 +01:00
David Taylor b410677fcd
DEV: Disable Ember's LOG_STACKTRACE_ON_DEPRECATION (#30275)
This feature writes a stack trace as part of the message. That means it is not sourcemapped by the browser, and you have further to scroll to find the real backtrace.

In the past we avoided this feature with our production 'deprecation shim', but that was removed as part of our Ember 5.12 upgrade.
2024-12-13 17:56:11 +00:00
Régis Hanol 29dad8bbea
FIX: expanding / collapsing own user info panel (#30272)
When viewing your own user profile, we offer the ability to expand / collapse your user info.

By default, the info are collapsed and the button to toggle it only worked once. Meaning you could expand the info but not collapse it back.

This fixes the issue by using `toggleProperty()` instead of directly `set()`-ing a value.

Also added an acceptance test to ensure it doesn't regress.

Was reported in https://meta.discourse.org/t/342254
2024-12-13 17:37:57 +01:00
Régis Hanol bdd4392c01
DEV: skip flaky chat specs (#30273)
while we figure out if we want to keep the feature or replace it with a simpler version.

Internal ref - t/144221
2024-12-13 17:37:40 +01:00
David Taylor d0df16535e
DEV: Make banned-phrase detection case insensitive (#30271)
Followup to 78dacf773a
2024-12-13 16:24:35 +00:00
David Taylor 78dacf773a
DEV: Ensure banned phrases do not occur in en translations (#30264)
This will help us keep consistency with things that we've decided to rename. Initial rules are for "color scheme" -> "color palette", and "private message" -> "personal message".

Also updates some remaining occurences of "color scheme" in our translation files.

Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>
2024-12-13 16:02:32 +00:00
Joffrey JAFFEUX f6a4de4805
DEV: adds support for nested collections and objects (#30265)
Collections were an existing concept in FormKit but didn't allow nesting. You can now do infinite nesting:

```gjs
<Form
  @data={{hash
    foo=(array
      (hash bar=(array (hash baz=1))) (hash bar=(array (hash baz=2)))
    )
  }}
  as |form|
>
  <form.Collection @name="foo" as |parent parentIndex|>
    <parent.Collection @name="bar" as |child childIndex|>
      <child.Field @name="baz" @title="Baz" as |field|>
        <field.Input />
      </child.Field>
    </parent.Collection>
  </form.Collection>
</Form>
```

On top of this a new component has been added: `Object`. It allows you to represent objects in your form data. Collections are basically handling arrays, and Objects are objects.

This is useful if you form data has this shape for example:

```javascript
{ foo: { bar: 1, baz: 2 } }
```

This can now be mapped in your form using this syntax:

```gjs
<Form @data={{hash foo=(hash bar=1 baz=2)}} as |form|>
  <form.Object @name="foo" as |object name|>
    <object.Field @name={{name}} @title={{name}} as |field|>
      <field.Input />
    </object.Field>
  </form.Object>
</Form>
```

Objects accept nested collections and nested objects. Just like Collections.

A small addition has also been made to `Collection`, they now support a custom `@tagName`, it's useful if each item of your collection is the row of a table for example.
2024-12-13 15:43:32 +01:00
Jordan Vidrine b191d63c1b
DEV: removes sidebar-extensions css (#30266)
This PR cleans up some unnecessary CSS which are not used anymore. Support of sidebar in chat has a long history due to the various steps leading to the sidebar as we know it today.
2024-12-13 15:36:30 +01:00
Renato Atilio a21f064fad
UX: add color-scheme meta tag to _head (#30245)
Adds the `color-scheme` meta tag to the `_head` partial and removes it from the finish installation template to prevent it from being added twice.
2024-12-13 08:10:08 -03:00
Loïc Guitaut 9e9abe0a82 DEV: Unify params access in services
Currently, there are two ways (kind of) for accessing `params` inside a
service:
- when there is no contract or it hasn’t been reached yet, `params` is
  just the hash that was provided to the service. To access a key, you
  have to use the bracket notation `params[:my_key]`.
- when there is a contract and it has been executed successfully,
  `params` now references the contract and the attributes are accessible
  using methods (`params.my_key`).

This patch unifies how `params` exposes its attributes. Now, even if
there is no contract at all in a service, `params` will expose its
attributes through methods, that way things are more consistent.

This patch also makes sure there is always a `params` object available
even when no `params` key is provided to the service (this allows a
contract to fail because its attributes are blank instead of having the
service raising an error because it doesn’t find `params` in its context).
2024-12-13 11:13:18 +01:00
Joffrey JAFFEUX cbc0ece6e8
DEV: <DSelect /> (#30224)
`<DSelect />` is a wrapper similar to our existing `<DButton />` over the html element `<select>`. The code is ported from form kit which is now directly using `<DSelect />`. Note this component has also been used in edit topic timer modal.

This component is recommended for a small list of text items (no icons, no rich formatting...).

Usage:

```gjs
<DSelect class="my-select" @onChange={{this.handleChange}} as |select|>
  <select.Option @value="foo" class="my-favorite-option">Foo</select.Option>
  <select.Option @value="bar">Bar</select.Option>
</DSelect>
```

This commit comes with a set of assertions:

```gjs
import dselect from "discourse/tests/helpers/d-select-helper";
import { select } from "@ember/test-helpers";

assert
  .dselect(".my-select")
  .hasOption({ value: "bar", label: "Bar" })
  .hasOption({ value: "foo", label: "Foo" })
  .hasNoOption("baz");

await select(".my-select", "foo");

assert.dselect(".my-select").hasSelectedOption({value: "foo", label: "Foo"});
```
2024-12-13 10:40:06 +01:00
Natalie Tay 622eb9e51c
FIX: Avoid zipping when adding users to groups (#30263) 2024-12-13 17:24:40 +08:00
Alan Guo Xiang Tan ebfc33b556
DEV: Remove line of code that does not work (#30258)
We can't delete the file from disk as some of the assets are still
served by the app instead of going through the S3 bucket. It is a bug we
need to fix but it also means this ENV is unsafe now. Just drop the env
until we ensure all assets requested by the app are requested from the
S3 bucket directly.
2024-12-13 09:36:51 +08:00
Jarek Radosz ae6fca2f0b
DEV: Add io-console to default gems list (#30257) 2024-12-13 02:35:05 +01:00
Martin Brennan fae6ffcf06
UX: Introduce <DStatTiles /> component (#30238)
Introduces a new component used to show a grid of stats
on any page, mostly used for dashboards and config pages.
This component yields a hash with a `Tile` component property,
and the caller can loop through their stats and display them
using this component.

Each stat needs a @label and a @value at minimum, but can
also pass in a @tooltip and a @url.
2024-12-13 11:32:46 +10:00
dependabot[bot] 54f0dd40ad
Build(deps): Bump css_parser from 1.19.1 to 1.20.0 (#30251)
Bumps [css_parser](https://github.com/premailer/css_parser) from 1.19.1 to 1.20.0.
- [Changelog](https://github.com/premailer/css_parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/premailer/css_parser/compare/v1.19.1...v1.20.0)

---
updated-dependencies:
- dependency-name: css_parser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 02:06:14 +01:00
dependabot[bot] 635cfdced7
Build(deps): Bump rails-html-sanitizer from 1.6.1 to 1.6.2 (#30250)
Bumps [rails-html-sanitizer](https://github.com/rails/rails-html-sanitizer) from 1.6.1 to 1.6.2.
- [Release notes](https://github.com/rails/rails-html-sanitizer/releases)
- [Changelog](https://github.com/rails/rails-html-sanitizer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rails/rails-html-sanitizer/compare/v1.6.1...v1.6.2)

---
updated-dependencies:
- dependency-name: rails-html-sanitizer
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 02:03:56 +01:00
dependabot[bot] d039ed4241
Build(deps-dev): Bump rubocop-rspec from 3.2.0 to 3.3.0 (#30252)
Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/rubocop/rubocop-rspec/releases)
- [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rspec/compare/v3.2.0...v3.3.0)

---
updated-dependencies:
- dependency-name: rubocop-rspec
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 02:03:28 +01:00
dependabot[bot] 2960b6938b
Build(deps-dev): Bump rubocop from 1.69.1 to 1.69.2 (#30249)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.69.1 to 1.69.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.69.1...v1.69.2)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 02:03:20 +01:00
dependabot[bot] 399d008936
Build(deps-dev): Bump lefthook from 1.9.0 to 1.9.2 (#30254)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 1.9.0 to 1.9.2.
- [Release notes](https://github.com/evilmartians/lefthook/releases)
- [Changelog](https://github.com/evilmartians/lefthook/blob/master/CHANGELOG.md)
- [Commits](https://github.com/evilmartians/lefthook/compare/v1.9.0...v1.9.2)

---
updated-dependencies:
- dependency-name: lefthook
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 02:02:34 +01:00
dependabot[bot] f11b56336e
Build(deps-dev): Bump puppeteer-core from 23.10.3 to 23.10.4 (#30253)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from 23.10.3 to 23.10.4.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
- [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json)
- [Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v23.10.3...puppeteer-core-v23.10.4)

---
updated-dependencies:
- dependency-name: puppeteer-core
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 02:02:04 +01:00
Amanda Alves Branquinho 462e613c08
FIX: pass correct arg to outlet (#30159)
* Fix:pass correct arg to outlet

* Update app/assets/javascripts/discourse/app/components/small-user-list.gjs

Co-authored-by: Jarek Radosz <jradosz@gmail.com>

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2024-12-12 21:49:22 -03:00
Sérgio Saquetim c9247cde29
DEV: Only print console message about the Glimmer post menu once (#30255) 2024-12-12 20:40:52 -03:00
Jan Cernik 96417592a3
FIX: Show validation error on confirmation user fields (#30232)
* FIX: Show validation error on confirmation user fields

* test
2024-12-12 18:45:28 -03:00
Sérgio Saquetim c3e7d97048
DEV: Switch the glimmer post menu to auto and unsilence deprecations (#30161)
This commit starts the rollout of the Glimmer post menu:

- default to `auto`: after the upgrade, it will be enabled on all discourse instances that do not have incompatible customizations

- unsilence the deprecation messages in the console

- removes the setting `glimmer_post_menu_groups` as it's no longer in the test phase
2024-12-12 18:27:02 -03:00
Sérgio Saquetim 6fa52a6499
DEV: Improve tests and fixes small issues in the Glimmer Post Menu (#30234)
This commit improves some tests to using both the glimmer post menu and the widget version.

It also addresses some small issues in the Glimmer Post Menu:

- Deprecated Font Awesome icon in the Edit button
- Set correctly `aria-pressed` in the Like Count when the list of people who liked is visible
- Display the user tip for the Show More button
2024-12-12 15:36:05 -03:00
Mark VanLandingham bbb31b05ca
DEV: add full_move to MovedPost record small_action modifier (#30236)
This commit adds a new column full_move to the moved_posts table. This is useful to look back at history and determine if a whole topic was moved or partial.

This commit also adds an apply_modifier to skip the creation of the moved posts small action.
2024-12-12 11:47:14 -06:00