@design.estate/dees-catalog 22.2.0 → 22.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist_bundle/bundle.js +325 -30
  2. package/dist_bundle/bundle.js.map +1 -1
  3. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-IASP6M5U.js → chunk-IGD4DLG4.js} +3 -3
  4. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-ZPJBKBPH.js → chunk-MK42UYWT.js} +4 -2
  5. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-ZPJBKBPH.js.map → chunk-MK42UYWT.js.map} +1 -1
  6. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-B6IKM3SA.js → chunk-RITCTBBY.js} +2 -2
  7. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{de-3ZAD2XFI.js → de-TN6FRTSU.js} +4 -2
  8. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-TN6FRTSU.js.map +1 -0
  9. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-CPEH77LV.js → dees-modal-PLLCPO5V.js} +3 -3
  10. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-65M4HBRK.js → dees-workspace-terminal-7N6EXGH6.js} +4 -4
  11. package/dist_ts_web/00_commitinfo_data.js +1 -1
  12. package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.d.ts +12 -0
  13. package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.js +24 -2
  14. package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.js +54 -7
  15. package/dist_ts_web/elements/00group-kanban/dees-kanban-activity/dees-kanban-activity.d.ts +13 -1
  16. package/dist_ts_web/elements/00group-kanban/dees-kanban-activity/dees-kanban-activity.js +80 -12
  17. package/dist_ts_web/elements/00group-kanban/dees-kanban-card/dees-kanban-card.d.ts +10 -0
  18. package/dist_ts_web/elements/00group-kanban/dees-kanban-card/dees-kanban-card.js +72 -4
  19. package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.d.ts +12 -0
  20. package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.js +73 -3
  21. package/dist_ts_web/elements/00group-kanban/kanban.firstload.d.ts +23 -0
  22. package/dist_ts_web/elements/00group-kanban/kanban.firstload.js +51 -0
  23. package/dist_ts_web/elements/00group-kanban/kanban.styles.d.ts +8 -0
  24. package/dist_ts_web/elements/00group-kanban/kanban.styles.js +47 -1
  25. package/dist_ts_web/i18n/de.d.ts +8 -0
  26. package/dist_ts_web/i18n/de.js +3 -1
  27. package/dist_ts_web/i18n/messages.d.ts +8 -0
  28. package/dist_ts_web/i18n/messages.js +3 -1
  29. package/package.json +1 -1
  30. package/readme.md +34 -3
  31. package/ts_web/00_commitinfo_data.ts +1 -1
  32. package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.ts +23 -1
  33. package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.ts +60 -6
  34. package/ts_web/elements/00group-kanban/dees-kanban-activity/dees-kanban-activity.ts +88 -11
  35. package/ts_web/elements/00group-kanban/dees-kanban-card/dees-kanban-card.ts +60 -2
  36. package/ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.ts +61 -1
  37. package/ts_web/elements/00group-kanban/kanban.firstload.ts +54 -0
  38. package/ts_web/elements/00group-kanban/kanban.styles.ts +47 -0
  39. package/ts_web/i18n/de.ts +2 -0
  40. package/ts_web/i18n/messages.ts +2 -0
  41. package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-3ZAD2XFI.js.map +0 -1
  42. /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-IASP6M5U.js.map → chunk-IGD4DLG4.js.map} +0 -0
  43. /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-B6IKM3SA.js.map → chunk-RITCTBBY.js.map} +0 -0
  44. /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-CPEH77LV.js.map → dees-modal-PLLCPO5V.js.map} +0 -0
  45. /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-65M4HBRK.js.map → dees-workspace-terminal-7N6EXGH6.js.map} +0 -0
package/readme.md CHANGED
@@ -5652,6 +5652,32 @@ lands at its end. Supply `.people` for the assignee picker, `.loading` for loadi
5652
5652
  and `.error` for a host-side board loading failure. Supply new `.tickets` arrays
5653
5653
  for external updates.
5654
5654
 
5655
+ The host owns `loading`. Its first load, `loading` while `.tickets` is empty and
5656
+ no `.error` is set, draws placeholder cards in the board's own columns, card
5657
+ shape and gaps, so the board that replaces them does not move: in the columns
5658
+ already set, under their names, else in four placeholder columns. The
5659
+ placeholders appear only after 200 ms of loading, so a quick load never flashes
5660
+ them, and pulse with the theme's `--dees-loading-pulse-*` tokens, still under
5661
+ reduced motion. After `DeesKanban.stillLoadingAfter` (10 s) the board says
5662
+ "Still loading board…" beside its heading, where the totals come, and the
5663
+ placeholders hold still. The columns are `aria-busy` while loading; a visually
5664
+ hidden status announces the load and the placeholders are hidden from assistive
5665
+ technology. With tickets on show, a refresh keeps them and shows the "Loading
5666
+ board…" line.
5667
+
5668
+ ```typescript
5669
+ board.loading = true; // tickets still empty: the first load
5670
+ try {
5671
+ const snapshot = await api.loadBoard();
5672
+ board.columns = snapshot.columns;
5673
+ board.tickets = snapshot.tickets;
5674
+ } catch (error) {
5675
+ board.error = String(error);
5676
+ } finally {
5677
+ board.loading = false;
5678
+ }
5679
+ ```
5680
+
5655
5681
  The board takes the height its host gives it: the remaining space of a flex
