Add list and gallery views to databases
List shows one line per record with its visible properties; gallery shows cards in a grid, covered with the first image of an attachment property chosen in the view's settings. Both filter, sort and group like tables, and a click opens the record. Older clients show the new layouts as tables (normalize already falls back for unknown types). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
29465e4617
commit
ab73a7d0d7
13 files changed
+601
-64
No files matched your search
@@ -1777,6 +1777,131 @@
|
||||
border-bottom-color: transparent;
|
||||
}
|
||||
|
||||
/* ---- List and gallery views ---- */
|
||||
.dw-db-i {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 8px 0 4px;
|
||||
}
|
||||
.dw-db-i__group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
.dw-db-i__item {
|
||||
cursor: pointer;
|
||||
min-width: 0;
|
||||
}
|
||||
.dw-db-i__item:focus-visible {
|
||||
outline: 2px solid var(--color-accent);
|
||||
outline-offset: 1px;
|
||||
}
|
||||
.dw-db-i__title {
|
||||
font-weight: 600;
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.dw-db-i__props {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 4px 10px;
|
||||
min-width: 0;
|
||||
font-size: 13px;
|
||||
color: var(--color-ink-muted);
|
||||
}
|
||||
.dw-db-i__prop {
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
.dw-db-i__new {
|
||||
justify-self: start;
|
||||
}
|
||||
|
||||
/* List: one line per record, its properties on the right. */
|
||||
.dw-db-i--list .dw-db-i__items {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.dw-db-i--list .dw-db-i__item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 6px 8px;
|
||||
border-bottom: 1px solid var(--color-line);
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
.dw-db-i--list .dw-db-i__item:hover {
|
||||
background: var(--color-surface-sunken);
|
||||
}
|
||||
.dw-db-i--list .dw-db-i__title {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.dw-db-i--list .dw-db-i__props {
|
||||
flex: 0 1 auto;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
/* Gallery: cards in a grid, with a cover image when the view has one. */
|
||||
.dw-db-i--gallery .dw-db-i__items {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
.dw-db-i--gallery .dw-db-i__item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
overflow: hidden;
|
||||
padding-bottom: 10px;
|
||||
border: 1px solid var(--color-line);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--color-surface-raised);
|
||||
box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
|
||||
}
|
||||
.dw-db-i--gallery .dw-db-i__item:hover {
|
||||
border-color: var(--color-line-strong);
|
||||
}
|
||||
.dw-db-i--gallery .dw-db-i__title,
|
||||
.dw-db-i--gallery .dw-db-i__props {
|
||||
padding: 0 10px;
|
||||
}
|
||||
.dw-db-i__cover {
|
||||
aspect-ratio: 16 / 9;
|
||||
margin-bottom: 6px;
|
||||
background: var(--color-surface-sunken);
|
||||
}
|
||||
.dw-db-i__cover.is-empty {
|
||||
aspect-ratio: auto;
|
||||
height: 6px;
|
||||
}
|
||||
.dw-db-i__cover img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
border-radius: 0;
|
||||
}
|
||||
.dw-db-i--gallery .dw-db-i__new {
|
||||
min-height: 80px;
|
||||
justify-content: center;
|
||||
border: 1px dashed var(--color-line);
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
.dw-db-i--gallery .dw-db-i__items {
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
}
|
||||
.dw-db-i--list .dw-db-i__item {
|
||||
flex-wrap: wrap;
|
||||
gap: 4px 12px;
|
||||
}
|
||||
.dw-db-i--list .dw-db-i__props {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---- Kanban view ---- */
|
||||
.dw-db-k {
|
||||
display: flex;
|
||||
|
||||
Reference in new issue
Block a user