Add a timeline view to databases

Records are bars from the view's date property to an end date property
(chosen in the view's settings; without one a bar lasts a day), by
days, weeks or months. Dragging a bar moves both dates; its right edge
changes the end. Records without a start are listed below, like on the
calendar. Bars stop the browser's own drag of the surrounding block.

Also fixes the view settings panel: the properties list cleared the
whole panel when it drew, so a calendar never showed its date property.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tajniak81andClaude Opus 5.5 committed 2026-11-17 12:36:37 +01:00
1 parent ab73a7d0d7
commit ff75ecd04c
25 files changed
+1028 -116

No files matched your search

+193
View File
@@ -1902,6 +1902,199 @@
}
}
/* ---- Timeline view ---- */
.dw-db-tl {
padding-top: 8px;
}
.dw-db-tl__zoom {
display: inline-flex;
margin-left: 8px;
border: 1px solid var(--color-line);
border-radius: var(--radius-sm);
overflow: hidden;
}
.dw-db-tl__zoom .dw-db__btn {
border-radius: 0;
}
.dw-db-tl__zoom .dw-db__btn.is-on {
background: var(--color-accent-soft);
color: var(--color-ink);
}
.dw-db-tl__scroll {
overflow-x: auto;
border: 1px solid var(--color-line);
border-radius: var(--radius-md);
}
.dw-db-tl__grid {
--dw-tl-label: 180px;
width: calc(var(--dw-tl-label) + var(--dw-tl-width));
}
.dw-db-tl__row {
display: flex;
height: 34px;
border-bottom: 1px solid var(--color-line);
}
.dw-db-tl__row:last-child {
border-bottom: none;
}
.dw-db-tl__row--head {
height: 30px;
background: var(--color-surface-sunken);
}
.dw-db-tl__row--new {
height: auto;
}
.dw-db-tl__row--new .dw-db-t__new {
position: sticky;
left: 0;
width: var(--dw-tl-label);
}
.dw-db-tl__label {
position: sticky;
left: 0;
z-index: 2;
flex: 0 0 var(--dw-tl-label);
overflow: hidden;
padding: 0 10px;
border: none;
border-right: 1px solid var(--color-line);
background: var(--color-surface);
color: var(--color-ink);
font: inherit;
font-size: 13px;
line-height: 34px;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
}
.dw-db-tl__row--head .dw-db-tl__label {
background: var(--color-surface-sunken);
cursor: default;
}
.dw-db-tl__track {
position: relative;
flex: 0 0 var(--dw-tl-width);
/* A faint line between days at the larger scales. */
background-image: linear-gradient(to right, var(--color-line) 1px, transparent 1px);
background-size: calc(var(--dw-tl-day) * 7) 100%;
}
.dw-db-tl__ticks {
position: relative;
height: 100%;
}
.dw-db-tl__tick {
position: absolute;
top: 0;
bottom: 0;
overflow: visible;
padding: 0 4px;
color: var(--color-ink-muted);
font-size: 11px;
line-height: 30px;
white-space: nowrap;
text-transform: capitalize;
}
.dw-db-tl__tick.is-weekend {
background: rgb(0 0 0 / 0.04);
}
.dw-db-tl__today {
position: absolute;
top: 0;
bottom: 0;
width: 2px;
margin-left: -1px;
background: var(--color-accent);
opacity: 0.6;
pointer-events: none;
}
.dw-db-tl__bar {
position: absolute;
top: 6px;
height: 22px;
display: flex;
align-items: center;
overflow: hidden;
border-radius: var(--radius-sm);
background: var(--color-accent-soft);
box-shadow: inset 0 0 0 1px var(--color-accent);
color: var(--color-ink);
font-size: 12px;
cursor: pointer;
touch-action: pan-y;
user-select: none;
}
.dw-db-tl__bar.is-cut-start {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.dw-db-tl__bar.is-cut-end {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.dw-db-tl__bar.is-movable {
cursor: grab;
}
.dw-db-tl__bar.is-dragging {
z-index: 3;
cursor: grabbing;
box-shadow:
inset 0 0 0 2px var(--color-accent),
0 2px 6px rgb(0 0 0 / 0.15);
}
.dw-db-tl__bar:focus-visible {
outline: 2px solid var(--color-focus-ring);
outline-offset: 1px;
}
.dw-db-tl__bar-text {
overflow: hidden;
padding: 0 6px;
text-overflow: ellipsis;
white-space: nowrap;
}
.dw-db-tl__handle {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 8px;
cursor: ew-resize;
}
.dw-db-tl__handle::after {
content: "";
position: absolute;
top: 5px;
bottom: 5px;
right: 3px;
width: 2px;
border-radius: 1px;
background: var(--color-accent);
opacity: 0;
}
.dw-db-tl__bar:hover .dw-db-tl__handle::after {
opacity: 1;
}
@media (max-width: 640px) {
.dw-db-tl__grid {
--dw-tl-label: 110px;
}
.dw-db-tl__zoom {
margin-left: 0;
}
.dw-db-tl .dw-db-c__nav {
flex-wrap: wrap;
}
}
@media (hover: none) {
/* A wider grip for a finger, always visible. */
.dw-db-tl__handle {
width: 16px;
}
.dw-db-tl__handle::after {
opacity: 1;
}
}
/* ---- Kanban view ---- */
.dw-db-k {
display: flex;