5656
5682
  column, or a box of definite height. Each column's cards scroll below its header
5657
5683
  while the page stays put, and an edge past which cards lie casts a
@@ -5689,7 +5715,8 @@ Public methods and events:
5689
5715
 
5690
5716
  `dees-kanban-column` accepts `.column`, `.tickets`, `.allTickets`, `.columns`,
5691
5717
  `.movable`, `.canCreate`, `.pendingTicketId`, `.draggingTicketId`, `.projects`,
5692
- `.showProjects` and `.collapsed`. It composes
5718
+ `.showProjects` and `.collapsed`; the board sets `.placeholderCards` and
5719
+ `.placeholderStalled` on its first load. It composes
5693
5720
  cards and forwards their open, create and Move menu requests, and a collapsible
5694
5721
  column's toggle as `kanban-column-toggle`. Its cards scroll below its header in
5695
5722
  `cardScroller` once the column's height runs out; a drag that scrolls them from a
@@ -5700,7 +5727,8 @@ Use it through `dees-kanban` for provider handling and board-local drag ownershi
5700
5727
  #### DeesKanbanCard
5701
5728
 
5702
5729
  `dees-kanban-card` accepts `.ticket`, `.epic`, `.subtasks`, `.columns`, `.movable`,
5703
- `.pending`, `.projectName` and `.autoLabelDefinitions`. It displays priority,
5730
+ `.pending`, `.projectName` and `.autoLabelDefinitions`; `placeholder` draws a
5731
+ loading placeholder in the card's shape, `stalled` holds it still. It displays priority,
5704
5732
  assignee, labels and AutoLabels, its project and completion counts.
5705
5733
  `kanban-ticket-open` identifies a requested ticket, and `kanban-move-menu` carries
5706
5734
  the ticket ID and anchor element. Secondary cards remain usable independently.
@@ -5776,7 +5804,10 @@ Set `.showHeader = false` where the host's own header names the discussion.
5776
5804
  `dees-kanban-activity` renders a ticket's history, oldest first: who changed what,
5777
5805
  marked by the kind of change, with the fields each change touched in words.
5778
5806
  Provide `.ticketId`, `.activity` (`IKanbanActivity[]`), `.columns`, `.tickets`,
5779
- `.projects`, `.loading` and `.error`. An entry's `summary` replaces the board's
5807
+ `.projects`, `.loading` and `.error`. Its first load, `loading` without entries,
5808
+ draws placeholder entries after 200 ms and says "Still loading history…" after
5809
+ `DeesKanbanActivity.stillLoadingAfter` (10 s); entries already there stay while it
5810
+ refreshes. An entry's `summary` replaces the board's
5780
5811
  sentence. Its refresh button emits `kanban-activity-refresh` (`ticketId`); set
5781
5812
  `.showHeader = false` where the host's own header names the history.
5782
5813
 
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-catalog',
6
- version: '22.2.0',
6
+ version: '22.3.0',
7
7
  description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
8
8
  }
@@ -46,14 +46,36 @@ export const demoFunc = () => {
46
46
  demo.actAs(mara);
47
47
  await board.refresh();
48
48
  };
49
+ // The host owns `loading`. A first load starts without tickets and draws the board's placeholders
50
+ // until it finishes, saying it is still loading after ten seconds; a refresh keeps the tickets.
51
+ const startFirstLoad = (event: Event) => {
52
+ const board = boardOf(event);
53
+ board.tickets = [];
54
+ board.loading = true;
55
+ };
56
+ const finishLoading = async (event: Event) => {
57
+ const board = boardOf(event);
58
+ await board.refresh();
59
+ board.loading = false;
60
+ };
61
+ const refreshWithTickets = async (event: Event) => {
62
+ const board = boardOf(event);
63
+ board.loading = true;
64
+ await new Promise(resolve => setTimeout(resolve, 1500));
65
+ await board.refresh();
66
+ board.loading = false;
67
+ };
49
68
  // The server sets the AutoLabels: once a question is asked or answered, the board fetches the tickets again.
50
69
  const questionSaved = (event: Event) => void (event.currentTarget as DeesKanban).refresh();
51
70
  // The bar keeps its height and the board fills the rest; its columns scroll their own cards.
