Support nested serverFolder paths with automatic creation - #2309
Merged
marcelklehr merged 4 commits intoJul 25, 2026
Conversation
Previously, only an exact top-level match for `serverFolder` was supported, falling back to creating a single root collection. Now, if no exact match is found, `serverFolder` is treated as a `/`-separated path. Each segment is resolved from root downwards, and any missing segments are created on the fly. This allows the root bookmark folder to live at an arbitrary depth in the collection hierarchy. The resolved (deepest) collection is passed to buildTree with isRoot = true.
Member
|
Awesome! Thanks for the contribution! |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Extends serverFolder resolution to support nested collection paths, creating missing Linkwarden collections on demand when building the bookmarks tree.
Changes:
- Keeps existing exact root-level name match for
serverFolder. - Falls back to resolving
/-delimited path segments from the root downward. - Auto-creates missing collections with correct
parentIdand updates the in-memorycollectionslist.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rfolder is empty or only contains slashes.
marcelklehr
approved these changes
Jul 25, 2026
Member
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends how the
serverFolderis resolved when building thebookmarks tree.
Until now, the code only looked for a single top-level collection whose
name exactly matched
serverFolder. If none was found, it created oneflat root collection. Nested folder paths were not supported.
Changes
serverFoldername against a root-level collection.serverFolderis split on
/and each segment is resolved sequentially from the rootdownwards. The parent of each segment must be the previously matched
collection.
exist is created via
POST /api/v1/collections(with the correctparentId) and added to the local collection list sobuildTreecanuse it.
buildTreewithisRoot = true.Behavior
a/bexists,cmissing)a,breused,ccreatedNotes
mismatches.