Skip to content

fix(NcAppSidebar): let the toggle button be rendered outside NcContent - #9269

Open
jospoortvliet wants to merge 1 commit into
nextcloud-libraries:mainfrom
jospoortvliet:fix/noid/sidebar-toggle-container
Open

jospoortvliet wants to merge 1 commit into
nextcloud-libraries:mainfrom
jospoortvliet:fix/noid/sidebar-toggle-container

Conversation

@jospoortvliet

@jospoortvliet jospoortvliet commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

β˜‘οΈ Resolves

  • Fix #…

NcAppSidebar teleports its built-in toggle button into the content element that NcContent provides, because the button cannot live inside the sidebar it reopens. Used anywhere else β€” an embedded reference widget, a dialog, a standalone app β€” there is no such element, the button is silently dropped, and a sidebar closed with the open prop can never be reopened.

The injection key is not exported either, so today the only way for an embedder to supply a target is provide(Symbol.for('NcContent:selector'), el), reaching into the global symbol registry for a private key.

The new toggle-container prop names the element (or selector) to render the toggle into, and takes precedence over the injected content selector. Without the prop nothing changes.

<NcAppSidebar :toggle-container="hostElement" name="…" :open="open" />

πŸ–ΌοΈ Screenshots

🏚️ Before 🏑 After 🏑 After 2
shell-no-toggle-before shell-toggle-after sidebar-open-after
no way to reopen the sidebar outside NcContent the toggle where the embedder puts it sidebar open

🚧 Tasks

  • toggle-container prop, taking precedence over the injected content selector
  • Reword the warning to name the prop
  • Unit tests

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • πŸ“˜ Component documentation has been extended, updated or is not applicable
  • 2️⃣ Backport to stable8 for maintained Vue 2 version or not applicable

AI (if applicable)

  • The content of this PR was partly or fully generated using AI
    each commit containing AI-assisted content must include a git trailer: Assisted-by: AGENT_NAME:MODEL_VERSION

πŸ€– Generated with Claude Code

The built-in toggle button is teleported into the content element that
NcContent provides, so a sidebar used anywhere else - an embedded
reference widget, a dialog, a standalone app - is left without the only
control that can reopen it. The new toggle-container prop names the
element to render it into.

Assisted-by: ClaudeCode:claude-opus-5
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Jos Poortvliet <551757+jospoortvliet@users.noreply.github.com>
@codecov

codecov Bot commented Dec 1, 2026

Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 61.76%. Comparing base (a1ea4d7) to head (30aad55).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9269      +/-   ##
==========================================
- Coverage   62.61%   61.76%   -0.86%     
==========================================
  Files         131      135       +4     
  Lines        4791     4935     +144     
  Branches     1452     1489      +37     
==========================================
+ Hits         3000     3048      +48     
- Misses       1528     1610      +82     
- Partials      263      277      +14     

β˜” View full report in Codecov by Harness.
πŸ“’ 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.

@jospoortvliet
jospoortvliet marked this pull request as ready for review December 1, 2026 15:36
@jospoortvliet
jospoortvliet requested a review from a team as a code owner December 1, 2026 15:36

This branch has not been deployed

No deployments
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.

1 participant