Skip to content

feat(gui, config): support simple folder grouping (fixes #2070)#10563

Merged
calmh merged 9 commits intosyncthing:mainfrom
maen-bn:folder-grouping
Apr 7, 2026
Merged

feat(gui, config): support simple folder grouping (fixes #2070)#10563
calmh merged 9 commits intosyncthing:mainfrom
maen-bn:folder-grouping

Conversation

@maen-bn
Copy link
Copy Markdown
Contributor

@maen-bn maen-bn commented Feb 6, 2026

Purpose

Adds a very simple way to group up folders to help with organizing from the GUI. My intention is to not make this too complicated and just as a starter but potential follow on PRs to improve this but out of scope here are:

  • Sub group
  • Colour coding
  • Drag folders into groups on top of the putting them into groups via edit modal

Resolves #2070

Testing

  • Expand a folder and click Edit to bring up edit modal.
  • Enter a folder group name of your choice and save
  • Folder should be under Group heading
  • Edit a different folder to be part of the group you added the previous folder to (a count should appear near the Group heading)
  • Any non grouped folder should sit at the top

Screenshots

syncthing-folder-grouping

Documentation

I haven't done this yet as I want to wait for the feedback on the changes. I'm happy to do those doc changes too but the changes to the doc should be

  • Add "group" attribute to users/config.html#folder-element

Authorship

Ben Norcombe bennorcombe@pm.me

@github-actions github-actions bot added the enhancement New features or improvements of some kind, as opposed to a problem (bug) label Feb 6, 2026
@maen-bn maen-bn changed the title feat(gui,config,protocol): Support simple folder grouping feat(gui,config,protocol): support simple folder grouping Feb 6, 2026
@acolomb
Copy link
Copy Markdown
Member

acolomb commented Feb 6, 2026

Why should this affect the protocol? IMHO folder grouping is a local thing to organize the device's individual folder list. Groups may not mean the same to other users.

@AudriusButkevicius
Copy link
Copy Markdown
Member

AudriusButkevicius commented Feb 6, 2026

This can be even more simple, and can be fully a UI feature with no changes at all.
i.e., if the label has a slash, it ends up being interpreted as a group

g1/f1
g1/f2
g2/f1

ends up as:

g1
f1
f2

g2
f1

etc

@acolomb
Copy link
Copy Markdown
Member

acolomb commented Feb 7, 2026

That idea has been discussed before on the forum and in some issues, e.g. #2070. The major downside is that it fails for some common labels where a slash is used differently. For example: School term 2025 / 2026.

A separate config field for the grouping was the favored approach IIRC. Heuristics such as separation levels by a slash can be applied there. But mixing semantics with the label field will cause trouble for existing setups.

@maen-bn
Copy link
Copy Markdown
Contributor Author

maen-bn commented Feb 7, 2026

Why should this affect the protocol? IMHO folder grouping is a local thing to organize the device's individual folder list. Groups may not mean the same to other users.

No probs. I can drop that. I was just following something you said here about adjusting the protocol but I might have misinterpreted it #2070 (comment)

@bt90
Copy link
Copy Markdown
Contributor

bt90 commented Feb 7, 2026

That idea has been discussed before on the forum and in some issues, e.g. #2070. The major downside is that it fails for some common labels where a slash is used differently. For example: School term 2025 / 2026.

This can be fixed by allowing users to mask /

e.g School term 2025 // 2026

@maen-bn maen-bn changed the title feat(gui,config,protocol): support simple folder grouping feat(gui,config): support simple folder grouping Feb 7, 2026
@acolomb
Copy link
Copy Markdown
Member

acolomb commented Feb 7, 2026

This can be fixed by allowing users to mask /

Really? That still leaves users needing to bend over backwards to adjust their labels, when they simply do not need a grouping feature. Label is a label, completely free form, already used that way. Semantics can be attached to an additional field, with a special purpose.

No probs. I can drop that. I was just following something you said here about adjusting the protocol but I might have misinterpreted it

That was about protobuf, which we had used to define the configuration structure at the time. I believe we went back to simple go structs since.

@tomasz1986
Copy link
Copy Markdown
Member

tomasz1986 commented Feb 7, 2026

I would also like to suggest keeping labels their own thing. For example, all my labels are basically relative folder paths (separated with / forward slashes), so if the slash character suddenly got a special function, everything would likely become a large mess 😅.

@maen-bn Could you post a screenshot with more folders in each group than just one? I would also be curious how the UI looked if you dropped the group background colour (as I think the current version doesn't look the best, especially with the empty space below the last folder). Alternatively, maybe drop the background for ungrouped folders only? If possible, it would also be nice to see how everything looks in the light and black themes 🙂.

@maen-bn
Copy link
Copy Markdown
Contributor Author

maen-bn commented Feb 7, 2026

@acolomb Ah okay that makes sense, appreciate the context given I'm a newbie to contributing here.

@tomasz1986 there is a part in the gif where two folders are in the same group
Screenshot_2026-02-07-13-08-37-14_3aea4af51f236e4932235fdada7d1643

But I can get a screenshot where there's more than two as well if that helps. Yeah I can remove the background for them and show some screenshots for the light theme too

@maen-bn
Copy link
Copy Markdown
Contributor Author

maen-bn commented Feb 7, 2026

Here you go @tomasz1986, I've removed the background for the groups and examples of more folders grouped with all the themes available in the GUI

Light

Screenshot From 2026-02-07 18-11-41

Dark

Screenshot From 2026-02-07 18-12-03

Black

Screenshot From 2026-02-07 18-12-23

@tomasz1986
Copy link
Copy Markdown
Member

Thanks for the screenshots! Not sure what others think, but for me, the current iteration (without the background) looks better 🙂.

@tomasz1986 tomasz1986 changed the title feat(gui,config): support simple folder grouping feat(gui,config): support simple folder grouping (fixes #2070) Feb 7, 2026
@superboo07
Copy link
Copy Markdown

Loving the look of this

@calmh
Copy link
Copy Markdown
Member

calmh commented Apr 5, 2026

Looks reasonable to me, but the immediate followup question will be why this is not supported for devices. It seems reasonable to support the same mechanism for both at the same time, possibly?

@maen-bn
Copy link
Copy Markdown
Contributor Author

maen-bn commented Apr 5, 2026

Looks reasonable to me, but the immediate followup question will be why this is not supported for devices. It seems reasonable to support the same mechanism for both at the same time, possibly?

Yeah that's very reasonable. I'm happy to sort that out in separate PR if that's cool

@calmh
Copy link
Copy Markdown
Member

calmh commented Apr 5, 2026

I think it would be fine to have in the same, as a single grouping concept.

@tomasz1986
Copy link
Copy Markdown
Member

Please also push a relevant PR to the Docs, so that https://docs.syncthing.net/users/config#config-option-folder.group works (and the same for device groups, if implemented) 🙂.

maen-bn added a commit to maen-bn/syncthing-docs that referenced this pull request Apr 5, 2026
Document upcoming fuctionality addtion for grouping done in syncthing/syncthing#10563

Signed-off-by: Ben Norcombe <bennorcombe@pm.me>
@maen-bn
Copy link
Copy Markdown
Contributor Author

maen-bn commented Apr 5, 2026

Okay @calmh I've popped in some new changes to add grouping to devices too. Here some screenshots (redacted info as it was my own data) showing the new changes

Screenshot From 2026-04-05 16-04-44 Screenshot From 2026-04-05 16-05-03

Also (FYI @tomasz1986 ) I have stuck in changes on the docs repo to cover the changes here which can be found in the PR syncthing/docs#1001

Let me know if I need to adjust anything

Copy link
Copy Markdown
Member

@calmh calmh left a comment

Choose a reason for hiding this comment

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

Some nits to pick

Comment on lines +576 to +577
console.log("HELLO!!!");
console.log($scope.deviceGroups);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Debugging

<p translate ng-if="currentDevice.deviceID == myID" class="help-block">Shown instead of Device ID in the cluster status. Will be advertised to other devices as an optional default name.</p>
<p translate ng-if="currentDevice.deviceID != myID" class="help-block">Shown instead of Device ID in the cluster status. Will be updated to the name the device advertises if left empty.</p>
</div>
<div class="form-group" ng-class="{'has-error': deviceEditor.deviceGroup.$invalid && deviceEditor.folderGroup.$dirty && !editingDeviceDefaults()}">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

folderGroup should be deviceGroup

Path string `json:"path" xml:"path,attr"`
Type FolderType `json:"type" xml:"type,attr"`
Devices []FolderDeviceConfiguration `json:"devices" xml:"device"`
Group string `json:"group" xml:"group,attr"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Group string `json:"group" xml:"group,attr"`
Group string `json:"group" xml:"group,attr,omitempty"`

<span ng-if="folder.versioning.type == 'simple'" tooltip data-original-title="{{'Keep Versions' | translate}}">
&ensp;<span class="fa fa-file-archive-o"></span>&nbsp;{{folder.versioning.params.keep}}
<div ng-repeat="(folderGroupKey, folderGroup) in folderGroups">
<h4>{{ folderGroup }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might want to make the h4 conditional on the group name not being empty ""?

}
};

$scope.folderListByGroup = function (group) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These are called several times per frame, perhaps it would be worth it to cache them as a map/dictionary instead?

@maen-bn maen-bn force-pushed the folder-grouping branch 5 times, most recently from a7a1e11 to 855ca38 Compare April 6, 2026 12:03
maen-bn added 5 commits April 6, 2026 13:24
Signed-off-by: Ben Norcombe <bennorcombe@pm.me>
Signed-off-by: Ben Norcombe <bennorcombe@pm.me>
Signed-off-by: Ben Norcombe <bennorcombe@pm.me>
Signed-off-by: Ben Norcombe <bennorcombe@pm.me>
Signed-off-by: Ben Norcombe <bennorcombe@pm.me>
@maen-bn
Copy link
Copy Markdown
Contributor Author

maen-bn commented Apr 6, 2026

Some nits to pick

All sorted @calmh and changed up how the folder and device groups are constructed so rather than just a list of groups they're now a map with group as the key and their related devices/folders so no need for those filtered function that were being called over and over again.

maen-bn added a commit to maen-bn/syncthing-docs that referenced this pull request Apr 6, 2026
Document upcoming fuctionality addtion for grouping done in syncthing/syncthing#10563

Signed-off-by: Ben Norcombe <bennorcombe@pm.me>
maen-bn added 2 commits April 6, 2026 14:40
…solves syncthing#2070)

Rather than filtering a list of devices and folders by group name which
can be called multiple times per frame, the change here maps the devices
and folders into their groups only when the local config changes and
makes it easier to access just by keying into the map.

Signed-off-by: Ben Norcombe <bennorcombe@pm.me>
Signed-off-by: Ben Norcombe <bennorcombe@pm.me>
Copy link
Copy Markdown
Member

@calmh calmh left a comment

Choose a reason for hiding this comment

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

Further minor things

Path string `json:"path" xml:"path,attr"`
Type FolderType `json:"type" xml:"type,attr"`
Devices []FolderDeviceConfiguration `json:"devices" xml:"device"`
Group string `json:"group" xml:"group,attr,omitempty"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Group string `json:"group" xml:"group,attr,omitempty"`
Group string `json:"group" xml:"group,attr,omitempty" restart:"false"`

<span class="inline-icon">
<span ng-class="rdConnTypeIcon(rdConnType(deviceCfg.deviceID))" class="reception reception-theme"></span>
</span>
<div ng-repeat="(deviceGroupName, devices) in devicesGrouped">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This clobbers $scope.devices inside the loop, should probably use a more specific name... (Same for the folders I think)

&ensp;<span class="fa fa-file-archive-o"></span>&nbsp;{{folder.versioning.params.keep}}
<div ng-repeat="(folderGroupName, folders) in foldersGrouped">
<h4 ng-if="folderGroupName !== ''">{{ folderGroupName }}
<span ng-if="folders.length > 1 && folders.length > 0"> ({{folders.length}})</span>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

More than zero and more than one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry typo that's suppose to be checking how many folders there are and if the group has a name that isn't empty

maen-bn added 2 commits April 7, 2026 15:13
…esolves syncthing#2070)

Signed-off-by: Ben Norcombe <bennorcombe@pm.me>
@calmh calmh changed the title feat(gui,config): support simple folder grouping (fixes #2070) feat(gui, config): support simple folder grouping (fixes #2070) Apr 7, 2026
@calmh calmh merged commit 6a26d56 into syncthing:main Apr 7, 2026
4 checks passed
tomasz1986 pushed a commit to tomasz1986/syncthing that referenced this pull request Apr 7, 2026
…) (syncthing#10563)

Adds a very simple way to group up folders to help with organising from
the GUI.

Signed-off-by: Ben Norcombe <bennorcombe@pm.me>
Signed-off-by: Tomasz Wilczyński <twilczynski@naver.com>
@tomasz1986
Copy link
Copy Markdown
Member

I think something is broken regarding device grouping. For some reason, it shows the "self" device in the remote devices list.

As you can see below, "syncthing1" is the self device, which isn't supposed to be displayed in the list.

image

calmh added a commit to syncthing/docs that referenced this pull request Apr 7, 2026
Document upcoming fuctionality addtion for grouping done in
syncthing/syncthing#10563

---------

Signed-off-by: Ben Norcombe <bennorcombe@pm.me>
Signed-off-by: Jakob Borg <jakob@kastelo.net>
Co-authored-by: Jakob Borg <jakob@kastelo.net>
maen-bn added a commit to maen-bn/syncthing that referenced this pull request Apr 7, 2026
Regression was introduced in PR syncthing#10563 due to new devices grouping
feature not utlising the otherDevices utility function to ensure the
local device is not shown in the remote devices list

Signed-off-by: Ben Norcombe <bennorcombe@pm.me>
@maen-bn
Copy link
Copy Markdown
Contributor Author

maen-bn commented Apr 7, 2026

I think something is broken regarding device grouping. For some reason, it shows the "self" device in the remote devices list.

As you can see below, "syncthing1" is the self device, which isn't supposed to be displayed in the list.
image

Ah yeah apologies. The groupedDevices map didn't utilise the otherDevices utility function. I've created a PR to fix the regression #10631

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

Labels

enhancement New features or improvements of some kind, as opposed to a problem (bug)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Folder grouping proposal

7 participants