Skip to content

fix(files): Collectives banner activation for matching folder paths - #2679

Merged
mejo- merged 1 commit into
mainfrom
jtr/fix-FlieListInfo-detection
Nov 17, 2026
Merged

mejo- merged 1 commit into
mainfrom
jtr/fix-FlieListInfo-detection

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

📝 Summary

  • Resolves: #

Fixes a potential issue where the Collectives Files banner could be activated for paths that only partially matched the configured Collectives folder.

The previous startsWith() check could treat a folder such as /Collectives-old as being inside /Collectives.

🖼️ Screenshots

🏚️ Before 🏡 After
B A

🚧 TODO

  • ...

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

Comment thread src/views/FileListInfo.vue Outdated
const folder = collectivesFolder?.replace(/\/$/, '')
this.active = Boolean(
folder
&& folder !== '/'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my understanding this now no longer can match, as the replace above would change / to an empty string, no?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The replace should just safely remove any trailing slash right away; creating a predictable baseline string.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, and i think it makes sense. My point was that folder !== '/' will now always be true, as folder will never again be / given that the trailing slash is removed beforehands.

@mejo-
mejo- force-pushed the jtr/fix-FlieListInfo-detection branch from 92ac82b to 80d0743 Compare November 17, 2026 16:30
@mejo-

mejo- commented Nov 17, 2026

Copy link
Copy Markdown
Member

@joshtrichards I took the liberty to amend your commit and address the comment I had.

Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Jonas <jonas@freesources.org>
@mejo-
mejo- force-pushed the jtr/fix-FlieListInfo-detection branch from 80d0743 to 063c0aa Compare November 17, 2026 16:32
@mejo-
mejo- enabled auto-merge (rebase) November 17, 2026 16:33
@mejo-
mejo- merged commit 286a60e into main Nov 17, 2026
62 checks passed
@mejo-
mejo- deleted the jtr/fix-FlieListInfo-detection branch November 17, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants