Skip to content

Commit 88e827d

Browse files
committed
docs(skill/objectstack-ui): document gantt timeSegments (排班分段) capability
Add a 'Configuring Gantt Views' section covering the core gantt config plus the ObjectUI-only timeSegments extension: dayStart + bands (白班/夜班), day-scale-only, two-tier 排班日 header, start-based attribution, 12h drag-snap, calendar-midnight dashed cue, and default-off zero-regression with optional per-band color tint.
1 parent d616e1d commit 88e827d

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

skills/objectstack-ui/SKILL.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,74 @@ sort: [
316316
317317
---
318318

319+
## Configuring Gantt Views
320+
321+
```typescript
322+
{
323+
type: 'gantt',
324+
data: { provider: 'object', object: 'project_task' },
325+
columns: ['name', 'assigned_to', 'status'], // left-pane tree columns
326+
startField: 'start_date', // task bar start
327+
endField: 'end_date', // task bar end
328+
progressField: 'progress', // 0–100 fill
329+
dependencyField: 'depends_on', // FS dependency arrows
330+
parentField: 'parent', // builds the summary-bar tree
331+
}
332+
```
333+
334+
Rows with children (or `type: 'summary'`) render as **summary bars** — they
335+
move the whole group on drag and have **no resize handles**. Leaf tasks resize
336+
freely unless `locked: true`.
337+
338+
### Shift segmentation — `timeSegments` (排班分段, ObjectUI extension)
339+
340+
`timeSegments` splits each day column into ordered **bands** (e.g. 白班 / 夜班)
341+
for shift-based scheduling. It is an **ObjectUI display extension**, *not* part
342+
of the upstream `GanttConfigSchema` in `@objectstack/spec` — it lives only in
343+
the gantt view config and is read by the ObjectUI gantt runtime.
344+
345+
```typescript
346+
{
347+
type: 'gantt',
348+
data: { provider: 'object', object: 'work_order' },
349+
startField: 'start', endField: 'end',
350+
timeSegments: {
351+
dayStart: '08:00', // clock time the 排班日 begins (default '00:00')
352+
bands: [
353+
{ key: 'day', label: '白班', start: '08:00', end: '20:00' },
354+
{ key: 'night', label: '夜班', start: '20:00', end: '08:00', color: '#6366f1' },
355+
],
356+
},
357+
}
358+
```
359+
360+
Field shapes:
361+
362+
| Field | Required | Notes |
363+
| --- | --- | --- |
364+
| `dayStart` | no | `'HH:mm'` (24h). The "day" column starts here and runs a full 24h, so a cross-midnight band sits wholly inside one column. Default `'00:00'`. |
365+
| `bands[].key` | no | Stable id (`'day'`/`'night'`); defaults to `band{index}`. |
366+
| `bands[].label` | yes | Header text for the band (白班 / 夜班). |
367+
| `bands[].start` / `bands[].end` | yes | `'HH:mm'`. When `end <= start` the band crosses midnight. Bands must tile the 24h day from `dayStart`. |
368+
| `bands[].color` | no | Any CSS color. Tints that band's column; **omit for no tint**. |
369+
370+
Behavior:
371+
372+
- **Day scale only.** `timeSegments` applies when the gantt is in `day` mode; in
373+
week/month/quarter scales it is ignored (no-op).
374+
- **Two-tier header.** Top tier = the 排班日 date (starting at `dayStart`),
375+
bottom tier = one cell per band (each half-width for two equal bands).
376+
- **Attribution by `start`.** A task is placed in the 排班日 its `start` falls
377+
in, so a 夜班 spanning 20:00→次日08:00 stays in a single column.
378+
- **Drag-snaps to band boundaries** (the band duration, e.g. 12h) instead of
379+
whole days.
380+
- **Calendar-midnight cue.** A subtle dashed vertical line marks local 0:00
381+
*inside* a cross-midnight band — the 排班日 cell itself stays unbroken.
382+
- **Default off = zero regression.** Omit `timeSegments` and the gantt behaves
383+
exactly as before. Tints render only for bands that declare `color`.
384+
385+
---
386+
319387
## App Navigation
320388

321389
An **App** groups objects, dashboards, reports, and custom pages into a

0 commit comments

Comments
 (0)