feat: manual drag and drop ordering for board labels#8149
Open
Lightshadow02 wants to merge 5 commits into
Open
feat: manual drag and drop ordering for board labels#8149Lightshadow02 wants to merge 5 commits into
Lightshadow02 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>
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
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