Skip to content

fix(Files): remove stale addStyle icons call from TemplateLoader#7641

Merged
vitormattos merged 1 commit intomainfrom
fix/7632-remove-stale-icons-addstyle
May 6, 2026
Merged

fix(Files): remove stale addStyle icons call from TemplateLoader#7641
vitormattos merged 1 commit intomainfrom
fix/7632-remove-stale-icons-addstyle

Conversation

@vitormattos
Copy link
Copy Markdown
Member

@vitormattos vitormattos commented May 6, 2026

Summary

Removes the dead Util::addStyle(Application::APP_ID, 'icons') call from TemplateLoader::handle().

Root cause

The css/icons.css file does not exist in the Vite build output. Its content (.icon-libresign { background-image: ... }) is already bundled inside libresign-tab.css because tab.ts imports ./style/icons.scss.

Having this stale addStyle call means:

  1. Every time the Files sidebar is opened, Nextcloud queues a request for a non-existent CSS file → 404 on every page load.
  2. If that file existed (or ever existed in a cache), any unscoped rule inside it would bleed globally into other Nextcloud apps — exactly the list-style: none regression reported in libresign css affect list-style all over nextcloud #7632.

Changes

  • lib/Files/TemplateLoader.php: Remove the stale Util::addStyle(Application::APP_ID, 'icons') line.
  • tests/php/Unit/Files/TemplateLoaderTest.php: Add regression test testHandleDoesNotRegisterIconsStyleSeparately() that asserts libresign/css/icons is never registered as a standalone stylesheet after handle() is called.

Ref #7632

The `Util::addStyle(Application::APP_ID, 'icons')` call was dead code:
- The file `css/icons.css` does not exist in the Vite build output.
- Its content (.icon-libresign) is already bundled inside `libresign-tab` via
  the `tab.ts` entry point importing `./style/icons.scss`.

Loading a non-existent CSS file caused a 404 on every Files page with the
sidebar open, and any unscoped rule in that file would bleed globally into
other Nextcloud apps.

Closes #7632

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap May 6, 2026
@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable33

@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable32

@vitormattos vitormattos merged commit 9ffbc3b into main May 6, 2026
77 checks passed
@vitormattos vitormattos deleted the fix/7632-remove-stale-icons-addstyle branch May 6, 2026 03:19
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap May 6, 2026
@backportbot-libresign
Copy link
Copy Markdown

The backport to stable32 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable32
git pull origin stable32

# Create the new backport branch
git checkout -b backport/7641/stable32

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 3c7a8087

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/7641/stable32

Error: Failed to push branch backport/7641/stable32: remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/LibreSign/libresign.git/'


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable32

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

Labels

None yet

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

1 participant