Commit Graph

21949 Commits

Author SHA1 Message Date
David Battersby
a7fe2e1a48
FIX: pass args in chat header logo plugin outlet (#25050)
This change passes down all params to the home logo widget (rather than explicitly setting minimized). This will allow for flexible logo sizing in the Discourse full width theme component.
2023-12-27 19:43:20 +08:00
dependabot[bot]
689fa512b6
Build(deps): Bump ember-auto-import from 2.7.1 to 2.7.2 in /app/assets/javascripts (#25025)
* Build(deps): Bump ember-auto-import in /app/assets/javascripts

Bumps [ember-auto-import](https://github.com/ef4/ember-auto-import/tree/HEAD/packages/ember-auto-import) from 2.7.1 to 2.7.2.
- [Release notes](https://github.com/ef4/ember-auto-import/releases)
- [Changelog](https://github.com/embroider-build/ember-auto-import/blob/main/packages/ember-auto-import/CHANGELOG.md)
- [Commits](https://github.com/ef4/ember-auto-import/commits/HEAD/packages/ember-auto-import)

---
updated-dependencies:
- dependency-name: ember-auto-import
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update lockfiles for ember version flag

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: discoursebuild <build@discourse.org>
2023-12-27 08:25:43 +08:00
chapoi
32c438387b
UX: make sidebar title static (#25040)
* UX: make sidebar title static

* tests
2023-12-26 13:37:32 +01:00
chapoi
3a20718526
UX: header avatar > change to aria-label (#25038) 2023-12-26 12:18:12 +01:00
David Battersby
67d736a045
FEATURE: chat header redesign on mobile (#24938)
This change simplifies the layout of our header when chat is open on mobile. The search icon and hamburger menu icons are also hidden and the Discourse logo is replaced by a ← Forum link to make it easier to continue where you left off within the forum (prior to this update the user could only go back to the forum index page).
2023-12-26 17:36:26 +08:00
Natalie Tay
12131c8e21
FIX: CLS jumpiness in post-stream when ?page=N (#25034)
With certain conditions, this issue does not show up. The easiest way to reproduce this is probably to do either of this

- Use a 3G slow connection or;
- Add a breakpoint to scrolling-post-stream.topRefresh (anon)
- (and optionally lock-on.lock)

This issue is happening because there are multiple areas that set scroll location in the post stream when loading a topic. In our case, sometimes lock-on is triggering and scrolling to post_1, before ?page=2's post_21 is being scrolled to, due to posts above post_21 can finishing loading at different times. This causes some calculations to not add up, as being in the middle of a post stream has different calculations than being at the top of the post stream.
2023-12-26 14:31:49 +08:00
Kris
c4f940aa31
UX: resize pm composer inputs for narrow screens (#25019) 2023-12-22 15:17:26 -05:00
Kris
02b117a852
FIX: scope PM background color to PMs (#25020) 2023-12-22 15:16:59 -05:00
Kris
096e26d972
UX: adjust pm styles to enbubble controls (#24996) 2023-12-22 14:28:02 -05:00
Mark VanLandingham
64438fff25
FIX: Bind events properly in search-menu.js & fix focus issue (#25006)
The problem:
Removing the options to addEventListener results in events that are properly cleaned up when the search menu is removed. Previously every time you opened the search menu, the listeners would be attached again, and clicking outside even after it was closed would fire the function again and again (N times as you opened the search menu!)

This was made far far worse in this commit c91d053, where I called close() to remove focus from the search input in the event that the search menu is rendered outside the header.

The problem with this was 2-fold. The close function tried to focus the search header button in core here. When the events aren't cleanup up and that happens... you can't do anything in the app.

The solution:
We don't need the event listeners to close the search menu when it's rendered from the header. The widget header handles clicks outside of the header. Sooo

1. Only register them for standalone search menus
2. Remove the passive options to the listeners so that they are properly removed on close
3. Call close() to unfocus input rather than just closing panel
4. Rename passed in are closeSearchMenu -> onClose because it's more accurate. It's really a callback.
2023-12-22 09:48:00 -06:00
Alan Guo Xiang Tan
5668866031
UX: Disable dropdown when filtering in edit nav menu tags modal (#25010)
Why this change?

The `Editing sidebar tags navigation allows a user to filter the tag in the modal by selection` system test was flaky
when we were doing `modal.filter("").filter_by_unselected`. The
hypothesis here is that the filtering is debounced before issue a
request to load the new tags and the dropdown is only disabled in the
debounced function. Thereforethere is a chance that when
`modal.filter_by_unselected` runs, it is selecting a row against a
disabled dropdown which results in a noop.

What does this change do?

When filtering using the input in the modal, we will now disabled the
dropdown until the filtering completes which will then re-enable the
dropdown.
2023-12-22 16:26:44 +08:00
Krzysztof Kotlarek
7cad69e6ef
UX: File types site setting (#24976)
New file types site setting with buttons allowing to easily add image/video/audio/document extensions to the list.
2023-12-22 11:23:42 +11:00
Mark VanLandingham
fe8b1a1074
REVERT: "FIX: Properly close search menu on click/touch outside (#25000)" (#25005)
This reverts commit c91d053dec.
2023-12-21 15:54:17 -06:00
Mark VanLandingham
7c7e2aeff8
DEV: Move menu-item-end PluginOutlet outside <a> tag (#25001) 2023-12-21 12:39:17 -06:00
Kris
2887e2c055
UX: adjust bootstrap mode tooltip color (#25002) 2023-12-21 13:22:28 -05:00
Mark VanLandingham
c91d053dec
FIX: Properly close search menu on click/touch outside (#25000) 2023-12-21 11:05:36 -06:00
Bianca Nenciu
a3bd86f85c
DEV: Clean up category-link (#24988)
The `style` variable is always set because every category has a color
defined, so the surrounding if statement is unnecessary.

"+ X categories" option has also been removed in the past and the code
related to it is now dead code.
2023-12-21 11:54:47 +02:00
Martin Brennan
7fcef5f2f9
FIX: Show admin plugin route sub-links in sidebar (#24982)
This changes the Plugins link in the admin sidebar to
be a section instead, which then shows all enabled plugin
admin routes (which are custom routes some plugins e.g.
chat define).

This is done via adding some special preloaded data for
all controllers based on AdminController, and also specifically
on Admin::PluginsController, to have the routes loaded without
additional requests on page load.

We just use a cog for all the route icons for now...we don't
have anything better.
2023-12-21 11:37:20 +10:00
Ted Johansson
8fce890ead
FEATURE: Use native number fields for integer inputs (#24984)
We had our own implementation of number fields in Ember, extended from text fields. Number inputs are now widely supported in browsers, and we can fall back on the native implementation which will be a better experience in almost all cases.

One thing traded off here is number fields can't have a placeholder, but that is intentional. We aren't using that ability anywhere, and we probably only kept it because we're extending text fields.

With this change we can get rid of the entire .js file, since there's no custom behaviour, and just make NumberField a template.
2023-12-21 08:45:40 +08:00
Mark VanLandingham
3c6362bb26
DEV: PluginApi function to customize search menu assistant item behavior (#24992) 2023-12-20 15:25:45 -06:00
Jordan Vidrine
547aafba4f
UX: Add class to text select menu when fast-editing (#24991) 2023-12-20 13:54:59 -06:00
Jarek Radosz
e18bb6e9fb
DEV: Bump the content-tag patch (#24990) 2023-12-20 18:59:33 +01:00
David Taylor
cbc28e8e33
Enable Embroider/Webpack code spliting for Wizard (#24919)
(extracted from #23678)

* Move Wizard back into main app, remove Wizard addon
* Remove Wizard-related resolver or build hacks
* Install and enable `@embroider/router`
* Add "wizard" to `splitAtRoutes`

In a fully optimized Embroider app, route-based code splitting more
or less Just Work™ – install `@embroider/router`, subclass from it,
configure which routes you want to split and that's about it.

However, our app is not "fully optimized", by which I mean we are
not able to turn on all the `static*` flags.

In Embroider, "static" means "statically analyzable". Specifically
it means that all inter-dependencies between modules (files) are
explicitly expressed as `import`s, as opposed to `{{i18n ...}}`
magically means "look for the default export in app/helpers/i18n.js"
or something even more dynamic with the resolver.

Without turning on those flags, Embroider behaves conservatively,
slurps up all `app` files eagerly into the primary bundle/chunks.
So, while you _could_ turn on route-based code splitting, there
won't be much to split.

The commits leading up to this involves a bunch of refactors and
cleanups that 1) works perfectly fine in the classic build, 2) are
good and useful in their own right, but also 3) re-arranged things
such that most dependencies are now explicit.

With those in place, I was able to move all the wizard code into
the "app/static" folder. Embroider does not eagerly pull things from
this folder into any bundle, unless something explicitly "asks" for
them via `imports`. Conversely, things from this folder are not
registered with the resolver and are not added to the `loader.js`
registry.

In conjunction with route-based code splitting, we now have the
ability to split out islands of on-demand functionalities from the
main app bundle.

When you split a route in Embroider, it automatically creates a
bundle/entrypoint with the relevant routes/templates/controllers
matching that route prefix. Anything they import will be added to
the bundle as well, assuming they are not already in the main app
bundle, which is where the "app/static" folder comes into play.

The "app/static" folder name is not special. It is configured in
ember-cli-build.js. Alternatively, we could have left everything
in their normal locations, and add more fine-grained paths to the
`staticAppPaths` array. I just thought it would be easy to manage
and scale, and less error-prone to do it this way.

Note that putting things in `app/static` does not guarantee that
it would not be part of the main app bundle. For example, if we
were to add an `import ... from "app/static/wizard/...";` in a
main bundle file (say, `app.js`), then that chunk of the module
graph would be pulled in. (Consider using `await import(...)`?)

Overtime, we can build better tooling (e.g. lint rules and babel
macros to make things less repetitive) as we expand the use of
this pattern, but this is a start.

Co-authored-by: Godfrey Chan <godfreykfc@gmail.com>
2023-12-20 13:15:06 +00:00
David Taylor
2f40d9b07b
DEV: Correct ember-5 lockfile generation (#24983)
The regen_ember_5_lockfile script was actually just duplicating the ember3 lockfile without changes 🤦‍♂️. This commit fixes that, and updates the ember-version-enforcement workflow to detect lockfile issues in future.
2023-12-20 11:45:01 +00:00
Isaac Janzen
043fa28fab
FIX: Add missing user search result name and styling (#24974)
Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
2023-12-19 23:14:00 -06:00
Mark VanLandingham
6d5dd92ea1
DEV: Half-revert search-menu flicker fix (#24975) 2023-12-19 16:22:30 -06:00
David Taylor
29107b3429
DEV: Stop exporting internal routeAction function (#24946)
Consumers should use the default export. This function doesn't work directly (unless you manually construct its arguments) - the default export helper handles all that automatically.
2023-12-19 12:47:22 +00:00
David Taylor
6e259a5f25
DEV: Allow 'emails disabled' notices to be temporarily dismissed (#24952)
This makes it much easier to see what a production site will look like before launch. The notices return on the next pageload, so there is minimal risk of this affecting visibility of an email configuration problem.
2023-12-19 12:06:17 +00:00
Martin Brennan
b83d4953da
FIX: Admin problem notification minor issues (#24963)
* Icon was a gift and not exclamation-triangle...these admin problems
  are not usually a gift :P
* Added missing title translation
2023-12-19 18:37:31 +10:00
dependabot[bot]
4dceac8bda
Build(deps): Bump content-tag from 1.2.1 to 1.2.2 in /app/assets/javascripts (#24955)
* Build(deps): Bump content-tag in /app/assets/javascripts

Bumps [content-tag](https://github.com/embroider-build/content-tag) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/embroider-build/content-tag/releases)
- [Changelog](https://github.com/embroider-build/content-tag/blob/main/CHANGELOG.md)
- [Commits](https://github.com/embroider-build/content-tag/commits)

---
updated-dependencies:
- dependency-name: content-tag
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update lockfiles for ember version flag

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: discoursebuild <build@discourse.org>
2023-12-19 08:58:23 +01:00
Joffrey JAFFEUX
53b96638c5
DEV: implements <Chat::Navbar /> (#24917)
This new navbar component is used for every navbar in chat, full page or drawer, and any screen.

This commit also uses this opportunity to correctly decouple drawer-routes from full page routes. This will avoid having this kind of properties in components: `@includeHeader={{false}}`. The header is now defined in the parent template using a navbar. Each route has now its own template wrapped in a div of the name of the route, eg: `<div class="c-routes-threads">..</div>`.

The navbar API:

```gjs
<Navbar as |navbar|>
 <navbar.BackButton />
 <navbar.Title @title="Foo" />
 <navbar.ChannelTitle @channel={{@channel}} />
 <navbar.Actions as |action|>
   <action.CloseThreadButton />
 </navbar.Actions>
</navbar>
```

The full list of components is listed in `plugins/chat/assets/javascripts/discourse/components/navbar/index.gjs` and `plugins/chat/assets/javascripts/discourse/components/navbar/actions.gjs`.

Visually the header is not changing much, only in drawer mode the background has been removed.

This commit also introduces a `<List />` component to facilitate rendering lists in chat plugin.
2023-12-18 17:49:58 +01:00
chapoi
1f9e6425c6
UX: align topic notification button + text vertically (#24948) 2023-12-18 16:59:03 +01:00
Bianca Nenciu
680cf443f4
FIX: Better infinite scrolling on categories page (#24831)
This commit refactor CategoryList to remove usage of EmberObject,
hopefully make the code more readable and fixes various edge cases with
lazy loaded categories (third level subcategories not being visible,
subcategories not being visible on category page, requesting for more
pages even if the last one did not return any results, etc).

The problems have always been here, but were not visible because a lot
of the processing was handled by the server and then the result was
serialized. With more of these being moved to the client side for the
lazy category loading, the problems became more obvious.
2023-12-18 16:46:09 +02:00
Penar Musaraj
092633c14f
FIX: Modal flash tracking (#24923)
Super minor, without tracking, these error messages weren't being shown.
2023-12-18 09:34:19 -05:00
Jarek Radosz
8207e59c00
DEV: Remove unused code (#24915)
`input:focus + label.alt-placeholder` css is used for styling active input's label
2023-12-18 11:26:38 +01:00
chapoi
7fe5a6986b
UX: fullscreen modal > add missing modifier + sticky header (#24920)
* UX: table builder add missing modal modifier

* UX: fullscreen-table sticky header fix

* UX: fullscreen table > autosize width
2023-12-18 11:18:54 +01:00
David Taylor
31c2a4717b
DEV: Allow plugins/themes to add global notices at any time (#24922)
Previously, `addGlobalNotice` would have to be called before the GlobalNotice component was rendered. By using a TrackedArray, we can improve that so that plugins can call the function at any time and the notice will be rendered immediately
2023-12-18 09:56:23 +00:00
Natalie Tay
e24c015b9c
FIX: Correct urls to account for subfolder setup (#24941) 2023-12-18 16:49:06 +08:00
Ted Johansson
0edf39409c
DEV: Convert min_trust_level_to_allow_ignore to groups (#24894)
We're changing the implementation of trust levels to use groups. Part of this is to have site settings that reference trust levels use groups instead. It converts the min_trust_level_to_allow_ignore  site setting to ignore_allowed_groups.

This PR maintains backwards compatibility until we can update plugins and themes using this.
2023-12-18 13:04:37 +08:00
Kelv
1f6d778561
DEV: enable grant badge utils test and force boolean type return value for isBadgeGrantable (#24928) 2023-12-18 10:47:13 +08:00
Martin Brennan
6de00f89c2
FEATURE: Initial admin sidebar navigation (#24789)
This is v0 of admin sidebar navigation, which moves
all of the top-level admin nav from the top of the page
into a sidebar. This is hidden behind a enable_admin_sidebar_navigation
site setting, and is opt-in for now.

This sidebar is dynamically shown whenever the user enters an
admin route in the UI, and is hidden and replaced with either
the:

* Main forum sidebar
* Chat sidebar

Depending on where they navigate to. For now, custom sections
are not supported in the admin sidebar.

This commit removes the experimental admin sidebar generation rake
task but keeps the experimental sidebar UI for now for further
testing; it just uses the real nav as the default now.
2023-12-18 11:48:25 +10:00
marstall
6f3c498b83
FIX: when showing edit invite form, display saved invite data in fields (#24907)
https://meta.discourse.org/t/lets-talk-suggestion-for-improvement-invite-feature/284655/11?u=yigit
2023-12-16 09:49:21 -05:00
Ty Correll
e30da10486
UX: fix overlap obstructed anon topic reply (#24927) 2023-12-15 17:15:38 -05:00
Mark VanLandingham
fe06a76cab
REVERT: "UX: fix overlap obstructed anon topic reply (#24921)" (#24925)
This reverts commit 368f4ef24d.
2023-12-15 15:08:34 -06:00
Blake Erickson
7a7c53894d
FIX: Excessive video data downloading from service worker (#24924)
This bug appears to only be on Chrome due to the service worker fetching
the video content on page load instead of on play. For some reason
though the service worker would fetch around 4x more than the size of
the video resulting in excessive data being downloaded especially for
larger videos.

meta https://meta.discourse.org/t/287817
internal /t/111387/52
2023-12-15 13:29:50 -07:00
Ty Correll
368f4ef24d
UX: fix overlap obstructed anon topic reply (#24921)
This commit addresses the overlap between the anonymous reply button in a topic and the related or new and unread topics component.
2023-12-15 13:24:33 -06:00
Keegan George
388a2c5274
DEV: Add outlets and actions to move topic modal (#24913) 2023-12-15 08:50:29 -08:00
Penar Musaraj
8a4ab79be2
DEV: Improve header offset calculation (#24910) 2023-12-15 15:29:17 +01:00
chapoi
ed4840200b
UX: revert icon colour change in alerts (#24916) 2023-12-15 13:32:35 +01:00
Osama Sayegh
eff6e4b405
FIX: Position Float Kit elements correctly in RTL mode (#24908)
Float-kit elements (menus/tooltips) are positioned where they should be by setting an inline `left` property in JavaScript when they're rendered. For some reasons, we also set `left: 0` on float-kit elements here:

25d9927785/app/assets/stylesheets/common/float-kit/d-menu.scss (L11-L15)

This property is overridden by the inline property that the library sets in JavaScript. However, in RTL mode, all of our scss files are flipped where everything left becomes right and vice versa. In this case, the `left: 0` property in the scss file above becomes `right: 0`.

This results in a conflict specific to RTL mode where both the `left` and `right` properties are defined on the same absolute-positioned element; the `right` property will always be set to 0 because it comes from the (flipped) scss file above, and the inline `left` property will be set to some px amount determined in JavaScript.

The `right` property will take precedence over the inline `left` property due to the page being right-to-left (source: https://developer.mozilla.org/en-US/docs/Web/CSS/right#description) and this causes float-kit elements to incorrectly always stick to the right.

This commit removes the `left: 0` property altogether for float-kit elements from our scss files. It's not clear from git history why the property was added, and removing it doesn't seem to cause any issues.

Meta topic: https://meta.discourse.org/t/positioning-issues-with-rtl-locales-after-recent-updates/280220?u=osama
2023-12-15 13:16:31 +03:00