Skip to content

Conversation

@janbaum
Copy link
Contributor

@janbaum janbaum commented Oct 15, 2025

📝 Summary

With this PR, the option 'Add folder description' is not more visible, if 'Show folder description' is turned off.
The user has to reload the page though, since the function, that checks the state of this setting, is somehow only called when the site gets reloaded.

🚧 TODO

  • check value of "files-setting-richworkspace" (FilesSettings.vue) when '+New' menu is opened ?

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits

Signed-off-by: janbaum <jan.baumgarten@tutanota.com>
@codecov
Copy link

codecov bot commented Oct 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.19%. Comparing base (490ddb6) to head (5a01334).
⚠️ Report is 29 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7788   +/-   ##
=======================================
  Coverage   60.19%   60.19%           
=======================================
  Files         502      502           
  Lines       38561    38562    +1     
  Branches     1135     1135           
=======================================
+ Hits        23210    23211    +1     
  Misses      15245    15245           
  Partials      106      106           

☔ 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.

@janbaum
Copy link
Contributor Author

janbaum commented Oct 15, 2025

The user has to reload the page though, since the function, that checks the state of this setting, is somehow only called when the site gets reloaded.

I dont fully understand why, this is just an observation...

This also results in some weired behaviour of some edge cases, e.g:

  1. setting is enabled
  2. disable seeting and close settings with upper-right X
  3. open +New and click 'Add folder description' -> this will create a Readme.md
  4. repeat step 3
  5. observe, that option 'Add folder description' is still available, but when you click, it fails, because the file already exists

So it should actually also be prevented, that the option shows off, when a Readme.md already exists, right?

This also works the other way around, because I am pretty convinced that the problem is in the inital state, that is not updated, other than from reloading

Copy link
Member

@mejo- mejo- left a comment

Choose a reason for hiding this comment

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

Thanks a lot for tackling this. Tested and works well.

The user has to reload the page though, since the function, that checks the state of this setting, is somehow only called when the site gets reloaded.

Yeah, that's because the whole "new file" menu is created when the page is loaded. As you can see in the source file where you made the changes, addNewFileMenuEntry() is called inside addMenuRichWorkspace() which in turn is called in src/init.js. To my knowledge there's no way at the moment to remove menu entries from the files app "new file" menu dynamically. So the fix certainly is good enough for now. (Un)selecting "Show folder description" as well required a reload to become active.

@mejo- mejo- merged commit 729d29c into nextcloud:main Oct 20, 2025
62 of 64 checks passed
@mejo-
Copy link
Member

mejo- commented Oct 20, 2025

/backport to stable32

@mejo-
Copy link
Member

mejo- commented Oct 20, 2025

/backport to stable31

@mejo-
Copy link
Member

mejo- commented Oct 20, 2025

@janbaum if you're motivated, you could look into #7314 as well, which is much related to this issue.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

‘Add folder description’ should not appear if ‘Show folder description’ is unchecked in the Files settings.

2 participants