Show a dashed drop-area in empty kanban columns and the inbox
.kanban__cards:empty (shared by every status column and the sidebar's inbox list) gets a dashed border, transparent background, and a 'Drop cards here' hint, echoing the dashboard's 'Create a project' tile. Pure CSS: both draggables are already always-rendered even when empty, so an empty one is a genuinely childless element and :empty just tracks that -- it steps aside on its own once Sortable inserts a drag-over ghost, and needs no JS empty-state flag. Drops the sidebar's separate 'Nothing in the inbox.' message, now redundant with the box itself. Verified the container really is childless when empty via a DOM dump against a running instance (no screenshot). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -78,6 +78,14 @@ project view is currently mounted (`route.name === 'project'`), that project's
|
|||||||
cards too -- either side of a drag could have been the inbox. A small form
|
cards too -- either side of a drag could have been the inbox. A small form
|
||||||
under the list adds a card straight to the inbox.
|
under the list adds a card straight to the inbox.
|
||||||
|
|
||||||
|
Empty (no cards) is shown as a subtle dashed drop-area rather than blank
|
||||||
|
space -- `.kanban__cards:empty` in `style.css`, so it's pure CSS keyed off the
|
||||||
|
real DOM child count. Since a card's kanban column/inbox `<draggable>` is
|
||||||
|
always rendered even with nothing in it (see above), that container is
|
||||||
|
genuinely childless when empty, so the rule applies with no extra markup or
|
||||||
|
JS state; it steps aside automatically once Sortable inserts its drag-over
|
||||||
|
ghost. The same rule covers every kanban status column too (below).
|
||||||
|
|
||||||
## Project detail
|
## Project detail
|
||||||
|
|
||||||
`/projects/:id` shows one project. It renders on a **full-width** layout (the
|
`/projects/:id` shows one project. It renders on a **full-width** layout (the
|
||||||
|
|||||||
@@ -139,8 +139,9 @@ async function onInboxChange(change: ColumnChange) {
|
|||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<!-- Always rendered (even empty) so it stays a valid drop target for a
|
<!-- Always rendered (even empty) so it stays a valid drop target for a
|
||||||
card dragged out of a project's kanban board. -->
|
card dragged out of a project's kanban board -- empty shows a
|
||||||
<p v-if="inbox.cards.length === 0" class="sidebar__note muted">Nothing in the inbox.</p>
|
dashed drop-area box (.kanban__cards:empty in style.css) instead
|
||||||
|
of a separate message. -->
|
||||||
<draggable
|
<draggable
|
||||||
:list="inbox.cards"
|
:list="inbox.cards"
|
||||||
:group="{ name: 'kanban' }"
|
:group="{ name: 'kanban' }"
|
||||||
|
|||||||
@@ -757,6 +757,26 @@ h1 {
|
|||||||
min-height: 3rem;
|
min-height: 3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Empty column/inbox: a subtle drop target, styled like the dashboard's
|
||||||
|
"Create a project" tile (dashed border, transparent). :empty tracks the
|
||||||
|
real DOM child count, so this naturally steps aside for Sortable's own
|
||||||
|
ghost placeholder while something is dragged over it. */
|
||||||
|
.kanban__cards:empty {
|
||||||
|
border: 1px dashed var(--border);
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.kanban__cards:empty::before {
|
||||||
|
content: '⬇ Drop cards here';
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
text-align: center;
|
||||||
|
color: var(--muted);
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
.kanban-card {
|
.kanban-card {
|
||||||
background: var(--surface);
|
background: var(--surface);
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
|
|||||||
Reference in New Issue
Block a user