Skip to content

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

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

Pavlinchen wants to merge 16 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); not on archived boards
  • User lane order stores type:id, so a user and a group with the same id get separate lanes
  • Deleted users/groups/teams are removed from all lane orders (ParticipantCleanupListener)

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

  • The migration adds three columns to deck_boards, but appinfo/info.xml is unchanged by me, as I didn't want to "overrule" anything in the entire repo. Instances already on that version need a version bump before they run it, otherwise the board list fails.
  • 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.
  • federated boards show the grouping and lane order set on the owner's instance. Changing them from another ("receiving") instance is not saved and is gone after a reload. (Board title and color behave the same way afaict)

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 requested a review from grnd-alt June 14, 2026 09:47
@Pavlinchen
Pavlinchen marked this pull request as draft September 3, 2026 15:08
@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

Pavlinchen commented Nov 21, 2026 •

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's a quick overview

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>
setSwimlaneSetting moved the board ETag but fired no BoardUpdatedEvent,
so the live update listener sent no update to other open tabs. They only
saw the change after a reload and could overwrite it. It now dispatches
BoardUpdatedEvent, like other board updates.

Signed-off-by: Pavlinchen <69079839+Pavlinchen@users.noreply.github.com>
Everything else on an archived board is read-only, but the grouping
switches and lane drag still wrote to the board. setSwimlaneSetting now
throws the same StatusException as StackService and LabelService. The
view menu disables the switches, and the lane drag handle is hidden.
Collapsing a lane stays possible, it is stored per user in the browser.

Signed-off-by: Pavlinchen <69079839+Pavlinchen@users.noreply.github.com>
Every Stack instance added a window mousemove listener when it mounted.
In the swimlane view there is one instance per lane and list, so a large
board kept hundreds of listeners that did nothing unless their own list
was the drag source. The listener is now added on dragStart and removed
on dragEnd or unmount, so an idle board has none.

Signed-off-by: Pavlinchen <69079839+Pavlinchen@users.noreply.github.com>
smooth-dnd sends dragStart and dragEnd to every container, not only to
the source, so the listener exists while any drag runs on the board. The
test now fails if a mounted hook brings back the permanent listener.

Signed-off-by: Pavlinchen <69079839+Pavlinchen@users.noreply.github.com>
Entries in swimlaneUserOrder were bare uids, so a user and a group with
the same id shared one lane. They are now "<type>:<participant>" strings
and labels are stored as ints. The server rejects entries without a valid
type, duplicates, nested arrays and entries over 255 bytes. A failed
reorder now shows an error.

Signed-off-by: Pavlinchen <69079839+Pavlinchen@users.noreply.github.com>
…s, return the stored value

The server encodes label and user orders itself and returns the stored
string. Label ids that are not on the board and entries in the format of
earlier builds are dropped instead of rejected, so a deleted label or a
bare user id no longer blocks saving. The client takes the stored order
into the store unless a newer write started.

Signed-off-by: Pavlinchen <69079839+Pavlinchen@users.noreply.github.com>
The stored order may now hold 32768 bytes. A participant id is checked
with the same rule as when a board is shared, so it has at most 64
characters, and the separate 255-byte limit per entry is gone. When an
order passes 80 percent of the byte or entry limit, the server logs one
warning with the board id and the sizes, never an entry.

Signed-off-by: Pavlinchen <69079839+Pavlinchen@users.noreply.github.com>
When a user, group or team is deleted, drop its lane from the user order
of every board, archived and deleted boards included. The search matches
the stored JSON text with an escaped LIKE and the service then compares
the decoded entries exactly, so similar ids such as Ann, a_n% or a group
id containing the user entry stay untouched. A board that fails to
update is logged and skipped so the deletion goes on.

The order helpers now return lists and writeSwimlaneSetting is the only
place that encodes the order and checks the stored size.

Signed-off-by: Pavlinchen <69079839+Pavlinchen@users.noreply.github.com>
A user order may now arrive with up to twice the byte and entry limit.
If the stored encoding is over the limit, the server drops every entry
of a participant who is not assigned to a card of the board, not shared
with the board and not its owner. Assignments on archived and deleted
cards count. The lane for unassigned cards stays, and the remaining
entries keep their order. If the order is still too large, the request
gets a 400. A cut down order is logged on info, an order that stays too
large on warning, with the board id and sizes only.

The label order keeps its single limit, unknown labels are already
dropped exactly. The removal of deleted participants goes through the
same write and so gets the same check.

Signed-off-by: Pavlinchen <69079839+Pavlinchen@users.noreply.github.com>
A refresh that started before a swimlane write finished could bring
back the old order or mode and overwrite the optimistic value. Track
started and open writes per config key, take a snapshot before the
refresh loads, and skip every setting whose write was open at the
snapshot or started since. readSwimlaneOrder becomes
readSwimlaneSettings and also guards the mode. A plain board load
takes no snapshot and skips nothing.

Tests cover both orders of write and load, a mode write that finishes
before or after the load, and a failed mode write after a refresh.
The write rolls back, and the next refresh is not skipped.

Signed-off-by: Pavlinchen <69079839+Pavlinchen@users.noreply.github.com>
An order saved through the API before duplicates were refused can hold
the same id twice. mergeVisibleOrder carried both entries along, so the
server answered every reorder with 400. It now keeps the first entry
only.

readSwimlaneSettings parsed any valid JSON, so a stored object or number
reached order.indexOf in computedLanes and threw while rendering. It
now takes the parsed value only if it is an array and keeps the order
it had before otherwise.

Signed-off-by: Pavlinchen <69079839+Pavlinchen@users.noreply.github.com>
The three swimlane settings in docs/API.md now say that archived boards
refuse the write with a 500, the same status StackService and
LabelService give. The note on the stored answer also names whitespace
as a reason it can differ from the request.

The docblock of writeSwimlaneSetting claimed it was the only place that
checks the size limit. normalizeSwimlaneValue checks the raw size too,
so the docblock now speaks of the stored size.

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

Pavlinchen commented Nov 24, 2026 •

Copy link
Copy Markdown
Author

Adressed all findings from own testing and LLM review

All three stacks were created with order 0. Postgres returns rows with
equal sort keys in no fixed order, so Todo could end up in the third
column and the card move test failed before the drag.

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

The stack with the unbreakable title shared order 0 with Todo. The
comment claimed the card move test runs last, but Mocha runs the nested
suite after it.

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