52
71
  return demoApp(html`<div style="display: flex; flex-direction: column; height: 100%">
53
72
  <div class="dees-demo-row" style="flex: none; padding: 0 24px 4px">
54
- <p class="dees-demo-caption">Signed in as Mara Chen. Jonas and Alex work on the same board; Alex waits for Mara's answer on CAT-103. To see a refused stale edit, start editing CAT-102, close it, let Jonas rename it and save.</p>
73
+ <p class="dees-demo-caption">Signed in as Mara Chen. Jonas and Alex work on the same board; Alex waits for Mara's answer on CAT-103. To see a refused stale edit, start editing CAT-102, close it, let Jonas rename it and save. A first load shows placeholders until it finishes, and says it is still loading after ten seconds.</p>
55
74
  <dees-button type="outline" size="sm" text="Simulate a teammate's change" @clicked=${simulate}></dees-button>
56
75
  <dees-button type="outline" size="sm" text="Jonas renames CAT-102" @clicked=${rename}></dees-button>
76
+ <dees-button type="outline" size="sm" text="Start a first load" @clicked=${startFirstLoad}></dees-button>
77
+ <dees-button type="outline" size="sm" text="Finish loading" @clicked=${finishLoading}></dees-button>
78
+ <dees-button type="outline" size="sm" text="Refresh with tickets" @clicked=${refreshWithTickets}></dees-button>
57
79
  </div>
58
80
  <dees-kanban
59
81
  heading="Product workspace"
@@ -80,6 +80,8 @@ import { visuallyHidden } from '../../00visuallyhidden.js';
80
80
  import { nextFrame } from '../../00overlay.js';
81
81
  import { demoFunc } from './dees-kanban.demo.js';
82
82
  import { KanbanDragController } from '../kanban.dragcontroller.js';
83
+ import { KanbanFirstLoadController } from '../kanban.firstload.js';
84
+ import { kanbanSkeletonStyles } from '../kanban.styles.js';
83
85
  import '../dees-kanban-column/dees-kanban-column.js';
84
86
  import '../../00group-overlay/dees-popover/dees-popover.js';
85
87
  import '../../00group-utility/dees-icon/dees-icon.js';
@@ -134,6 +136,9 @@ type TKanbanInteraction = {
134
136
  [K in keyof IKanbanInteractionMap]: { type: K; detail: IKanbanInteractionMap[K] }
135
137
  }[keyof IKanbanInteractionMap];
136
138
 
139
+ /** How many placeholder cards each placeholder column holds on a first load, column after column. */
140
+ const placeholderCards = [3, 2, 3, 1];
141
+
137
142
  /** The board's filters in the filter bubble, by their `IKanbanFilterValues` key. */
138
143
  type TKanbanFilterKey = 'project' | 'epic' | 'assignee' | 'label' | 'autoLabel' | 'mine';
139
144
 
@@ -148,6 +153,9 @@ export class DeesKanban extends DeesElement {
148
153
  public static demo = demoFunc;
149
154
  public static demoGroups = ['Kanban'];
150
155
 
156
+ /** How long a first load runs, in milliseconds, before the board says it is still loading. */
157
+ public static stillLoadingAfter = 10_000;
158
+
151
159
  private readonly t = dcLocalize(this);
152
160
 
153
161
  /** The board's heading; while empty, the catalog's word (`kanban.board`). */
@@ -166,6 +174,13 @@ export class DeesKanban extends DeesElement {
166
174
  @property({ attribute: false })
167
175
  accessor provider: IKanbanProvider = {};
168
176
 
177
+ /**
178
+ * The host is loading the board. The first load, `loading` without tickets, draws placeholder
179
+ * columns and cards on the board's own layout once it has taken 200 ms, so a quick load never
180
+ * flashes them, and says it is still loading after `stillLoadingAfter`, beside the heading where
181
+ * the totals come; columns already set show
182
+ * their names. Tickets that are already there stay while a refresh loads.
183
+ */
169
184
  @property({ type: Boolean, reflect: true })
170
185
  accessor loading = false;
171
186
 
@@ -267,6 +282,11 @@ export class DeesKanban extends DeesElement {
267
282
  input => this.persistMove(input),
268
283
  () => !this.pendingTicketId,
269
284
  );
285
+ private readonly firstLoad = new KanbanFirstLoadController(
286
+ this,
287
+ () => this.isFirstLoad(),
288
+ () => DeesKanban.stillLoadingAfter,
289
+ );
270
290
  /** The columns' scrollbar, shown while they scroll sideways. */
271
291
  private readonly scrollbars = new OverlayScrollbarController(
272
292
  this,
@@ -292,6 +312,7 @@ export class DeesKanban extends DeesElement {
292
312
  activeFilterBarStyles,
293
313
  overlayScrollbarStyles,
294
314
  scrollEdgeInlineFadeStyles,
315
+ kanbanSkeletonStyles,
295
316
  css`
296
317
  /*
297
318
  * The board takes the height its host gives it, as a flex column's remaining space or a sized
@@ -361,10 +382,15 @@ export class DeesKanban extends DeesElement {
361
382
  corner-shape: var(--dees-corner-shape);
362
383
  }
363
384
 
364
- .filterStatus {
385
+ .filterStatus,
386
+ .loadingStatus {
365
387
  ${visuallyHidden}
366
388
  }
367
389
 
390
+ .placeholderTotals {
391
+ width: 14ch;
392
+ }
393
+
368
394
  .actions {
369
395
  display: flex;
370
396
  gap: 8px;
@@ -481,10 +507,18 @@ export class DeesKanban extends DeesElement {
481
507
  const count = active.filter(filter => filter.key !== 'text').length;
482
508
  const filterLabel = count ? this.t('kanban.filtersActive', { count }) : this.t('kanban.filters');
483
509
  const projects = kanbanProjects(this.projects, this.tickets);
510
+ const firstLoad = this.isFirstLoad();
511
+ const stillLoading = this.firstLoad.stillLoading;
484
512
  return html`<header class="heading">
485
513
  <div class="identity">
486
514
  <h2>${this.heading || this.t('kanban.board')}</h2>
487
- <span class="totals">${this.t('kanban.totals', { tasks: tasks.length, epics: epics.length })}</span>
515
+ ${firstLoad && stillLoading
516
+ ? html`<span class="totals" aria-hidden="true">${this.t('kanban.stillLoading')}</span>`
517
+ : firstLoad
518
+ ? html`<span class="totals skeleton" aria-hidden="true"><span
519
+ class="skeletonFill skeletonBar placeholderTotals"
520
+ ></span></span>`
521
+ : html`<span class="totals">${this.t('kanban.totals', { tasks: tasks.length, epics: epics.length })}</span>`}
488
522
  </div>
489
523
  <div class="filters">
490
524
  <div class="searchField">
@@ -569,7 +603,10 @@ export class DeesKanban extends DeesElement {
569
603
  </header>
570
604
  ${this.renderActiveFilters(active)}
571
605
  <p class="filterStatus" role="status">${this.filterAnnouncement}</p>
572
- ${this.loading || this.openingTicket
606
+ <p class="loadingStatus" role="status">${firstLoad
607
+ ? this.t(stillLoading ? 'kanban.stillLoading' : 'kanban.loading')
608
+ : ''}</p>
609
+ ${!firstLoad && (this.loading || this.openingTicket)
573
610
  ? html`<p class="caption" role="status">${this.loading
574
611
  ? this.t('kanban.loading')
575
612
  : this.t('kanban.opening')}</p>`
@@ -577,10 +614,22 @@ export class DeesKanban extends DeesElement {
577
614
  ${this.error || this.operationError
578
615
  ? html`<p class="error" role="alert">${this.error || this.operationError}</p>`
579
616
  : ''}
580
- ${!this.columns.length
617
+ ${!this.columns.length && !firstLoad
581
618
  ? html`<p class="empty">${this.t('kanban.noColumns')}</p>`
582
- : html`<div class="columns ${this.scrollEdges.fadeClasses()}" aria-label=${this.heading || this.t('kanban.board')}>
583
- ${directives.repeat(this.columns, column => column.id, column => html`<dees-kanban-column
619
+ : html`<div
620
+ class="columns ${this.scrollEdges.fadeClasses()}"
621
+ aria-label=${this.heading || this.t('kanban.board')}
622
+ aria-busy=${this.loading ? 'true' : 'false'}
623
+ >
624
+ ${!this.columns.length
625
+ ? placeholderCards.map(cards => html`<dees-kanban-column
626
+ .placeholderCards=${cards}
627
+ .placeholderStalled=${stillLoading}
628
+ ></dees-kanban-column>`)
629
+ : ''}
630
+ ${directives.repeat(this.columns, column => column.id, (column, index) => html`<dees-kanban-column
631
+ .placeholderCards=${firstLoad ? placeholderCards[index % placeholderCards.length] : 0}
632
+ .placeholderStalled=${stillLoading}
584
633
  .column=${column}
585
634
  .columns=${this.columns}
586
635
  .pointerManaged=${true}
@@ -598,6 +647,11 @@ export class DeesKanban extends DeesElement {
598
647
  </div>`}`;
599
648
  }
600
649
 
650
+ /** The board's first load runs: loading, with no tickets yet and nothing failed. */
651
+ private isFirstLoad(): boolean {
652
+ return this.loading && this.tickets.length === 0 && !this.error;
653
+ }
654
+
601
655
  /**
602
656
  * The active-filter bar: below the header, a chip for each filter off its default and for the
603
657
  * search, each removing what it names, then "Clear all". Nothing filtered, no bar.
@@ -17,7 +17,9 @@ import type {
17
17
  TKanbanLink,
18
18
  TKanbanPriority,
19
19
  } from '../interfaces.js';
20
- import { kanbanFeedStyles, kanbanStyles } from '../kanban.styles.js';
20
+ import { kanbanFeedStyles, kanbanSkeletonStyles, kanbanStyles } from '../kanban.styles.js';
21
+ import { KanbanFirstLoadController } from '../kanban.firstload.js';
22
+ import { visuallyHidden } from '../../00visuallyhidden.js';
21
23
  import {
22
24
  kanbanEvent,
23
25
  kanbanLinkText,
@@ -33,6 +35,8 @@ declare global {
33
35
  }
34
36
  }
35
37
 
38
+ /** The placeholder entries a first load draws. */
39
+ const placeholderEntries = 3;
36
40
  /** A changed field's value that is not there. */
37
41
  const noValue = '—';
38
42
  /** The characters of a changed text the history shows before it cuts the text short. */
@@ -55,11 +59,24 @@ interface IChangeLine {
55
59
  value: string;
56
60
  }
57
61
 
58
- /** A ticket's history: who changed what, oldest first, with the fields each change touched. */
62
+ /**
63
+ * A ticket's history: who changed what, oldest first, with the fields each change touched. Its first
64
+ * load, `loading` without entries, draws placeholder entries once it has taken 200 ms and says it is
65
+ * still loading after `stillLoadingAfter`; entries that are already there stay while more load.
66
+ */
59
67
  @customElement('dees-kanban-activity')
60
68
  export class DeesKanbanActivity extends DeesElement {
69
+ /** How long a first load runs, in milliseconds, before the history says it is still loading. */
70
+ public static stillLoadingAfter = 10_000;
71
+
61
72
  private readonly t = dcLocalize(this);
62
73
 
74
+ private readonly firstLoad = new KanbanFirstLoadController(
75
+ this,
76
+ () => this.isFirstLoad(),
77
+ () => DeesKanbanActivity.stillLoadingAfter,
78
+ );
79
+
63
80
  @property({ type: String, reflect: true })
64
81
  accessor ticketId = '';
65
82
 
@@ -92,6 +109,7 @@ export class DeesKanbanActivity extends DeesElement {
92
109
  public static styles = [
93
110
  ...kanbanStyles,
94
111
  kanbanFeedStyles,
112
+ kanbanSkeletonStyles,
95
113
  css`
96
114
  li {
97
115
  grid-template-columns: 24px minmax(0, 1fr);
@@ -150,18 +168,45 @@ export class DeesKanbanActivity extends DeesElement {
150
168
  min-width: 0;
151
169
  overflow-wrap: anywhere;
152
170
  }
171
+
172
+ .loadingStatus {
173
+ ${visuallyHidden}
174
+ }
175
+
176
+ /* A placeholder entry's lines, of differing lengths from entry to entry. */
177
+ .placeholderAuthor {
178
+ width: 10ch;
179
+ }
180
+
181
+ .placeholderWhat {
182
+ width: 18ch;
183
+ }
184
+
185
+ li:nth-child(3n + 2) .placeholderWhat {
186
+ width: 12ch;
187
+ }
188
+
189
+ li:nth-child(3n) .placeholderWhat {
190
+ width: 22ch;
191
+ }
192
+
193
+ .placeholderTime {
194
+ width: 12ch;
195
+ }
153
196
  `,
154
197
  ];
155
198
 
156
199
  public render(): TemplateResult {
157
- const entries = this.activity
158
- .filter(entry => entry.ticketId === this.ticketId)
159
- .slice()
160
- .sort((a, b) => Date.parse(a.createdAt) - Date.parse(b.createdAt));
200
+ const entries = this.entries();
201
+ const firstLoad = this.isFirstLoad();
202
+ const stillLoading = this.firstLoad.stillLoading;
203
+ const skeleton = `skeleton ${stillLoading ? 'stalled' : ''}`;
161
204
  return html`${this.showHeader
162
205
  ? html`<header>
163
206
  <h3>${this.t('kanban.history')}</h3>
164
- <span class="count">${entries.length}</span>
207
+ ${firstLoad
208
+ ? html`<span class=${skeleton} aria-hidden="true"><span class="count skeletonFill"></span></span>`
209
+ : html`<span class="count">${entries.length}</span>`}
165
210
  <span class="spacer"></span>
166
211
  <dees-button
167
212
  class="refresh"
@@ -175,16 +220,48 @@ export class DeesKanbanActivity extends DeesElement {
175
220
  ></dees-button>
176
221
  </header>`
177
222
  : ''}
178
- ${this.loading
179
- ? html`<p class="caption" role="status">${this.t('kanban.loadingHistory')}</p>`
180
- : ''}
223
+ <p class="loadingStatus" role="status">${firstLoad
224
+ ? this.t(stillLoading ? 'kanban.stillLoadingHistory' : 'kanban.loadingHistory')
225
+ : ''}</p>
226
+ ${firstLoad && stillLoading
227
+ ? html`<p class="caption" aria-hidden="true">${this.t('kanban.stillLoadingHistory')}</p>`
228
+ : !firstLoad && this.loading
229
+ ? html`<p class="caption" role="status">${this.t('kanban.loadingHistory')}</p>`
230
+ : ''}
181
231
  ${this.error ? html`<p class="error" role="alert">${this.error}</p>` : ''}
182
- <ol aria-label=${this.t('kanban.history')}>${entries.map(entry => this.renderEntry(entry))}</ol>
232
+ <ol aria-label=${this.t('kanban.history')} aria-busy=${this.loading ? 'true' : 'false'}>${firstLoad
233
+ ? Array.from({ length: placeholderEntries }, () => this.renderPlaceholderEntry(skeleton))
234
+ : entries.map(entry => this.renderEntry(entry))}</ol>
183
235
  ${!entries.length && !this.loading && !this.error
184
236
  ? html`<p class="empty">${this.t('kanban.noHistory')}</p>`
185
237
  : ''}`;
186
238
  }
187
239
 
240
+ /** The history's first load runs: loading, with no entries of the ticket yet and nothing failed. */
241
+ private isFirstLoad(): boolean {
242
+ return this.loading && !this.error && this.entries().length === 0;
243
+ }
244
+
245
+ private entries(): IKanbanActivity[] {
246
+ return this.activity
247
+ .filter(entry => entry.ticketId === this.ticketId)
248
+ .slice()
249
+ .sort((a, b) => Date.parse(a.createdAt) - Date.parse(b.createdAt));
250
+ }
251
+
252
+ /** A placeholder entry, on an entry's own glyph and meta row. */
253
+ private renderPlaceholderEntry(skeleton: string): TemplateResult {
254
+ return html`<li class=${skeleton} aria-hidden="true">
255
+ <span class="glyph skeletonFill"></span><div>
256
+ <div class="row meta">
257
+ <span><span class="author skeletonFill skeletonBar placeholderAuthor"></span> <span
258
+ class="what skeletonFill skeletonBar placeholderWhat"
259
+ ></span></span>
260
+ <time class="skeletonFill skeletonBar placeholderTime"></time>
261
+ </div>
262
+ </div></li>`;
263
+ }
264
+
188
265
  private renderEntry(entry: IKanbanActivity): TemplateResult {
189
266
  const lines = this.changeLines(entry);
190
267
  return html`<li>
@@ -1,7 +1,7 @@
1
1
  import { DeesElement, customElement, property, html, css } from '@design.estate/dees-element';
2
2
  import { dcLocalize } from '../../../i18n/localize.js';
3
3
  import type { IKanbanAutoLabel, IKanbanTicket, IKanbanColumn } from '../interfaces.js';
4
- import { kanbanStyles } from '../kanban.styles.js';
4
+ import { kanbanSkeletonStyles, kanbanStyles } from '../kanban.styles.js';
5
5
  import { kanbanEvent, kanbanInitials, kanbanPriorityIcon, renderKanbanAutoLabels } from '../kanban.helpers.js';
6
6
  import '../../00group-button/dees-button/dees-button.js';
7
7
  import '../../00group-utility/dees-icon/dees-icon.js';
@@ -50,8 +50,21 @@ export class DeesKanbanCard extends DeesElement {
50
50
  @property({ attribute: false })
51
51
  accessor pointerManaged = false;
52
52
 
53
+ /**
54
+ * A placeholder for a card still loading, in the card's own shape: a key, a line of title and a
55
+ * footer with a label and an assignee, hidden from assistive technology. The board draws them on
56
+ * its first load; `ticket` is not read.
57
+ */
58
+ @property({ type: Boolean, reflect: true })
59
+ accessor placeholder = false;
60
+
61
+ /** The placeholder's load runs long: it holds still. */
62
+ @property({ type: Boolean, reflect: true })
63
+ accessor stalled = false;
64
+
53
65
  public static styles = [
54
66
  ...kanbanStyles,
67
+ kanbanSkeletonStyles,
55
68
  css`
56
69
  article {
57
70
  padding: 12px;
@@ -62,7 +75,7 @@ export class DeesKanbanCard extends DeesElement {
62
75
  box-shadow: var(--dees-shadow-xs);
63
76
  }
64
77
 
65
- article:hover {
78
+ article:not(.skeleton):hover {
66
79
  border-color: var(--dees-color-border-strong);
67
80
  }
68
81
 
@@ -256,6 +269,35 @@ export class DeesKanbanCard extends DeesElement {
256
269
  color: var(--dees-color-link);
257
270
  }
258
271
 
272
+ /* A placeholder's lines, of differing lengths from card to card, as real titles are. */
273
+ .skeleton .title {
274
+ cursor: default;
275
+ }
276
+
277
+ .placeholderKey {
278
+ width: 7ch;
279
+ }
280
+
281
+ .placeholderTitle {
282
+ width: 82%;
283
+ }
284
+
285
+ :host(:nth-child(3n + 2)) .placeholderTitle {
286
+ width: 58%;
287
+ }
288
+
289
+ :host(:nth-child(3n)) .placeholderTitle {
290
+ width: 70%;
291
+ }
292
+
293
+ .placeholderLabel {
294
+ width: 9ch;
295
+ }
296
+
297
+ .placeholderName {
298
+ width: 8ch;
299
+ }
300
+
259
301
  @media (pointer: coarse) {
260
302
  .move::part(button) {
261
303
  width: 32px;
@@ -276,6 +318,7 @@ export class DeesKanbanCard extends DeesElement {
276
318
  private readonly t = dcLocalize(this);
277
319
 
278
320
  public render() {
321
+ if (this.placeholder) return this.renderPlaceholder();
279
322
  const ticket = this.ticket;
280
323
  if (!ticket) return html``;
281
324
  const completed = this.subtasks.filter(task =>
@@ -382,4 +425,19 @@ export class DeesKanbanCard extends DeesElement {
382
425
  : ''}
383
426
  </article>`;
384
427
  }
428
+
429
+ /** The placeholder card: each line on the card's own boxes, so the card that replaces it takes its place. */
430
+ private renderPlaceholder() {
431
+ return html`<article class="skeleton ${this.stalled ? 'stalled' : ''}" aria-hidden="true">
432
+ <div class="meta"><span class="skeletonFill skeletonBar placeholderKey"></span></div>
433
+ <div class="title"><span class="skeletonFill skeletonBar placeholderTitle"></span></div>
434
+ <div class="row footer">
435
+ <span class="badge skeletonFill placeholderLabel">\u200b</span>
436
+ <span class="assignee">
437
+ <span class="avatar skeletonFill"></span>
438
+ <span class="skeletonFill skeletonBar placeholderName"></span>
439
+ </span>
440
+ </div>
441
+ </article>`;
442
+ }
385
443
  }
@@ -12,7 +12,7 @@ import { ScrollEdgeShadowController, scrollEdgeFadeStyles } from '../../00scroll
12
12
  import { OverlayScrollbarController, overlayScrollbarStyles } from '../../00scrollbars.js';
13
13
  import type { IKanbanAutoLabel, IKanbanColumn, IKanbanProject, IKanbanTicket } from '../interfaces.js';
14
14
  import type { IKanbanMotion } from '../kanban.dragcontroller.js';
15
- import { kanbanStyles } from '../kanban.styles.js';
15
+ import { kanbanSkeletonStyles, kanbanStyles } from '../kanban.styles.js';
16
16
  import { kanbanEvent, kanbanProjectName, sortKanbanTickets } from '../kanban.helpers.js';
17
17
  import '../dees-kanban-card/dees-kanban-card.js';
18
18
 
@@ -75,6 +75,17 @@ export class DeesKanbanColumn extends DeesElement {
75
75
  @property({ attribute: false })
76
76
  accessor pointerManaged = false;
77
77
 
78
+ /**
79
+ * Placeholder cards the board draws while its first load runs, in place of the column's cards and
80
+ * its count. Without a `column`, the header is a placeholder too: a column still to be named.
81
+ */
82
+ @property({ type: Number, reflect: true })
83
+ accessor placeholderCards = 0;
84
+
85
+ /** The placeholders' load runs long: they hold still. */
86
+ @property({ type: Boolean, reflect: true })
87
+ accessor placeholderStalled = false;
88
+
78
89
  @state()
79
90
  private accessor nativeDropBefore: string | undefined;
80
91
 
@@ -104,6 +115,7 @@ export class DeesKanbanColumn extends DeesElement {
104
115
 
105
116
  public static styles = [
106
117
  ...kanbanStyles,
118
+ kanbanSkeletonStyles,
107
119
  scrollEdgeFadeStyles,
108
120
  overlayScrollbarStyles,
109
121
  css`
@@ -234,6 +246,23 @@ export class DeesKanbanColumn extends DeesElement {
234
246
  margin-top: 8px;
235
247
  }
236
248
 
249
+ /* A placeholder column's name, of differing lengths from column to column. */
250
+ .placeholderTitle {
251
+ width: 12ch;
252
+ }
253
+
254
+ :host(:nth-child(4n + 2)) .placeholderTitle {
255
+ width: 9ch;
256
+ }
257
+
258
+ :host(:nth-child(4n + 3)) .placeholderTitle {
259
+ width: 14ch;
260
+ }
261
+
262
+ :host(:nth-child(4n)) .placeholderTitle {
263
+ width: 7ch;
264
+ }
265
+
237
266
  @media (prefers-reduced-motion: reduce) {
238
267
  section {
239
268
  transition: none;
@@ -259,6 +288,7 @@ export class DeesKanbanColumn extends DeesElement {
259
288
  }
260
289
 
261
290
  public render() {
291
+ if (this.placeholderCards > 0) return this.renderPlaceholder();
262
292
  if (!this.column) return html``;
263
293
  const motion = this.motion;
264
294
  const ordered = sortKanbanTickets(this.tickets).filter(
@@ -416,6 +446,36 @@ export class DeesKanbanColumn extends DeesElement {
416
446
  </section>`;
417
447
  }
418
448
 
449
+ /**
450
+ * The column while the board's first load runs: its own header, or a placeholder one, over
451
+ * placeholder cards in the stack the cards will fill. Nothing in it takes a drop.
452
+ */
453
+ private renderPlaceholder() {
454
+ const skeleton = `skeleton ${this.placeholderStalled ? 'stalled' : ''}`;
455
+ const cards = Array.from({ length: this.placeholderCards }, () => html`<dees-kanban-card
456
+ placeholder
457
+ .stalled=${this.placeholderStalled}
458
+ ></dees-kanban-card>`);
459
+ const content = html`<header>
460
+ ${this.column
461
+ ? html`<span class="status ${this.column.done ? 'done' : ''}" aria-hidden="true"></span>
462
+ <h3>${this.column.title}</h3>`
463
+ : html`<span class="status ${skeleton}" aria-hidden="true"></span>
464
+ <h3 class=${skeleton} aria-hidden="true"><span
465
+ class="skeletonFill skeletonBar placeholderTitle"
466
+ ></span></h3>`}
467
+ <span class=${skeleton} aria-hidden="true"><span class="count skeletonFill"></span></span>
468
+ </header>
469
+ <div class="bodyFrame">
470
+ <div class="body">
471
+ <div class="stack" aria-hidden="true">${cards}</div>
472
+ </div>
473
+ </div>`;
474
+ return this.column
475
+ ? html`<section aria-label=${this.column.title}>${content}</section>`
476
+ : html`<section aria-hidden="true">${content}</section>`;
477
+ }
478
+
419
479
  private toggle(): void {
420
480
  kanbanEvent(this, 'kanban-column-toggle', { columnId: this.column!.id });
421
481
  }
@@ -0,0 +1,54 @@
1
+ import type { DeesElement } from '@design.estate/dees-element';
2
+ import type { TReactiveController } from '../00controller.js';
3
+
4
+ /**
5
+ * Counts a first load towards its "still loading", as the catalog's session list does: while
6
+ * `isFirstLoad()` holds — loading, with nothing to show yet — the host draws placeholders, and once
7
+ * it has held for `stillLoadingAfter()` milliseconds, `stillLoading` turns true and the host
8
+ * renders again to say so. Ending the load, or content arriving, forgets the count; a first load
9
+ * under way when the host left the page counts again from its return.
10
+ */
11
+ export class KanbanFirstLoadController implements TReactiveController {
12
+ private timer: ReturnType<typeof setTimeout> | undefined;
13
+ private stalled = false;
14
+
15
+ constructor(
16
+ private readonly host: DeesElement,
17
+ private readonly isFirstLoad: () => boolean,
18
+ private readonly stillLoadingAfter: () => number,
19
+ ) {
20
+ host.addController(this);
21
+ }
22
+
23
+ /** The first load has run past `stillLoadingAfter()`. */
24
+ public get stillLoading(): boolean {
25
+ return this.stalled;
26
+ }
27
+
28
+ public hostConnected(): void {
29
+ if (this.isFirstLoad()) this.host.requestUpdate();
30
+ }
31
+
32
+ public hostUpdate(): void {
33
+ if (!this.host.isConnected || !this.isFirstLoad()) {
34
+ this.clear();
35
+ return;
36
+ }
37
+ if (this.stalled || this.timer) return;
38
+ this.timer = setTimeout(() => {
39
+ this.timer = undefined;
40
+ this.stalled = true;
41
+ this.host.requestUpdate();
42
+ }, this.stillLoadingAfter());
43
+ }
44
+
45
+ public hostDisconnected(): void {
46
+ this.clear();
47
+ }
48
+
49
+ private clear(): void {
50
+ if (this.timer) clearTimeout(this.timer);
51
+ this.timer = undefined;
52
+ this.stalled = false;
53
+ }
54
+ }