Skip to content

feat(contexts): nest application menu items one level deep - #3088

Closed
remko48 wants to merge 4 commits into
feat/noid/menu-savingfrom
feat/noid/menu-nesting
Closed

remko48 wants to merge 4 commits into
feat/noid/menu-savingfrom
feat/noid/menu-nesting

Conversation

@remko48

@remko48 remko48 commented Oct 13, 2026

Copy link
Copy Markdown

A menu item can now sit under another item, so an application's menu can group its pages. Only one level deep: a parent cannot itself have a parent.

What changes

  • Migration: tables_contexts_menu_item gets a nullable parent_id.
  • Input: an item names its parent with parentIndex, the position of the parent in the same payload (a non-negative whole number). Positions are used instead of ids because the whole menu is replaced on save, and new items don't have an id yet.
  • Validation (400): the parent must exist in the same menu, cannot be the item itself, and must be a top-level item.
  • Saving: top-level items are stored first so their new ids are known; then the children are stored with their parent_id. A parent may therefore come after its child in the payload. order keeps the sequence of the whole payload.
  • API: parentId is added to each menu item in the response (OpenAPI and TS types regenerated).

🖼️ Screenshots

Backend only, no UI changes.

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stableX.X
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

remko48 and others added 3 commits October 12, 2026 13:35
A menu item can sit under a top-level item of the same menu. The parent is
given as its position in the submitted menu, so a new menu can be saved in
one request; parents are stored first so a child can point at its parent's
id, while the order keeps the menu's sequence.

- an item cannot sit under itself, under a child or under a position the
  menu does not have; the service keeps its own check for items built
  without the input validation
- menu items expose their parentId in the API

Co-authored-by: Ruben van der Linde <[email protected]>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Remko <[email protected]>
…t in the output

- an item placed under itself is already refused because its parent then has a
  parent too, so comparing the parent's position with its own adds nothing
- the serialization test now sets a parent and checks that it is returned

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Remko <[email protected]>
@remko48
remko48 requested review from blizzz and enjeck as code owners October 13, 2026 14:38
@remko48
remko48 added this pull request to stack #3090 October 13, 2026 14:39
@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@rubenvdlinde

Copy link
Copy Markdown

Closing this in favour of the new stack that starts at #3131. After the review on #3075, @enjeck's design in #3099 and #3100 replaced the model these PRs were built on, so they can't be updated in place.

The backend of grid pages and application menus is now in #3131 to #3138. The frontend follows in separate PRs. @remko48 is co-author on the menu commits there. Thanks to everyone who reviewed these.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants