Skip to content

feat: Add swimlane grouping by labels and assignees - #7875

Open
Pavlinchen wants to merge 2 commits into
nextcloud:mainfrom
Pavlinchen:swimlanes
Open

Pavlinchen wants to merge 2 commits into
nextcloud:mainfrom
Pavlinchen:swimlanes

Conversation

@Pavlinchen

@Pavlinchen Pavlinchen commented Apr 22, 2026 •

Copy link
Copy Markdown

Summary

Adds an optional horizontal swimlane grouping to the board view.

Users can now group cards by labels or assignees via the existing "View Modes" menu. Each group renders as a collapsible horizontal row with its own set of stacks, showing only the cards that belong to that group.

Key behaviors:

  • Cards with multiple labels (or multiple assignees) appear in all matching lanes - a subtle badge indicates the card is in multiple lanes
  • A "No label" / "Unassigned" catchall lane appears at the bottom for ungrouped cards
  • Empty lanes (labels/assignees with no cards) are automatically hidden
  • Lanes can be collapsed/expanded (persisted per-user in localStorage)
  • Lanes can be reordered via drag-and-drop (editors only, persisted via OCS config API as shared board setting)
  • Card drag-and-drop works within each lane across stacks, but cross-lane dragging is blocked (prevents accidental label/assignee changes)
  • Swimlane mode and lane order are shared board settings - all users see the same layout, only editors can change them (gated by PERMISSION_EDIT)

Example Screenshot

20-overview-menu

How it works

  1. Controls.vue adds "Group by" radio options to the View Modes menu
  2. When a mode is selected, it is stored via the OCS config API as a shared board setting and Board.vue re-renders from the board store
  3. Board.vue switches from the flat stack view to a vertical list of Swimlane components
  4. Each Swimlane renders a SwimlaneHeader (with label color/avatar, card count, collapse toggle) and the same horizontal stack layout
  5. Stack.vue accepts an optional lane prop - when present, it uses cardsByStackAndLaneMap to filter cards for that lane
  6. CardBadges.vue shows a duplicate badge when a card appears in 2+ lanes

Known gaps

  • Lanes cannot be reordered by keyboard.
  • Clone, import/export and user migration do not keep the grouping.
  • If two people reorder lanes at the same time, the last one wins.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Documentation (manuals or wiki) has been updated or is not required
  • Verify with NC dark mode / high-contrast themes
  • Test with right-to-left (RTL) languages

🤖 AI (if applicable)

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

@github-actions

github-actions Bot commented May 7, 2026

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.)

@Pavlinchen

Copy link
Copy Markdown
Author

Force pushed new (rebased) version to incorporate GanttView

@Pavlinchen

Copy link
Copy Markdown
Author

on it!

@grnd-alt grnd-alt left a comment

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.

Hey, thanks for your pr and the much appreciated work you did here.
Did not review the code fully but wanted to leave some comments from testing:

  1. there's a lot of layout shift when cards are moved between stacks as the column width changes.
  2. the order of lanes randomly changes when moving in columns in one lane
  3. the "order by" setting is persisted between site refreshes but the settings radio button's don't reflect it after refresh
  4. more of an opinion: I don't know if it's really necessary to have the column names listed for every lane, and them having different widths per lane seems counter-intuitive as well (but that's more of a design question idk what's better here)

Comment thread lib/Service/ConfigService.php Outdated
public function __construct(
private readonly IConfig $config,
private readonly IGroupManager $groupManager,
private readonly PermissionService $permissionService,

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.

that's a circular dependency and breaks the app

@Pavlinchen

Pavlinchen commented Jun 13, 2026 •

Copy link
Copy Markdown
Author

Hello again & thanks for the patience.
I realize this isn't a trivial commit, so the table below summarises what changed, how, and why.
If anything is needed, please let me know :)

Before Why changed After
PermissionService injected into ConfigService circular DI, broke the app EDIT check moved to ConfigController::setValue() per upstream #7990 pattern
Stack column widths shrank to card content when cards moved between stacks layout shift fixed flex basis on stack columns: flex: 0 1 $card-max-width; min-width: $card-min-width
Lane order changed randomly on every card move (unsorted card-derived iteration) random lane order computedLanes ends with deterministic .sort() - saved order first, ID fallback
NcActionRadio used deprecated :checked Boolean - didn't reflect persisted mode after reload radio state not persisting migrated to :model-value / @update:model-value, reads from board.settings.swimlaneMode
Column headers repeated per lane with mismatched widths removing unneccessary duplicates single sticky header row; lanes are bare card columns sharing one horizontal scroll context
board:<id>: with empty key/id silently accepted; arbitrary strings could land in shared app config self-review empty-key + non-numeric-id guards + JSON-array shape validation in ConfigService::validateSwimlaneValue
Cypress lane selector interpolated raw labels into a CSS selector self-review expectCardInLane() helper via cy.contains().parents('.swimlane')
setSwimlaneMode / setSwimlaneOrder committed locally before awaiting the server - UI stayed mutated on reject self-review snapshot previous value, revert on dispatch failure
user.participant.uid deref crashed the whole board view on deleted/federated accounts self-review ?.participant?.uid + skip falsy in computedLanes and cardsByStackAndLane

@Pavlinchen

Pavlinchen commented Sep 3, 2026 •

Copy link
Copy Markdown
Author

Hi @grnd-alt, following up here.

The June revision (20dbf48) covers the points from your May review.
Main has moved on quite a bit since then, so before I put another rebase together I would rather ask than guess.

Is this PR something this project wants?
A no is a perfectly fine answer and I would rather hear it than keep the PR alive.

If the answer is yes: which base should I target?
I can see you've started work on some of the same files in #8259.
The one difference compared to main is useSettingsStore().setConfig().

So I can rebase onto main as it stands and or stack on top of #8259 - lmk

Thanks in advance &
kind regards,
Paul

@grnd-alt

grnd-alt commented Sep 3, 2026

Copy link
Copy Markdown
Member

@Pavlinchen I must say, I personally do not see a need for swimlanes to be honest. But it seems to be somewhat wanted by the community as there's a 10year old issue with some likes about it. I am open to have it in, but I do see the risk of increased complexity and maintenance cost, especially since we have the gantt chart which is in a not so good state performance whise right now.

So if you are motivated to have it in and think you'll get it in a very good state that's easily maintainable, I would say go on!

In regards to the rebase, I am currently mainly working on a refactor to move to vue3: #8276

The pr you mentioned is incorporated into the vue3 rewrite I would advise you to wait until that is merged.

@Pavlinchen

Pavlinchen commented Sep 7, 2026 •

Copy link
Copy Markdown
Author

Hi @grnd-alt,
sounds fair enough - for now I will wait on the merge of #8276 as discussed :)

Thanks for the fast reply

@Pavlinchen

Copy link
Copy Markdown
Author

Will pick this back up in ~4 weeks

Groups cards into horizontal lanes by label or assignee, with a
"No label" / "Unassigned" catchall lane. A card with several labels
shows up in every matching lane and carries a badge. The flat board
stays the default.

Mode and lane order are shared board settings, stored as three columns
on deck_boards. ConfigController routes them to BoardService, which
validates them once the EDIT permission check has passed.

Closes nextcloud#32

Signed-off-by: Pavlinchen <69079839+Pavlinchen@users.noreply.github.com>
@Pavlinchen

Copy link
Copy Markdown
Author

Hi @grnd-alt, thanks for your patience.
The branch is rebased onto main and ready for another look.

There have been quite a few changes, so here is what changed and why.

Before After
PermissionService in ConfigService, circular DI EDIT check in ConfigController::setValue(), as in #7990
Stack columns shrank when cards moved fixed flex basis, same as the flat board
Lane order changed on every card move stable sort, saved order first, then id
Radio ignored the saved mode after reload NcActionRadio moved from :checked to :model-value
Column headers repeated per lane, uneven widths one sticky header row, lanes share its horizontal scroll
Any string could be stored validateSwimlaneValue() checks mode and order
Cypress put raw labels into a CSS selector expectCardInLane() uses cy.contains()
UI kept a value the server rejected rollback on failure, unless a newer write started meanwhile
A deleted assignee crashed the board view such assignees are skipped, their cards go to the catch-all lane

Mode and lane order also moved from app config entries to three deck_boards columns, so they go away with the board. Stale ids are harmless, because only existing lanes get sorted.

@Pavlinchen
Pavlinchen marked this pull request as ready for review November 21, 2026 09:58
- Lanes are as wide as their columns, so narrow windows no longer clip
  the last columns inside smooth-dnd's overflow: hidden wrapper.
- Header and lane columns ignore their content width, so a long card or
  stack title no longer shifts lane columns against the header row.
- Cloned card containers in the lane ghost no longer catch the drop
  point, so dragging a lane downwards finds its target again.
- Cypress covers all three cases.

Signed-off-by: Pavlinchen <69079839+Pavlinchen@users.noreply.github.com>

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Swimlanes support

2 participants