@burdenoff/microfe-timecampus 2026.1028.1 → 2026.1028.2
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.
- package/dist/generated/wspace-operations.d.ts +102 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +477 -425
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +67 -3
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/timecampus/index.js +7 -7
- package/dist/timecampus/pages/focus/FocusProtectionPage.d.ts.map +1 -1
- package/dist/timecampus/pages/focus/FocusProtectionPage.js +341 -280
- package/dist/timecampus/pages/focus/FocusProtectionPage.js.map +1 -1
- package/dist/timecampus/pages/focus/focusHelpers.d.ts +19 -0
- package/dist/timecampus/pages/focus/focusHelpers.d.ts.map +1 -1
- package/dist/timecampus/pages/focus/focusHelpers.js +61 -1
- package/dist/timecampus/pages/focus/focusHelpers.js.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.d.ts.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.js +245 -120
- package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
- package/dist/timecampus/pages/timeline/timelineFocus.d.ts +33 -0
- package/dist/timecampus/pages/timeline/timelineFocus.d.ts.map +1 -0
- package/dist/timecampus/pages/timeline/timelineFocus.js +26 -0
- package/dist/timecampus/pages/timeline/timelineFocus.js.map +1 -0
- package/package.json +1 -1
|
@@ -5,296 +5,421 @@ import { LoadingSkeleton as i } from "../../components/LoadingSkeleton.js";
|
|
|
5
5
|
import { EmptyState as a } from "../../components/EmptyState.js";
|
|
6
6
|
import { useGetTimeCampusTimelineQuery as o, useListProjectsQuery as s, useRecategorizeTimeCampusCaptureEventMutation as c } from "../../../generated/wspace-operations.js";
|
|
7
7
|
import { PageLayout as l } from "../../components/PageLayout.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
8
|
+
import { calendarHoldLabel as u } from "../focus/focusHelpers.js";
|
|
9
|
+
import { driftLabel as d, focusStatusLabel as f, plannedDrift as p, protectedPercent as m } from "./timelineFocus.js";
|
|
10
|
+
import { useMemo as h, useState as g } from "react";
|
|
11
|
+
import { Activity as _, Brain as v, Calendar as y, CalendarClock as b, Coffee as x, FolderOpen as S, Github as C, GripVertical as w, MessageSquare as T, Shield as E, Users as D, Zap as O } from "lucide-react";
|
|
12
|
+
import { jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
13
|
+
import { GlassCard as j } from "@burdenoff/fe-libs/ui";
|
|
14
|
+
import { DndContext as M, DragOverlay as N, KeyboardSensor as P, PointerSensor as F, useDraggable as I, useDroppable as L, useSensor as R, useSensors as z } from "@dnd-kit/core";
|
|
13
15
|
//#region src/timecampus/pages/timeline/TimelinePage.tsx
|
|
14
|
-
var
|
|
16
|
+
var B = {
|
|
15
17
|
DEEP_WORK: {
|
|
16
18
|
label: "Deep work",
|
|
17
|
-
icon:
|
|
19
|
+
icon: v,
|
|
18
20
|
dot: "bg-status-success-bg",
|
|
19
21
|
chip: "bg-status-success-bg text-status-success-text"
|
|
20
22
|
},
|
|
21
23
|
MEETING: {
|
|
22
24
|
label: "Meeting",
|
|
23
|
-
icon:
|
|
25
|
+
icon: D,
|
|
24
26
|
dot: "bg-status-info-bg",
|
|
25
27
|
chip: "bg-status-info-bg text-status-info-text"
|
|
26
28
|
},
|
|
27
29
|
COMMUNICATION: {
|
|
28
30
|
label: "Communication",
|
|
29
|
-
icon:
|
|
31
|
+
icon: T,
|
|
30
32
|
dot: "bg-status-warning-bg",
|
|
31
33
|
chip: "bg-status-warning-bg text-status-warning-text"
|
|
32
34
|
},
|
|
33
35
|
BREAK: {
|
|
34
36
|
label: "Break",
|
|
35
|
-
icon:
|
|
37
|
+
icon: x,
|
|
36
38
|
dot: "bg-bg-sunken",
|
|
37
39
|
chip: "bg-bg-sunken text-text-secondary"
|
|
38
40
|
},
|
|
39
41
|
OTHER: {
|
|
40
42
|
label: "Other",
|
|
41
|
-
icon:
|
|
43
|
+
icon: _,
|
|
42
44
|
dot: "bg-bg-sunken",
|
|
43
45
|
chip: "bg-bg-sunken text-text-secondary"
|
|
44
46
|
}
|
|
45
|
-
},
|
|
46
|
-
TIME_ENTRY:
|
|
47
|
-
MEETING:
|
|
48
|
-
POMODORO:
|
|
49
|
-
EMAIL:
|
|
50
|
-
CAPTURE:
|
|
51
|
-
|
|
47
|
+
}, V = {
|
|
48
|
+
TIME_ENTRY: O,
|
|
49
|
+
MEETING: D,
|
|
50
|
+
POMODORO: v,
|
|
51
|
+
EMAIL: T,
|
|
52
|
+
CAPTURE: C,
|
|
53
|
+
FOCUS_SESSION: E,
|
|
54
|
+
FOCUS_BLOCK: b
|
|
55
|
+
};
|
|
56
|
+
function H(e) {
|
|
57
|
+
return e.source === "FOCUS_SESSION" || e.source === "FOCUS_BLOCK";
|
|
58
|
+
}
|
|
59
|
+
function U({ segment: e }) {
|
|
60
|
+
let r = e.focus;
|
|
61
|
+
if (!r) return null;
|
|
62
|
+
let i = e.isPlanned, a = i ? b : E, o = f(i, r, e.endTime), s = i ? null : m(r), c = i ? null : p(e.startTime, e.endTime, r), l = u(r.calendarHoldStatus);
|
|
63
|
+
return /* @__PURE__ */ A("li", {
|
|
64
|
+
className: `flex items-start gap-3 p-4 ${i ? "bg-bg-sunken/30" : ""}`,
|
|
65
|
+
"data-testid": i ? "timeline-focus-block" : "timeline-focus-session",
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ A("div", {
|
|
68
|
+
className: "flex w-16 shrink-0 flex-col items-end pt-0.5 text-xs tabular-nums text-text-secondary",
|
|
69
|
+
children: [/* @__PURE__ */ k("span", { children: n(e.startTime) }), /* @__PURE__ */ k("span", {
|
|
70
|
+
className: "text-text-tertiary",
|
|
71
|
+
children: t(e.durationSeconds)
|
|
72
|
+
})]
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ k("div", {
|
|
75
|
+
className: `mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg ${i ? "border border-dashed border-status-success-text/60 text-status-success-text" : "bg-status-success-bg text-status-success-text"}`,
|
|
76
|
+
children: /* @__PURE__ */ k(a, { className: "h-4 w-4" })
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ A("div", {
|
|
79
|
+
className: "min-w-0 flex-1",
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ k("p", {
|
|
82
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
83
|
+
children: e.title || (i ? "Planned focus block" : "Focus session")
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ A("div", {
|
|
86
|
+
className: "mt-1 flex flex-wrap items-center gap-2",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ k("span", {
|
|
89
|
+
className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${i ? "border border-dashed border-border-seam text-text-secondary" : "bg-status-success-bg text-status-success-text"}`,
|
|
90
|
+
"data-testid": "timeline-focus-status",
|
|
91
|
+
children: o
|
|
92
|
+
}),
|
|
93
|
+
r.protectionLevel === "STRICT" && /* @__PURE__ */ k("span", {
|
|
94
|
+
className: "text-xs text-text-secondary",
|
|
95
|
+
children: "Strict"
|
|
96
|
+
}),
|
|
97
|
+
r.plannedStartTime && r.plannedEndTime && /* @__PURE__ */ A("span", {
|
|
98
|
+
className: "text-xs tabular-nums text-text-secondary",
|
|
99
|
+
children: [
|
|
100
|
+
"Planned ",
|
|
101
|
+
n(r.plannedStartTime),
|
|
102
|
+
" –",
|
|
103
|
+
" ",
|
|
104
|
+
n(r.plannedEndTime)
|
|
105
|
+
]
|
|
106
|
+
}),
|
|
107
|
+
!i && e.endTime && /* @__PURE__ */ A("span", {
|
|
108
|
+
className: "text-xs tabular-nums text-text-secondary",
|
|
109
|
+
children: [
|
|
110
|
+
"Actual ",
|
|
111
|
+
n(e.startTime),
|
|
112
|
+
" –",
|
|
113
|
+
" ",
|
|
114
|
+
n(e.endTime)
|
|
115
|
+
]
|
|
116
|
+
}),
|
|
117
|
+
c && /* @__PURE__ */ A("span", {
|
|
118
|
+
className: "text-xs text-text-tertiary",
|
|
119
|
+
children: [
|
|
120
|
+
"Started ",
|
|
121
|
+
d(c.startMinutes),
|
|
122
|
+
c.endMinutes !== null && `, ended ${d(c.endMinutes, "over", "short")}`
|
|
123
|
+
]
|
|
124
|
+
}),
|
|
125
|
+
l && /* @__PURE__ */ k("span", {
|
|
126
|
+
className: "text-xs text-text-tertiary",
|
|
127
|
+
children: l
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
}),
|
|
131
|
+
!i && /* @__PURE__ */ A("div", {
|
|
132
|
+
className: "mt-2",
|
|
133
|
+
"data-testid": "timeline-focus-protection",
|
|
134
|
+
children: [/* @__PURE__ */ A("div", {
|
|
135
|
+
className: "flex h-1.5 w-full max-w-xs overflow-hidden rounded-full bg-bg-sunken",
|
|
136
|
+
role: "img",
|
|
137
|
+
"aria-label": `${s ?? 0}% of this session stayed protected`,
|
|
138
|
+
children: [/* @__PURE__ */ k("span", {
|
|
139
|
+
className: "h-full bg-status-success-text",
|
|
140
|
+
style: { width: `${s ?? 0}%` }
|
|
141
|
+
}), /* @__PURE__ */ k("span", {
|
|
142
|
+
className: "h-full bg-status-warning-text",
|
|
143
|
+
style: { width: `${s === null ? 0 : 100 - s}%` }
|
|
144
|
+
})]
|
|
145
|
+
}), /* @__PURE__ */ A("p", {
|
|
146
|
+
className: "mt-1 text-xs tabular-nums text-text-secondary",
|
|
147
|
+
children: [
|
|
148
|
+
"Protected ",
|
|
149
|
+
t(r.protectedSeconds),
|
|
150
|
+
" · Interrupted",
|
|
151
|
+
" ",
|
|
152
|
+
t(r.interruptedSeconds),
|
|
153
|
+
" ·",
|
|
154
|
+
" ",
|
|
155
|
+
r.interruptionCount,
|
|
156
|
+
" interruption",
|
|
157
|
+
r.interruptionCount === 1 ? "" : "s",
|
|
158
|
+
r.blockedAttemptCount > 0 && ` · ${r.blockedAttemptCount} distraction${r.blockedAttemptCount === 1 ? "" : "s"} blocked`
|
|
159
|
+
]
|
|
160
|
+
})]
|
|
161
|
+
}),
|
|
162
|
+
i && /* @__PURE__ */ k("p", {
|
|
163
|
+
className: "mt-1 text-xs text-text-tertiary",
|
|
164
|
+
children: "Not counted in the day's totals until you run it."
|
|
165
|
+
})
|
|
166
|
+
]
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
var W = [
|
|
52
172
|
"DEEP_WORK",
|
|
53
173
|
"MEETING",
|
|
54
174
|
"COMMUNICATION",
|
|
55
175
|
"BREAK",
|
|
56
176
|
"OTHER"
|
|
57
|
-
],
|
|
177
|
+
], G = {
|
|
58
178
|
auto: "Auto-categorized",
|
|
59
179
|
user: "You set this",
|
|
60
180
|
channel: "From channel rules"
|
|
61
181
|
};
|
|
62
|
-
function
|
|
63
|
-
return e ?
|
|
182
|
+
function K(e) {
|
|
183
|
+
return e ? G[e.toLowerCase()] ?? e : null;
|
|
64
184
|
}
|
|
65
|
-
function
|
|
66
|
-
let { isOver: a, setNodeRef: o } =
|
|
67
|
-
return /* @__PURE__ */
|
|
185
|
+
function q({ category: e, label: n, dotClassName: r, totalSeconds: i }) {
|
|
186
|
+
let { isOver: a, setNodeRef: o } = L({ id: `category:${e}` });
|
|
187
|
+
return /* @__PURE__ */ A("div", {
|
|
68
188
|
ref: o,
|
|
69
189
|
className: `flex items-center gap-2 rounded-lg border px-3 py-2 transition-colors ${a ? "border-action-primary-bg bg-action-primary-bg/10" : "border-border-seam bg-bg-surface"}`,
|
|
70
190
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ k("span", {
|
|
72
192
|
className: `inline-block h-2.5 w-2.5 rounded-full ${r}`,
|
|
73
193
|
"aria-hidden": !0
|
|
74
194
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ k("span", {
|
|
76
196
|
className: "text-sm font-medium text-text-primary",
|
|
77
197
|
children: n
|
|
78
198
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ k("span", {
|
|
80
200
|
className: "text-sm tabular-nums text-text-secondary",
|
|
81
201
|
children: t(i)
|
|
82
202
|
}),
|
|
83
|
-
a && /* @__PURE__ */
|
|
203
|
+
a && /* @__PURE__ */ k("span", {
|
|
84
204
|
className: "text-xs font-medium text-primary",
|
|
85
205
|
children: "Drop here"
|
|
86
206
|
})
|
|
87
207
|
]
|
|
88
208
|
});
|
|
89
209
|
}
|
|
90
|
-
function
|
|
91
|
-
let s =
|
|
210
|
+
function J({ segment: e, category: r, projectName: i, recategorizing: a, onRecategorize: o }) {
|
|
211
|
+
let s = B[r] ?? B.OTHER, c = V[e.source] ?? _, l = K(e.categorySource), { attributes: u, listeners: d, setNodeRef: f, isDragging: p } = I({
|
|
92
212
|
id: e.id,
|
|
93
213
|
data: { segment: e },
|
|
94
214
|
disabled: !e.isRecategorizable
|
|
95
215
|
});
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
ref:
|
|
98
|
-
className: `flex items-start gap-3 p-4 transition-colors hover:bg-bg-sunken/50 ${
|
|
216
|
+
return /* @__PURE__ */ A("li", {
|
|
217
|
+
ref: f,
|
|
218
|
+
className: `flex items-start gap-3 p-4 transition-colors hover:bg-bg-sunken/50 ${p ? "opacity-40" : ""}`,
|
|
99
219
|
children: [
|
|
100
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ A("div", {
|
|
101
221
|
className: "flex w-16 shrink-0 flex-col items-end pt-0.5 text-xs tabular-nums text-text-secondary",
|
|
102
|
-
children: [/* @__PURE__ */
|
|
222
|
+
children: [/* @__PURE__ */ k("span", { children: n(e.startTime) }), /* @__PURE__ */ k("span", {
|
|
103
223
|
className: "text-text-tertiary",
|
|
104
224
|
children: t(e.durationSeconds)
|
|
105
225
|
})]
|
|
106
226
|
}),
|
|
107
|
-
e.isRecategorizable && /* @__PURE__ */
|
|
227
|
+
e.isRecategorizable && /* @__PURE__ */ k("button", {
|
|
108
228
|
type: "button",
|
|
109
229
|
"aria-label": `Drag to recategorize ${e.title || s.label}`,
|
|
110
230
|
className: "mt-1.5 shrink-0 cursor-grab touch-none text-text-tertiary hover:text-text-secondary active:cursor-grabbing",
|
|
111
231
|
...u,
|
|
112
232
|
...d,
|
|
113
|
-
children: /* @__PURE__ */
|
|
233
|
+
children: /* @__PURE__ */ k(w, { className: "h-4 w-4" })
|
|
114
234
|
}),
|
|
115
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ k("div", {
|
|
116
236
|
className: `mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg ${s.chip}`,
|
|
117
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ k(c, { className: "h-4 w-4" })
|
|
118
238
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ A("div", {
|
|
120
240
|
className: "min-w-0 flex-1",
|
|
121
|
-
children: [/* @__PURE__ */
|
|
241
|
+
children: [/* @__PURE__ */ k("p", {
|
|
122
242
|
className: "truncate text-sm font-medium text-text-primary",
|
|
123
243
|
children: e.title || s.label
|
|
124
|
-
}), /* @__PURE__ */
|
|
244
|
+
}), /* @__PURE__ */ A("div", {
|
|
125
245
|
className: "mt-1 flex flex-wrap items-center gap-2",
|
|
126
246
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ k("span", {
|
|
128
248
|
className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${s.chip}`,
|
|
129
249
|
children: s.label
|
|
130
250
|
}),
|
|
131
|
-
i !== void 0 && /* @__PURE__ */
|
|
251
|
+
i !== void 0 && /* @__PURE__ */ A("span", {
|
|
132
252
|
className: "inline-flex max-w-[12rem] items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
|
|
133
|
-
children: [/* @__PURE__ */ S
|
|
253
|
+
children: [/* @__PURE__ */ k(S, { className: "h-3 w-3 shrink-0" }), /* @__PURE__ */ k("span", {
|
|
134
254
|
className: "truncate",
|
|
135
255
|
children: i
|
|
136
256
|
})]
|
|
137
257
|
}),
|
|
138
|
-
e.app && /* @__PURE__ */
|
|
258
|
+
e.app && /* @__PURE__ */ k("span", {
|
|
139
259
|
className: "text-xs text-text-secondary",
|
|
140
260
|
children: e.app
|
|
141
261
|
}),
|
|
142
|
-
l && /* @__PURE__ */
|
|
262
|
+
l && /* @__PURE__ */ k("span", {
|
|
143
263
|
className: "text-xs text-text-tertiary",
|
|
144
264
|
children: l
|
|
145
265
|
})
|
|
146
266
|
]
|
|
147
267
|
})]
|
|
148
268
|
}),
|
|
149
|
-
e.isRecategorizable && /* @__PURE__ */
|
|
269
|
+
e.isRecategorizable && /* @__PURE__ */ k("select", {
|
|
150
270
|
"aria-label": "Recategorize activity",
|
|
151
271
|
disabled: a,
|
|
152
272
|
value: r,
|
|
153
273
|
onChange: (t) => o(e, t.target.value),
|
|
154
274
|
className: "shrink-0 rounded-md border border-border-seam bg-bg-surface px-2 py-1 text-xs text-text-secondary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/40",
|
|
155
|
-
children:
|
|
275
|
+
children: W.map((e) => /* @__PURE__ */ k("option", {
|
|
156
276
|
value: e,
|
|
157
|
-
children:
|
|
277
|
+
children: B[e].label
|
|
158
278
|
}, e))
|
|
159
279
|
})
|
|
160
280
|
]
|
|
161
281
|
});
|
|
162
282
|
}
|
|
163
|
-
function
|
|
283
|
+
function Y(e) {
|
|
164
284
|
let t = e.getTimezoneOffset();
|
|
165
285
|
return (/* @__PURE__ */ new Date(e.getTime() - t * 60 * 1e3)).toISOString().slice(0, 10);
|
|
166
286
|
}
|
|
167
|
-
|
|
287
|
+
var X = 14;
|
|
288
|
+
function ee() {
|
|
289
|
+
let e = /* @__PURE__ */ new Date();
|
|
290
|
+
return e.setDate(e.getDate() + X), Y(e);
|
|
291
|
+
}
|
|
292
|
+
function te(e) {
|
|
168
293
|
let t = /* @__PURE__ */ new Date(`${e}T00:00:00`), n = /* @__PURE__ */ new Date(`${e}T23:59:59.999`);
|
|
169
294
|
return {
|
|
170
295
|
from: t.toISOString(),
|
|
171
296
|
to: n.toISOString()
|
|
172
297
|
};
|
|
173
298
|
}
|
|
174
|
-
function
|
|
175
|
-
let { workspaceId:
|
|
299
|
+
function Z() {
|
|
300
|
+
let { workspaceId: u = "" } = e(), [d, f] = g(() => Y(/* @__PURE__ */ new Date())), [p, m] = g(null), { from: b, to: x } = h(() => te(d), [d]), { data: S, loading: C, error: T, refetch: E } = o({
|
|
176
301
|
variables: {
|
|
177
|
-
from:
|
|
178
|
-
to:
|
|
302
|
+
from: b,
|
|
303
|
+
to: x
|
|
179
304
|
},
|
|
180
|
-
skip: !
|
|
305
|
+
skip: !u,
|
|
181
306
|
fetchPolicy: "cache-and-network"
|
|
182
|
-
}), { data:
|
|
307
|
+
}), { data: D } = s({
|
|
183
308
|
variables: { pagination: { limit: 200 } },
|
|
184
|
-
skip: !
|
|
185
|
-
}), [
|
|
309
|
+
skip: !u
|
|
310
|
+
}), [I, { loading: L }] = c(), V = z(R(F, { activationConstraint: { distance: 6 } }), R(P)), G = S?.timeCampusTimeline, K = G?.segments ?? [], X = G?.summary, Z = h(() => {
|
|
186
311
|
let e = /* @__PURE__ */ new Map();
|
|
187
|
-
for (let t of
|
|
312
|
+
for (let t of D?.projects?.items ?? []) e.set(t.id, t.name);
|
|
188
313
|
return e;
|
|
189
|
-
}, [
|
|
314
|
+
}, [D?.projects?.items]), ne = h(() => {
|
|
190
315
|
let e = /* @__PURE__ */ new Map();
|
|
191
|
-
for (let t of
|
|
316
|
+
for (let t of X?.byCategory ?? []) e.set(t.category, {
|
|
192
317
|
totalSeconds: t.totalSeconds,
|
|
193
318
|
segmentCount: t.segmentCount
|
|
194
319
|
});
|
|
195
320
|
return e;
|
|
196
|
-
}, [
|
|
197
|
-
!e.isRecategorizable || e.category === t || (await
|
|
321
|
+
}, [X]), Q = async (e, t) => {
|
|
322
|
+
!e.isRecategorizable || e.category === t || (await I({ variables: {
|
|
198
323
|
id: e.sourceId,
|
|
199
324
|
category: t
|
|
200
|
-
} }), await
|
|
201
|
-
},
|
|
325
|
+
} }), await E());
|
|
326
|
+
}, re = (e) => {
|
|
202
327
|
let t = e.active.data.current?.segment;
|
|
203
|
-
|
|
204
|
-
},
|
|
328
|
+
m(t ?? null);
|
|
329
|
+
}, ie = (e) => {
|
|
205
330
|
let t = e.active.data.current?.segment;
|
|
206
|
-
|
|
331
|
+
m(null);
|
|
207
332
|
let n = e.over?.id;
|
|
208
333
|
if (!t || typeof n != "string") return;
|
|
209
334
|
let r = n.replace(/^category:/, "");
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
return /* @__PURE__ */
|
|
335
|
+
W.includes(r) && Q(t, r);
|
|
336
|
+
}, ae = X && X.focusRatio != null ? Math.round(X.focusRatio * 100) : 0, $ = X?.firstActivityAt && X?.lastActivityAt ? `${n(X.firstActivityAt)} – ${n(X.lastActivityAt)}` : null;
|
|
337
|
+
return /* @__PURE__ */ k(l, {
|
|
213
338
|
title: "Timeline",
|
|
214
339
|
description: "Your day, assembled automatically",
|
|
215
340
|
purpose: "See where your time actually went — meetings, deep work, communication and breaks stitched into one honest, chronological view from everything TimeCampus captures, so you can spot the patterns worth changing.",
|
|
216
|
-
actions: /* @__PURE__ */
|
|
341
|
+
actions: /* @__PURE__ */ A("div", {
|
|
217
342
|
className: "flex flex-wrap items-center gap-3",
|
|
218
|
-
children: [$ && /* @__PURE__ */
|
|
343
|
+
children: [$ && /* @__PURE__ */ A("span", {
|
|
219
344
|
className: "inline-flex items-center gap-1.5 rounded-full bg-bg-sunken px-2.5 py-1 text-xs font-medium tabular-nums text-text-secondary",
|
|
220
|
-
children: [/* @__PURE__ */
|
|
221
|
-
}), /* @__PURE__ */
|
|
345
|
+
children: [/* @__PURE__ */ k(_, { className: "h-3.5 w-3.5" }), $]
|
|
346
|
+
}), /* @__PURE__ */ A("label", {
|
|
222
347
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
223
|
-
children: [/* @__PURE__ */
|
|
348
|
+
children: [/* @__PURE__ */ k(y, { className: "h-4 w-4" }), /* @__PURE__ */ k("input", {
|
|
224
349
|
type: "date",
|
|
225
|
-
value:
|
|
226
|
-
max:
|
|
227
|
-
onChange: (e) =>
|
|
350
|
+
value: d,
|
|
351
|
+
max: ee(),
|
|
352
|
+
onChange: (e) => f(e.target.value),
|
|
228
353
|
className: "rounded-md border border-border-seam bg-bg-surface px-3 py-1.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/40"
|
|
229
354
|
})]
|
|
230
355
|
})]
|
|
231
356
|
}),
|
|
232
|
-
children:
|
|
357
|
+
children: C && !G ? /* @__PURE__ */ A("div", {
|
|
233
358
|
className: "space-y-6",
|
|
234
|
-
children: [/* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ k(i, {
|
|
235
360
|
variant: "card",
|
|
236
361
|
count: 4
|
|
237
|
-
}), /* @__PURE__ */
|
|
362
|
+
}), /* @__PURE__ */ k(i, {
|
|
238
363
|
variant: "list",
|
|
239
364
|
count: 6
|
|
240
365
|
})]
|
|
241
|
-
}) :
|
|
366
|
+
}) : T ? /* @__PURE__ */ k("div", {
|
|
242
367
|
className: "rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text",
|
|
243
368
|
children: "Failed to load your timeline. Please try again later."
|
|
244
|
-
}) : /* @__PURE__ */
|
|
245
|
-
sensors:
|
|
246
|
-
onDragStart:
|
|
247
|
-
onDragEnd:
|
|
248
|
-
children: [/* @__PURE__ */
|
|
369
|
+
}) : /* @__PURE__ */ A(M, {
|
|
370
|
+
sensors: V,
|
|
371
|
+
onDragStart: re,
|
|
372
|
+
onDragEnd: ie,
|
|
373
|
+
children: [/* @__PURE__ */ A("div", {
|
|
249
374
|
className: "space-y-6",
|
|
250
375
|
children: [
|
|
251
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ A("div", {
|
|
252
377
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
253
378
|
children: [
|
|
254
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ k(r, {
|
|
255
380
|
featured: !0,
|
|
256
381
|
title: "Tracked time",
|
|
257
|
-
value: t(
|
|
258
|
-
icon: /* @__PURE__ */
|
|
382
|
+
value: t(X?.totalTrackedSeconds ?? 0),
|
|
383
|
+
icon: /* @__PURE__ */ k(_, { className: "h-5 w-5" }),
|
|
259
384
|
description: "Total activity across the day"
|
|
260
385
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ k(r, {
|
|
262
387
|
title: "Focus ratio",
|
|
263
|
-
value: `${
|
|
264
|
-
icon: /* @__PURE__ */
|
|
388
|
+
value: `${ae}%`,
|
|
389
|
+
icon: /* @__PURE__ */ k(v, { className: "h-5 w-5" }),
|
|
265
390
|
description: "Share of time in deep work"
|
|
266
391
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ k(r, {
|
|
268
393
|
title: "Context switches",
|
|
269
|
-
value:
|
|
270
|
-
icon: /* @__PURE__ */
|
|
394
|
+
value: X?.contextSwitches ?? 0,
|
|
395
|
+
icon: /* @__PURE__ */ k(O, { className: "h-5 w-5" }),
|
|
271
396
|
description: "Category changes through the day"
|
|
272
397
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ k(r, {
|
|
274
399
|
title: "Longest focus block",
|
|
275
|
-
value: t(
|
|
276
|
-
icon: /* @__PURE__ */
|
|
400
|
+
value: t(X?.longestFocusBlockSeconds ?? 0),
|
|
401
|
+
icon: /* @__PURE__ */ k(v, { className: "h-5 w-5" }),
|
|
277
402
|
description: "Your deepest uninterrupted stretch"
|
|
278
403
|
})
|
|
279
404
|
]
|
|
280
405
|
}),
|
|
281
|
-
|
|
406
|
+
K.length > 0 && /* @__PURE__ */ A(j, {
|
|
282
407
|
treatment: "glass",
|
|
283
408
|
className: "p-4 sm:p-6",
|
|
284
409
|
children: [
|
|
285
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ k("h2", {
|
|
286
411
|
className: "mb-1 text-sm font-semibold text-text-primary",
|
|
287
412
|
children: "Where the time went"
|
|
288
413
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ k("p", {
|
|
290
415
|
className: "mb-4 text-xs text-text-secondary",
|
|
291
416
|
children: "Drag a segment from the timeline below onto a category to recategorize it — or use its dropdown."
|
|
292
417
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ k("div", {
|
|
294
419
|
className: "flex flex-wrap gap-4",
|
|
295
|
-
children:
|
|
296
|
-
let t =
|
|
297
|
-
return /* @__PURE__ */
|
|
420
|
+
children: W.map((e) => {
|
|
421
|
+
let t = B[e], n = ne.get(e);
|
|
422
|
+
return /* @__PURE__ */ k(q, {
|
|
298
423
|
category: e,
|
|
299
424
|
label: t.label,
|
|
300
425
|
dotClassName: t.dot,
|
|
@@ -304,37 +429,37 @@ function H() {
|
|
|
304
429
|
})
|
|
305
430
|
]
|
|
306
431
|
}),
|
|
307
|
-
|
|
432
|
+
K.length === 0 ? /* @__PURE__ */ k(a, {
|
|
308
433
|
illustration: "empty-generic",
|
|
309
434
|
title: "No activity captured for this day",
|
|
310
435
|
description: "As you track time, hold meetings, run focus sessions, and connect shared integrations, your day assembles here automatically — categorized and in order."
|
|
311
|
-
}) : /* @__PURE__ */
|
|
436
|
+
}) : /* @__PURE__ */ k(j, {
|
|
312
437
|
treatment: "glass",
|
|
313
438
|
glow: !0,
|
|
314
439
|
className: "overflow-hidden",
|
|
315
|
-
children: /* @__PURE__ */
|
|
440
|
+
children: /* @__PURE__ */ k("ol", {
|
|
316
441
|
className: "divide-y divide-border-seam",
|
|
317
|
-
children:
|
|
442
|
+
children: K.map((e) => H(e) ? /* @__PURE__ */ k(U, { segment: e }, e.id) : /* @__PURE__ */ k(J, {
|
|
318
443
|
segment: e,
|
|
319
444
|
category: e.category ?? "OTHER",
|
|
320
|
-
projectName: e.projectId ?
|
|
321
|
-
recategorizing:
|
|
445
|
+
projectName: e.projectId ? Z.get(e.projectId) : void 0,
|
|
446
|
+
recategorizing: L,
|
|
322
447
|
onRecategorize: Q
|
|
323
448
|
}, e.id))
|
|
324
449
|
})
|
|
325
450
|
})
|
|
326
451
|
]
|
|
327
|
-
}), /* @__PURE__ */
|
|
452
|
+
}), /* @__PURE__ */ k(N, { children: p && /* @__PURE__ */ A("div", {
|
|
328
453
|
className: "flex items-center gap-2 rounded-lg border border-border-seam bg-bg-surface px-3 py-2 shadow-pop",
|
|
329
|
-
children: [/* @__PURE__ */
|
|
454
|
+
children: [/* @__PURE__ */ k(w, { className: "h-4 w-4 text-text-tertiary" }), /* @__PURE__ */ k("span", {
|
|
330
455
|
className: "text-sm font-medium text-text-primary",
|
|
331
|
-
children:
|
|
456
|
+
children: p.title || B[p.category ?? "OTHER"].label
|
|
332
457
|
})]
|
|
333
458
|
}) })]
|
|
334
459
|
})
|
|
335
460
|
});
|
|
336
461
|
}
|
|
337
462
|
//#endregion
|
|
338
|
-
export {
|
|
463
|
+
export { Z as TimelinePage };
|
|
339
464
|
|
|
340
465
|
//# sourceMappingURL=TimelinePage.js.map
|