Skip to content

Conversation

@tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Dec 4, 2025

What is this pull request for?

Usually there has been an option to narrow down the file type of Attachments that can be assigned to
an ingredient File by setting only and or except setting on the ingredient.

- role: download
  type: File
  settings:
    only: [pdf]

But this seems to be broken. This PR re-enables this feature and makes it so much better by using the newly introduced resource filters.

With one allowed file type

CleanShot 2025-12-17 at 12 14 13@2x

With multiple allowed file types

CleanShot 2025-12-17 at 12 14 07@2x

With disallowed file type(s)

CleanShot 2025-12-17 at 12 13 50@2x

Here it shows the list of remaining file types of all file types except the ones disallowed to make it work with the multi select

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@tvdeyen tvdeyen added the backport-to-8.0-stable Needs to be backported to 8.0-stable label Dec 4, 2025
@tvdeyen tvdeyen self-assigned this Dec 4, 2025
@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.20%. Comparing base (3160be9) to head (7f71821).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3500   +/-   ##
=======================================
  Coverage   97.19%   97.20%           
=======================================
  Files         287      287           
  Lines        7559     7586   +27     
=======================================
+ Hits         7347     7374   +27     
  Misses        212      212           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tvdeyen tvdeyen force-pushed the fix-attachments-filter branch from 66936a2 to ca5cad4 Compare December 4, 2025 21:04
@tvdeyen tvdeyen marked this pull request as ready for review December 4, 2025 21:04
@tvdeyen tvdeyen requested a review from a team as a code owner December 4, 2025 21:04
@tvdeyen tvdeyen changed the title Fix attachments filter Fix filtering Attachments by only or except param Dec 4, 2025
@tvdeyen tvdeyen force-pushed the fix-attachments-filter branch 3 times, most recently from 2bbb034 to 8a35c23 Compare December 7, 2025 21:55
@tvdeyen tvdeyen marked this pull request as draft December 7, 2025 21:56
@tvdeyen tvdeyen added the bug label Dec 15, 2025
@tvdeyen tvdeyen force-pushed the fix-attachments-filter branch 2 times, most recently from 37d9827 to 9590b77 Compare December 15, 2025 21:04
@tvdeyen tvdeyen marked this pull request as ready for review December 15, 2025 21:20
@tvdeyen tvdeyen changed the title Fix filtering Attachments by only or except param Fix filtering Attachments by only or except setting Dec 15, 2025
@tvdeyen tvdeyen force-pushed the fix-attachments-filter branch from 9590b77 to a22ff5b Compare December 15, 2025 22:09
mamhoff
mamhoff previously approved these changes Dec 16, 2025
@tvdeyen tvdeyen marked this pull request as draft December 16, 2025 12:36
@tvdeyen tvdeyen dismissed mamhoff’s stale review December 16, 2025 12:37

need to rework it. there are still too may UX issues.

@tvdeyen tvdeyen force-pushed the fix-attachments-filter branch from 820582b to 20750e7 Compare December 17, 2025 11:12
@tvdeyen tvdeyen marked this pull request as ready for review December 17, 2025 11:13
@tvdeyen tvdeyen requested a review from mamhoff December 17, 2025 11:13
@tvdeyen tvdeyen assigned tvdeyen and unassigned tvdeyen Dec 17, 2025
@tvdeyen tvdeyen force-pushed the fix-attachments-filter branch from 20750e7 to 02dd52e Compare December 17, 2025 14:03
@tvdeyen tvdeyen removed their assignment Dec 17, 2025
This has been broken for a long time now.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
Otherwise it will first be full width and
wraps to a new line. Since seletc2 calculates
the width this makes sure the input stays
on the same line.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
Very useful to allow multiple values to be selected
for the same filter (ie. file types)

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
If we want to be able to remove an option
from the multiple select we need to allow
it to clear.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
We want to be able to load file types by extension
instead of the full mime type for the File ingredient
only and except feature.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
If allowed file extensions are set via the only param,
we restrict the available file types to select from
to that collection, making sure users cannot attach
other files than the allowed ones.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
Instead of just the tag list, we make the whole sidebar
scrollable, if it exceeds the vertical space left.

Makes it much better usable for varying filter counts
and heights.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
@tvdeyen tvdeyen force-pushed the fix-attachments-filter branch from 989b8c5 to 7f71821 Compare December 17, 2025 14:50
@mamhoff
Copy link
Contributor

mamhoff commented Dec 17, 2025

This looks and feels really good! One minor nit: The filters on the overlay accessed from elements look like they can be edited (the tags have x marks) - but clicking them does nothing (sensibly). Also, when you happen to try adding a video in an element, but have no video files, the filter select appears empty. Both of these are super minor, and I'm approving anyways.

@tvdeyen
Copy link
Member Author

tvdeyen commented Dec 18, 2025

This looks and feels really good! One minor nit: The filters on the overlay accessed from elements look like they can be edited (the tags have x marks) - but clicking them does nothing (sensibly).

Interest. Not happening to me. I am still able to remove and add types, as long as they are in the allowed types.

Also, when you happen to try adding a video in an element, but have no video files, the filter select appears empty. Both of these are super minor, and I'm approving anyways.

Hmm. Maybe related to your above issue. Not sure what to do about that. We do not want to maintain a list of all available mine types in the world, right?

Let's use this for now and fix if they are real world issues. Thanks for taking the time to review this locally.

@tvdeyen tvdeyen merged commit 50bba1c into main Dec 18, 2025
18 checks passed
@tvdeyen tvdeyen deleted the fix-attachments-filter branch December 18, 2025 06:28
@alchemycms-bot
Copy link

💔 All backports failed

Status Branch Result
8.0-stable Backport failed because of merge conflicts

You might need to backport the following PRs to 8.0-stable:
- Remove dialog sitemap css code
- Fix sitemap highlight color in dark mode
- Make create element dialog wider (#3445)
- Fix element icon hover for elements with warning (#3444)
- Fix select2 close icon visibility (#3443)

Manual backport

To create the backport manually run:

backport --pr 3500

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

@tvdeyen
Copy link
Member Author

tvdeyen commented Dec 18, 2025

💚 All backports created successfully

Status Branch Result
8.0-stable

Questions ?

Please refer to the Backport tool documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-8.0-stable Needs to be backported to 8.0-stable bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants