feat: manual drag and drop ordering for board labels#8149
feat: manual drag and drop ordering for board labels#8149Lightshadow02 wants to merge 5 commits into
Conversation
Signed-off-by: HUGO LOUREIRO <149155946+Lightshadow02@users.noreply.github.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: HUGO LOUREIRO <149155946+Lightshadow02@users.noreply.github.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The jest config referenced vue-jest which is not a dependency; the installed transformer is @vue/vue2-jest. Went unnoticed as the repo had no jest tests yet. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: HUGO LOUREIRO <149155946+Lightshadow02@users.noreply.github.com>
Signed-off-by: HUGO LOUREIRO <149155946+Lightshadow02@users.noreply.github.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- lib/Migration: restore blank line between declare(strict_types=1)
and the namespace declaration to match cs:check and the sibling
migration.
- LabelMapper::findAssignedLabelsForBoard now selects the label
order column (quoted via selectAlias since ORDER is reserved) so
the archived-cards view receives manual ordering like findAll().
Label::$order is already typed int via addType() and hydrates the
same way selectAlias('c.id', 'card_id') already does in this
method.
- store/main.js reorderLabelsOfCurrentBoard: capture the board id at
entry and guard every commit plus the loadStacks dispatch against
the current board having changed (or become null) during the
awaits, fixing a board-switch race that could apply another
board's label order or revert state for the wrong board.
- Apply the shared sortLabels() helper (instead of ad-hoc
alphabetical .sort()) to the remaining label render surfaces that
still ignored manual order: Controls.vue's "Filter by tag" list,
CardReferenceWidget.vue and CommentReferenceWidget.vue (the rich
object reference widgets embedded in comments/description). Also
removed CardSidebarTabDetails.vue's labelsSorted computed, which
was dead code no longer referenced by its template (TagSelector
sorts internally).
- TagsTabSidebar.vue: add non-drag-area-selector=".label-form" to
the labels Container, mirroring Stack.vue's non-drag-area-selector
pattern, so selecting text in the inline label edit form no longer
starts a drag.
- docs/API.md: document PUT /boards/{boardId}/labels/reorder and the
label object's new order field.
Signed-off-by: HUGO LOUREIRO <149155946+Lightshadow02@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Friendly ping — this one is still waiting for a first review whenever someone has time. Quick summary: board managers can drag labels into a manual order in the sidebar Tags tab, and that order is then used everywhere labels render (card badges, tag selector, filter, reference widgets). The |
|
Hello there, 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.) |
Summary
Labels currently render in creation order (or alphabetically depending on the surface), and board managers have no way to control which label appears first on card badges. This adds manual ordering:
ordercolumn ondeck_labels(migration) andorderfield on the label JSON objects (additive — clients that ignore it are unaffected)LabelService::reorder(boardId, labelIds)writes positions 0..n; requires board MANAGE permission; rejects incomplete/foreign/duplicate lists; new labels append at the end of an existing manual order; board clone preserves the orderPUT /boards/{boardId}/labels/reorderon the page routes and the/api/v1.xREST surface (registered before the{labelId}wildcard so the static segment is not shadowed). API addition, documented in docs/API.mdfindAssignedLabelsForBoardused by the archived-cards viewsortLabels()helper applied to every render surface (card badges, tag selector, filter, reference widgets)vue-jestpackage (installed transformer is@vue/vue2-jest), fixed in a separate commit (shared with fix: align attachment frontend requests with registered OCS routes #8148 — trivial to drop on whichever merges second)How to test
PUT /index.php/apps/deck/boards/{boardId}/labels/reorderwith{"labelIds":[...]}returns the labels in the new orderChecklist
🤖 Generated with Claude Code