Add new cards to top or bottom - #8181
Conversation
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
…but make it stick in visible area on overflow Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
…image` was cutting of dragged cards. Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
…or-bottom # Conflicts: # src/components/board/Stack.vue
…s set to 'add to bottom' Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
e5aa08a to
050a23d
Compare
f911c83 to
7d7651c
Compare
|
🐢 Performance warning. |
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
7d7651c to
bcaea9d
Compare
grnd-alt
left a comment
There was a problem hiding this comment.
Thanks for your contribution!
I like the idea in general but I think the implementation is way to complex. For a sticky element like that we shouldn't need that much js, I don't think we need a resizeObserver and bottomAddCardInline for example. For the handling with empty stacks, we could only use the isEmptyStack and remove isEmptyStackWithBottomAddCard, please also have a look at the other js parts of this pr to simplify it further.
some ui things I noticed:
- you can't really drag and drop to empty stacks as the dnd container shrinks
- when clicking "add card" the input gets bigger/wider which causes a sudden layout shift, would be nice to not have that
- subjective but I think having the "add card" with less opacity might look nicer to not draw away attention from the cards already there
|
Completely agreed, I'll work on that. Thanks for your review! :) |
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
…op mode Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
|
🐢 Performance warning. |
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
…for add-to-bottom lists Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
…or-bottom # Conflicts: # src/components/board/Stack.vue
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
|
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.) |
…or-bottom # Conflicts: # src/components/board/Stack.vue
|
🐢 Performance warning. |
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
e212f79 to
7e606fa
Compare
|
🐢 Performance warning. |
|
🐢 Performance warning. |
…d form after creation - Let CardService::create() decide when to reorder based on the requested order, so all card creation endpoints behave consistently. - Close the inline add-card form after a card is successfully created to prevent it from covering the new card and fix flaky Cypress tests. Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Inferring the reorder-on-insert behavior from `$order !== 999` broke cloneCard() and DefaultBoardService, which call create() with real, already-correct order values (e.g. 0) that must not trigger a shift of other cards in the stack. Restore the explicit $insertAtPosition flag, opted into only by the OCS controller used by the new add-card UI. Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
|
🐢 Performance warning. |
|
🐢 Performance warning. |
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
|
🐢 Performance warning. |
- Name the sentinel order in CardOcsController instead of a magic 999 - Drop unreachable stackAddCardAtTop case from ConfigService::get() - Restore the stronger visibility assertion in the label e2e test Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
theoholl
left a comment
There was a problem hiding this comment.
A few implementation notes for reviewers.
| $card = $this->cardMapper->insert($card); | ||
| } else { | ||
| // Insert at the requested position and shift the surrounding cards | ||
| $this->connection->beginTransaction(); |
There was a problem hiding this comment.
Insertion and order normalization are one transaction, so a failed reorder cannot leave the new card stored with conflicting positions.
| stackId: this.stack.id, | ||
| boardId: this.stack.boardId, | ||
| // Without an order the API appends the card to the end of the stack | ||
| ...(this.addAtTop ? { order: 0 } : {}), |
There was a problem hiding this comment.
Bottom insertion deliberately omits order to preserve the existing append behavior. Top insertion sends order: 0; the server shifts the existing cards.
| if (card.order !== undefined) { | ||
| for (const existingCard of this.cards) { | ||
| if (existingCard.stackId === createdCard.stackId && existingCard.order >= card.order) { | ||
| Vue.set(existingCard, 'order', existingCard.order + 1) |
There was a problem hiding this comment.
Mirror the server-side shift locally so the new top card renders in the correct position immediately after creation.
|
🐢 Performance warning. |
Place the bottom add-card control outside the scrollable list without overlap-specific spacing or drag handling. Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>
Signed-off-by: Theo <36564257+theoholl@users.noreply.github.com>


Summary
Users can now choose whether new cards are added to the top or the bottom of a list. A new setting in the Deck settings toggles the behavior; the 'Add card' button sits on the side of the list where the card will be inserted. The default behavior is unchanged (add to bottom).
Settings toggle for changing between adding cards to the top or the bottom of the stack:
Adding cards to the top of the stack:
Adding cards to the bottom of the stack:
Implementation notes
stackAddCardAtTop(ConfigService), exposed to the client via the initial state and toggled in the Deck settings.Stack.vueinto a newStackCardAdd.vuecomponent and rendered above or below the card list depending on the setting.CardService::create()gained aninsertAtPositionflag: the card is inserted and the surrounding cards are shifted in a single DB transaction, so no follow-up reorder request is needed.orderto the OCS card create endpoint now inserts the card at that position and shifts the surrounding cards, instead of only storing the raw order value. Omittingorderkeeps the previous append-to-bottom behavior.Checklist