@burdenoff/microfe-timecampus 2026.1031.10 → 2026.1031.11
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 +45 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +710 -672
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +731 -0
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +14 -12
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/timecampus/analytics/index.d.ts +3 -0
- package/dist/timecampus/analytics/index.d.ts.map +1 -0
- package/dist/timecampus/analytics/index.js +3 -0
- package/dist/timecampus/analytics/timecampusAnalytics.d.ts +83 -0
- package/dist/timecampus/analytics/timecampusAnalytics.d.ts.map +1 -0
- package/dist/timecampus/analytics/timecampusAnalytics.js +175 -0
- package/dist/timecampus/analytics/timecampusAnalytics.js.map +1 -0
- package/dist/timecampus/analytics/useTimeCampusAnalytics.d.ts +16 -0
- package/dist/timecampus/analytics/useTimeCampusAnalytics.d.ts.map +1 -0
- package/dist/timecampus/analytics/useTimeCampusAnalytics.js +48 -0
- package/dist/timecampus/analytics/useTimeCampusAnalytics.js.map +1 -0
- package/dist/timecampus/components/ActivationCard.d.ts +3 -0
- package/dist/timecampus/components/ActivationCard.d.ts.map +1 -0
- package/dist/timecampus/components/ActivationCard.js +156 -0
- package/dist/timecampus/components/ActivationCard.js.map +1 -0
- package/dist/timecampus/index.js +7 -7
- package/dist/timecampus/pages/HomePage.d.ts.map +1 -1
- package/dist/timecampus/pages/HomePage.js +142 -139
- package/dist/timecampus/pages/HomePage.js.map +1 -1
- package/dist/timecampus/pages/client-portal/ClientPortalPage.d.ts.map +1 -1
- package/dist/timecampus/pages/client-portal/ClientPortalPage.js +244 -228
- package/dist/timecampus/pages/client-portal/ClientPortalPage.js.map +1 -1
- package/dist/timecampus/pages/dashboard/AnalyticsPage.d.ts.map +1 -1
- package/dist/timecampus/pages/dashboard/AnalyticsPage.js +117 -112
- package/dist/timecampus/pages/dashboard/AnalyticsPage.js.map +1 -1
- package/dist/timecampus/pages/dashboard/ReportsPage.d.ts.map +1 -1
- package/dist/timecampus/pages/dashboard/ReportsPage.js +105 -102
- package/dist/timecampus/pages/dashboard/ReportsPage.js.map +1 -1
- package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.d.ts.map +1 -1
- package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js +209 -192
- package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/focus-score/FocusScorePage.d.ts.map +1 -1
- package/dist/timecampus/pages/focus-score/FocusScorePage.js +71 -68
- package/dist/timecampus/pages/focus-score/FocusScorePage.js.map +1 -1
- package/dist/timecampus/pages/invoicing/InvoicingPage.d.ts.map +1 -1
- package/dist/timecampus/pages/invoicing/InvoicingPage.js +157 -150
- package/dist/timecampus/pages/invoicing/InvoicingPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingCreatePage.d.ts.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingCreatePage.js +58 -52
- package/dist/timecampus/pages/meetings/MeetingCreatePage.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingsPage.d.ts.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingsPage.js +51 -45
- package/dist/timecampus/pages/meetings/MeetingsPage.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroPage.d.ts.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js +55 -51
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js.map +1 -1
- package/dist/timecampus/pages/projects/ProjectCreatePage.d.ts.map +1 -1
- package/dist/timecampus/pages/projects/ProjectCreatePage.js +59 -49
- package/dist/timecampus/pages/projects/ProjectCreatePage.js.map +1 -1
- package/dist/timecampus/pages/projects/ProjectsPage.d.ts.map +1 -1
- package/dist/timecampus/pages/projects/ProjectsPage.js +165 -155
- package/dist/timecampus/pages/projects/ProjectsPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimeEntriesPage.d.ts.map +1 -1
- package/dist/timecampus/pages/time/TimeEntriesPage.js +194 -186
- package/dist/timecampus/pages/time/TimeEntriesPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimeTrackingPage.d.ts.map +1 -1
- package/dist/timecampus/pages/time/TimeTrackingPage.js +139 -126
- package/dist/timecampus/pages/time/TimeTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimerPage.d.ts.map +1 -1
- package/dist/timecampus/pages/time/TimerPage.js +48 -35
- package/dist/timecampus/pages/time/TimerPage.js.map +1 -1
- package/dist/timecampus/pages/time-approval/TimeApprovalPage.d.ts.map +1 -1
- package/dist/timecampus/pages/time-approval/TimeApprovalPage.js +60 -50
- package/dist/timecampus/pages/time-approval/TimeApprovalPage.js.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.d.ts.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.js +223 -219
- package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,103 +3,105 @@ import { formatDuration as t, formatTime as n } from "../../utils/helpers.js";
|
|
|
3
3
|
import { StatCard as r } from "../../components/StatCard.js";
|
|
4
4
|
import { LoadingSkeleton as i } from "../../components/LoadingSkeleton.js";
|
|
5
5
|
import { EmptyState as a } from "../../components/EmptyState.js";
|
|
6
|
-
import { useAcceptTimeCampusCaptureEventSuggestionMutation as o, useGetTimeCampusTimelineQuery as s, useListProjectsQuery as c, useRecategorizeTimeCampusCaptureEventMutation as l, useRejectTimeCampusCaptureEventSuggestionMutation as
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
6
|
+
import { useAcceptTimeCampusCaptureEventSuggestionMutation as o, useGetTimeCampusTimelineQuery as s, useListProjectsQuery as c, useRecategorizeTimeCampusCaptureEventMutation as l, useRejectTimeCampusCaptureEventSuggestionMutation as ee, useSetTimeCampusCaptureEventProjectMutation as u, useSuggestTimeCampusCaptureEventProjectMutation as d } from "../../../generated/wspace-operations.js";
|
|
7
|
+
import { useTimelineViewed as f } from "../../analytics/useTimeCampusAnalytics.js";
|
|
8
|
+
import "../../analytics/index.js";
|
|
9
|
+
import { PageLayout as te } from "../../components/PageLayout.js";
|
|
10
|
+
import { ToastContainer as ne, useToast as p } from "../../components/Toast.js";
|
|
9
11
|
import { calendarHoldLabel as m } from "../focus/focusHelpers.js";
|
|
10
|
-
import { parseTimelineDateParam as
|
|
11
|
-
import { hasAiCategorizedSegment as
|
|
12
|
-
import { driftLabel as
|
|
13
|
-
import { pendingSuggestion as
|
|
14
|
-
import { useMemo as
|
|
15
|
-
import { Activity as
|
|
16
|
-
import { useSearchParams as
|
|
17
|
-
import { jsx as
|
|
18
|
-
import { GlassCard as
|
|
19
|
-
import { DndContext as
|
|
12
|
+
import { parseTimelineDateParam as re } from "../lifetime/recommendationEvidence.js";
|
|
13
|
+
import { hasAiCategorizedSegment as ie, segmentProvenance as ae } from "./timelineProvenance.js";
|
|
14
|
+
import { driftLabel as h, focusStatusLabel as oe, plannedDrift as se, protectedPercent as g } from "./timelineFocus.js";
|
|
15
|
+
import { pendingSuggestion as ce, pendingSuggestions as le } from "./timelineSuggestions.js";
|
|
16
|
+
import { useMemo as _, useState as v } from "react";
|
|
17
|
+
import { Activity as y, Brain as b, Calendar as ue, CalendarClock as x, Check as S, Coffee as C, FolderOpen as w, Github as T, GripVertical as E, MessageSquare as D, Shield as O, Sparkles as k, Users as A, X as j, Zap as de } from "lucide-react";
|
|
18
|
+
import { useSearchParams as fe } from "react-router";
|
|
19
|
+
import { jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
20
|
+
import { GlassCard as P } from "@burdenoff/fe-libs/ui";
|
|
21
|
+
import { DndContext as pe, DragOverlay as me, KeyboardSensor as he, PointerSensor as ge, useDraggable as F, useDroppable as I, useSensor as L, useSensors as _e } from "@dnd-kit/core";
|
|
20
22
|
//#region src/timecampus/pages/timeline/TimelinePage.tsx
|
|
21
|
-
var
|
|
23
|
+
var R = {
|
|
22
24
|
DEEP_WORK: {
|
|
23
25
|
label: "Deep work",
|
|
24
|
-
icon:
|
|
26
|
+
icon: b,
|
|
25
27
|
dot: "bg-status-success-bg",
|
|
26
28
|
chip: "bg-status-success-bg text-status-success-text"
|
|
27
29
|
},
|
|
28
30
|
MEETING: {
|
|
29
31
|
label: "Meeting",
|
|
30
|
-
icon:
|
|
32
|
+
icon: A,
|
|
31
33
|
dot: "bg-status-info-bg",
|
|
32
34
|
chip: "bg-status-info-bg text-status-info-text"
|
|
33
35
|
},
|
|
34
36
|
COMMUNICATION: {
|
|
35
37
|
label: "Communication",
|
|
36
|
-
icon:
|
|
38
|
+
icon: D,
|
|
37
39
|
dot: "bg-status-warning-bg",
|
|
38
40
|
chip: "bg-status-warning-bg text-status-warning-text"
|
|
39
41
|
},
|
|
40
42
|
BREAK: {
|
|
41
43
|
label: "Break",
|
|
42
|
-
icon:
|
|
44
|
+
icon: C,
|
|
43
45
|
dot: "bg-bg-sunken",
|
|
44
46
|
chip: "bg-bg-sunken text-text-secondary"
|
|
45
47
|
},
|
|
46
48
|
OTHER: {
|
|
47
49
|
label: "Other",
|
|
48
|
-
icon:
|
|
50
|
+
icon: y,
|
|
49
51
|
dot: "bg-bg-sunken",
|
|
50
52
|
chip: "bg-bg-sunken text-text-secondary"
|
|
51
53
|
}
|
|
52
|
-
},
|
|
53
|
-
TIME_ENTRY:
|
|
54
|
-
MEETING:
|
|
55
|
-
POMODORO:
|
|
56
|
-
EMAIL:
|
|
57
|
-
CAPTURE:
|
|
58
|
-
FOCUS_SESSION:
|
|
59
|
-
FOCUS_BLOCK:
|
|
54
|
+
}, z = {
|
|
55
|
+
TIME_ENTRY: de,
|
|
56
|
+
MEETING: A,
|
|
57
|
+
POMODORO: b,
|
|
58
|
+
EMAIL: D,
|
|
59
|
+
CAPTURE: T,
|
|
60
|
+
FOCUS_SESSION: O,
|
|
61
|
+
FOCUS_BLOCK: x
|
|
60
62
|
};
|
|
61
|
-
function
|
|
63
|
+
function ve(e) {
|
|
62
64
|
return e.source === "FOCUS_SESSION" || e.source === "FOCUS_BLOCK";
|
|
63
65
|
}
|
|
64
|
-
function
|
|
66
|
+
function ye({ segment: e }) {
|
|
65
67
|
let r = e.focus;
|
|
66
68
|
if (!r) return null;
|
|
67
|
-
let i = e.isPlanned, a = i ?
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
+
let i = e.isPlanned, a = i ? x : O, o = oe(i, r, e.endTime), s = i ? null : g(r), c = i ? null : se(e.startTime, e.endTime, r), l = m(r.calendarHoldStatus);
|
|
70
|
+
return /* @__PURE__ */ N("li", {
|
|
69
71
|
className: `flex items-start gap-3 p-4 ${i ? "bg-bg-sunken/30" : ""}`,
|
|
70
72
|
"data-testid": i ? "timeline-focus-block" : "timeline-focus-session",
|
|
71
73
|
children: [
|
|
72
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ N("div", {
|
|
73
75
|
className: "flex w-16 shrink-0 flex-col items-end pt-0.5 text-xs tabular-nums text-text-secondary",
|
|
74
|
-
children: [/* @__PURE__ */
|
|
76
|
+
children: [/* @__PURE__ */ M("span", { children: n(e.startTime) }), /* @__PURE__ */ M("span", {
|
|
75
77
|
className: "text-text-tertiary",
|
|
76
78
|
children: t(e.durationSeconds)
|
|
77
79
|
})]
|
|
78
80
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ M("div", {
|
|
80
82
|
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"}`,
|
|
81
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ M(a, { className: "h-4 w-4" })
|
|
82
84
|
}),
|
|
83
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ N("div", {
|
|
84
86
|
className: "min-w-0 flex-1",
|
|
85
87
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ M("p", {
|
|
87
89
|
className: "truncate text-sm font-medium text-text-primary",
|
|
88
90
|
children: e.title || (i ? "Planned focus block" : "Focus session")
|
|
89
91
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ N("div", {
|
|
91
93
|
className: "mt-1 flex flex-wrap items-center gap-2",
|
|
92
94
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ M("span", {
|
|
94
96
|
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"}`,
|
|
95
97
|
"data-testid": "timeline-focus-status",
|
|
96
98
|
children: o
|
|
97
99
|
}),
|
|
98
|
-
r.protectionLevel === "STRICT" && /* @__PURE__ */
|
|
100
|
+
r.protectionLevel === "STRICT" && /* @__PURE__ */ M("span", {
|
|
99
101
|
className: "text-xs text-text-secondary",
|
|
100
102
|
children: "Strict"
|
|
101
103
|
}),
|
|
102
|
-
r.plannedStartTime && r.plannedEndTime && /* @__PURE__ */
|
|
104
|
+
r.plannedStartTime && r.plannedEndTime && /* @__PURE__ */ N("span", {
|
|
103
105
|
className: "text-xs tabular-nums text-text-secondary",
|
|
104
106
|
children: [
|
|
105
107
|
"Planned ",
|
|
@@ -109,7 +111,7 @@ function he({ segment: e }) {
|
|
|
109
111
|
n(r.plannedEndTime)
|
|
110
112
|
]
|
|
111
113
|
}),
|
|
112
|
-
!i && e.endTime && /* @__PURE__ */
|
|
114
|
+
!i && e.endTime && /* @__PURE__ */ N("span", {
|
|
113
115
|
className: "text-xs tabular-nums text-text-secondary",
|
|
114
116
|
children: [
|
|
115
117
|
"Actual ",
|
|
@@ -119,35 +121,35 @@ function he({ segment: e }) {
|
|
|
119
121
|
n(e.endTime)
|
|
120
122
|
]
|
|
121
123
|
}),
|
|
122
|
-
c && /* @__PURE__ */
|
|
124
|
+
c && /* @__PURE__ */ N("span", {
|
|
123
125
|
className: "text-xs text-text-tertiary",
|
|
124
126
|
children: [
|
|
125
127
|
"Started ",
|
|
126
|
-
|
|
127
|
-
c.endMinutes !== null && `, ended ${
|
|
128
|
+
h(c.startMinutes),
|
|
129
|
+
c.endMinutes !== null && `, ended ${h(c.endMinutes, "over", "short")}`
|
|
128
130
|
]
|
|
129
131
|
}),
|
|
130
|
-
l && /* @__PURE__ */
|
|
132
|
+
l && /* @__PURE__ */ M("span", {
|
|
131
133
|
className: "text-xs text-text-tertiary",
|
|
132
134
|
children: l
|
|
133
135
|
})
|
|
134
136
|
]
|
|
135
137
|
}),
|
|
136
|
-
!i && /* @__PURE__ */
|
|
138
|
+
!i && /* @__PURE__ */ N("div", {
|
|
137
139
|
className: "mt-2",
|
|
138
140
|
"data-testid": "timeline-focus-protection",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
141
|
+
children: [/* @__PURE__ */ N("div", {
|
|
140
142
|
className: "flex h-1.5 w-full max-w-xs overflow-hidden rounded-full bg-bg-sunken",
|
|
141
143
|
role: "img",
|
|
142
144
|
"aria-label": `${s ?? 0}% of this session stayed protected`,
|
|
143
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ M("span", {
|
|
144
146
|
className: "h-full bg-status-success-text",
|
|
145
147
|
style: { width: `${s ?? 0}%` }
|
|
146
|
-
}), /* @__PURE__ */
|
|
148
|
+
}), /* @__PURE__ */ M("span", {
|
|
147
149
|
className: "h-full bg-status-warning-text",
|
|
148
150
|
style: { width: `${s === null ? 0 : 100 - s}%` }
|
|
149
151
|
})]
|
|
150
|
-
}), /* @__PURE__ */
|
|
152
|
+
}), /* @__PURE__ */ N("p", {
|
|
151
153
|
className: "mt-1 text-xs tabular-nums text-text-secondary",
|
|
152
154
|
children: [
|
|
153
155
|
"Protected ",
|
|
@@ -164,7 +166,7 @@ function he({ segment: e }) {
|
|
|
164
166
|
]
|
|
165
167
|
})]
|
|
166
168
|
}),
|
|
167
|
-
i && /* @__PURE__ */
|
|
169
|
+
i && /* @__PURE__ */ M("p", {
|
|
168
170
|
className: "mt-1 text-xs text-text-tertiary",
|
|
169
171
|
children: "Not counted in the day's totals until you run it."
|
|
170
172
|
})
|
|
@@ -173,28 +175,28 @@ function he({ segment: e }) {
|
|
|
173
175
|
]
|
|
174
176
|
});
|
|
175
177
|
}
|
|
176
|
-
var
|
|
178
|
+
var B = [
|
|
177
179
|
"DEEP_WORK",
|
|
178
180
|
"MEETING",
|
|
179
181
|
"COMMUNICATION",
|
|
180
182
|
"BREAK",
|
|
181
183
|
"OTHER"
|
|
182
184
|
];
|
|
183
|
-
function
|
|
184
|
-
return /* @__PURE__ */
|
|
185
|
+
function V({ suggestion: e, busy: t, onAccept: n, onReject: r }) {
|
|
186
|
+
return /* @__PURE__ */ N("div", {
|
|
185
187
|
className: "mt-2 flex flex-wrap items-center gap-2 rounded-lg border border-dashed border-border-seam bg-bg-sunken/40 px-2.5 py-1.5",
|
|
186
188
|
"data-testid": "timeline-project-suggestion",
|
|
187
189
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ M(k, {
|
|
189
191
|
className: "h-3.5 w-3.5 shrink-0 text-primary",
|
|
190
192
|
"aria-hidden": !0
|
|
191
193
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ N("span", {
|
|
193
195
|
className: "text-xs text-text-secondary",
|
|
194
196
|
children: [
|
|
195
197
|
"Suggested project",
|
|
196
198
|
" ",
|
|
197
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ M("span", {
|
|
198
200
|
className: "font-medium text-text-primary",
|
|
199
201
|
children: e.projectName
|
|
200
202
|
}),
|
|
@@ -205,129 +207,129 @@ function W({ suggestion: e, busy: t, onAccept: n, onReject: r }) {
|
|
|
205
207
|
e.reason
|
|
206
208
|
]
|
|
207
209
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ N("span", {
|
|
209
211
|
className: "ml-auto flex items-center gap-1",
|
|
210
|
-
children: [/* @__PURE__ */
|
|
212
|
+
children: [/* @__PURE__ */ N("button", {
|
|
211
213
|
type: "button",
|
|
212
214
|
disabled: t,
|
|
213
215
|
onClick: () => n(e),
|
|
214
216
|
"aria-label": `Accept project ${e.projectName}`,
|
|
215
217
|
className: "inline-flex items-center gap-1 rounded-md bg-action-primary-bg px-2 py-0.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
217
|
-
}), /* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ M(S, { className: "h-3 w-3" }), "Accept"]
|
|
219
|
+
}), /* @__PURE__ */ N("button", {
|
|
218
220
|
type: "button",
|
|
219
221
|
disabled: t,
|
|
220
222
|
onClick: () => r(e),
|
|
221
223
|
"aria-label": `Dismiss suggested project ${e.projectName}`,
|
|
222
224
|
className: "inline-flex items-center gap-1 rounded-md border border-border-seam bg-bg-surface px-2 py-0.5 text-xs font-medium text-text-secondary hover:bg-bg-sunken disabled:opacity-50",
|
|
223
|
-
children: [/* @__PURE__ */
|
|
225
|
+
children: [/* @__PURE__ */ M(j, { className: "h-3 w-3" }), "Dismiss"]
|
|
224
226
|
})]
|
|
225
227
|
})
|
|
226
228
|
]
|
|
227
229
|
});
|
|
228
230
|
}
|
|
229
|
-
function
|
|
230
|
-
let { isOver: a, setNodeRef: o } =
|
|
231
|
-
return /* @__PURE__ */
|
|
231
|
+
function be({ category: e, label: n, dotClassName: r, totalSeconds: i }) {
|
|
232
|
+
let { isOver: a, setNodeRef: o } = I({ id: `category:${e}` });
|
|
233
|
+
return /* @__PURE__ */ N("div", {
|
|
232
234
|
ref: o,
|
|
233
235
|
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"}`,
|
|
234
236
|
children: [
|
|
235
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ M("span", {
|
|
236
238
|
className: `inline-block h-2.5 w-2.5 rounded-full ${r}`,
|
|
237
239
|
"aria-hidden": !0
|
|
238
240
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ M("span", {
|
|
240
242
|
className: "text-sm font-medium text-text-primary",
|
|
241
243
|
children: n
|
|
242
244
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ M("span", {
|
|
244
246
|
className: "text-sm tabular-nums text-text-secondary",
|
|
245
247
|
children: t(i)
|
|
246
248
|
}),
|
|
247
|
-
a && /* @__PURE__ */
|
|
249
|
+
a && /* @__PURE__ */ M("span", {
|
|
248
250
|
className: "text-xs font-medium text-primary",
|
|
249
251
|
children: "Drop here"
|
|
250
252
|
})
|
|
251
253
|
]
|
|
252
254
|
});
|
|
253
255
|
}
|
|
254
|
-
function
|
|
255
|
-
let l =
|
|
256
|
+
function xe({ segment: e, category: r, projectName: i, suggestion: a, recategorizing: o, onRecategorize: s, projectActions: c }) {
|
|
257
|
+
let l = R[r] ?? R.OTHER, ee = z[e.source] ?? y, u = ae(e), d = e.source === "CAPTURE", f = d && !e.projectId && !a && c.projects.length > 0, { attributes: te, listeners: ne, setNodeRef: p, isDragging: m } = F({
|
|
256
258
|
id: e.id,
|
|
257
259
|
data: { segment: e },
|
|
258
260
|
disabled: !e.isRecategorizable
|
|
259
261
|
});
|
|
260
|
-
return /* @__PURE__ */
|
|
261
|
-
ref:
|
|
262
|
-
className: `flex items-start gap-3 p-4 transition-colors hover:bg-bg-sunken/50 ${
|
|
262
|
+
return /* @__PURE__ */ N("li", {
|
|
263
|
+
ref: p,
|
|
264
|
+
className: `flex items-start gap-3 p-4 transition-colors hover:bg-bg-sunken/50 ${m ? "opacity-40" : ""}`,
|
|
263
265
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ N("div", {
|
|
265
267
|
className: "flex w-16 shrink-0 flex-col items-end pt-0.5 text-xs tabular-nums text-text-secondary",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ M("span", { children: n(e.startTime) }), /* @__PURE__ */ M("span", {
|
|
267
269
|
className: "text-text-tertiary",
|
|
268
270
|
children: t(e.durationSeconds)
|
|
269
271
|
})]
|
|
270
272
|
}),
|
|
271
|
-
e.isRecategorizable && /* @__PURE__ */
|
|
273
|
+
e.isRecategorizable && /* @__PURE__ */ M("button", {
|
|
272
274
|
type: "button",
|
|
273
275
|
"aria-label": `Drag to recategorize ${e.title || l.label}`,
|
|
274
276
|
className: "mt-1.5 shrink-0 cursor-grab touch-none text-text-tertiary hover:text-text-secondary active:cursor-grabbing",
|
|
275
|
-
...ee,
|
|
276
277
|
...te,
|
|
277
|
-
|
|
278
|
+
...ne,
|
|
279
|
+
children: /* @__PURE__ */ M(E, { className: "h-4 w-4" })
|
|
278
280
|
}),
|
|
279
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ M("div", {
|
|
280
282
|
className: `mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg ${l.chip}`,
|
|
281
|
-
children: /* @__PURE__ */
|
|
283
|
+
children: /* @__PURE__ */ M(ee, { className: "h-4 w-4" })
|
|
282
284
|
}),
|
|
283
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ N("div", {
|
|
284
286
|
className: "min-w-0 flex-1",
|
|
285
287
|
children: [
|
|
286
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ M("p", {
|
|
287
289
|
className: "truncate text-sm font-medium text-text-primary",
|
|
288
290
|
children: e.title || l.label
|
|
289
291
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ N("div", {
|
|
291
293
|
className: "mt-1 flex flex-wrap items-center gap-2",
|
|
292
294
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ M("span", {
|
|
294
296
|
className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${l.chip}`,
|
|
295
297
|
children: l.label
|
|
296
298
|
}),
|
|
297
|
-
i !== void 0 && /* @__PURE__ */
|
|
299
|
+
i !== void 0 && /* @__PURE__ */ N("span", {
|
|
298
300
|
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",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ M(w, { className: "h-3 w-3 shrink-0" }), /* @__PURE__ */ M("span", {
|
|
300
302
|
className: "truncate",
|
|
301
303
|
children: i
|
|
302
304
|
})]
|
|
303
305
|
}),
|
|
304
|
-
e.app && /* @__PURE__ */
|
|
306
|
+
e.app && /* @__PURE__ */ M("span", {
|
|
305
307
|
className: "text-xs text-text-secondary",
|
|
306
308
|
children: e.app
|
|
307
309
|
}),
|
|
308
|
-
|
|
310
|
+
u && (u.isAi ? /* @__PURE__ */ N("span", {
|
|
309
311
|
className: "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
|
|
310
|
-
title:
|
|
312
|
+
title: u.detail,
|
|
311
313
|
"data-testid": "timeline-ai-provenance",
|
|
312
314
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ M(k, {
|
|
314
316
|
className: "h-3 w-3 shrink-0",
|
|
315
317
|
"aria-hidden": !0
|
|
316
318
|
}),
|
|
317
|
-
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
+
u.label,
|
|
320
|
+
/* @__PURE__ */ N("span", {
|
|
319
321
|
className: "sr-only",
|
|
320
|
-
children: [". ",
|
|
322
|
+
children: [". ", u.detail]
|
|
321
323
|
})
|
|
322
324
|
]
|
|
323
|
-
}) : /* @__PURE__ */
|
|
325
|
+
}) : /* @__PURE__ */ M("span", {
|
|
324
326
|
className: "text-xs text-text-tertiary",
|
|
325
|
-
title:
|
|
326
|
-
children:
|
|
327
|
+
title: u.detail,
|
|
328
|
+
children: u.label
|
|
327
329
|
}))
|
|
328
330
|
]
|
|
329
331
|
}),
|
|
330
|
-
a && /* @__PURE__ */
|
|
332
|
+
a && /* @__PURE__ */ M(V, {
|
|
331
333
|
suggestion: a,
|
|
332
334
|
busy: c.busy,
|
|
333
335
|
onAccept: c.onAccept,
|
|
@@ -335,121 +337,123 @@ function _e({ segment: e, category: r, projectName: i, suggestion: a, recategori
|
|
|
335
337
|
})
|
|
336
338
|
]
|
|
337
339
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ N("div", {
|
|
339
341
|
className: "flex shrink-0 flex-col items-end gap-1.5",
|
|
340
342
|
children: [
|
|
341
|
-
e.isRecategorizable && /* @__PURE__ */
|
|
343
|
+
e.isRecategorizable && /* @__PURE__ */ M("select", {
|
|
342
344
|
"aria-label": "Recategorize activity",
|
|
343
345
|
disabled: o,
|
|
344
346
|
value: r,
|
|
345
347
|
onChange: (t) => s(e, t.target.value),
|
|
346
348
|
className: "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",
|
|
347
|
-
children:
|
|
349
|
+
children: B.map((e) => /* @__PURE__ */ M("option", {
|
|
348
350
|
value: e,
|
|
349
|
-
children:
|
|
351
|
+
children: R[e].label
|
|
350
352
|
}, e))
|
|
351
353
|
}),
|
|
352
|
-
|
|
354
|
+
d && c.projects.length > 0 && /* @__PURE__ */ N("select", {
|
|
353
355
|
"aria-label": "Assign project",
|
|
354
356
|
disabled: c.busy,
|
|
355
357
|
value: e.projectId ?? "",
|
|
356
358
|
onChange: (t) => c.onSetProject(e, t.target.value || null),
|
|
357
359
|
className: "max-w-[10rem] 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",
|
|
358
|
-
children: [/* @__PURE__ */
|
|
360
|
+
children: [/* @__PURE__ */ M("option", {
|
|
359
361
|
value: "",
|
|
360
362
|
children: "No project"
|
|
361
|
-
}), c.projects.map((e) => /* @__PURE__ */
|
|
363
|
+
}), c.projects.map((e) => /* @__PURE__ */ M("option", {
|
|
362
364
|
value: e.id,
|
|
363
365
|
children: e.name
|
|
364
366
|
}, e.id))]
|
|
365
367
|
}),
|
|
366
|
-
|
|
368
|
+
f && /* @__PURE__ */ N("button", {
|
|
367
369
|
type: "button",
|
|
368
370
|
disabled: c.busy,
|
|
369
371
|
onClick: () => c.onSuggest(e),
|
|
370
372
|
className: "inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline disabled:opacity-50",
|
|
371
|
-
children: [/* @__PURE__ */
|
|
373
|
+
children: [/* @__PURE__ */ M(k, { className: "h-3 w-3" }), "Suggest project"]
|
|
372
374
|
})
|
|
373
375
|
]
|
|
374
376
|
})
|
|
375
377
|
]
|
|
376
378
|
});
|
|
377
379
|
}
|
|
378
|
-
function
|
|
380
|
+
function H(e) {
|
|
379
381
|
return e instanceof Error ? e.message : "Something went wrong";
|
|
380
382
|
}
|
|
381
|
-
function
|
|
383
|
+
function U(e) {
|
|
382
384
|
let t = e.getTimezoneOffset();
|
|
383
385
|
return (/* @__PURE__ */ new Date(e.getTime() - t * 60 * 1e3)).toISOString().slice(0, 10);
|
|
384
386
|
}
|
|
385
|
-
var
|
|
386
|
-
function
|
|
387
|
+
var W = 14;
|
|
388
|
+
function G() {
|
|
387
389
|
let e = /* @__PURE__ */ new Date();
|
|
388
|
-
return e.setDate(e.getDate() +
|
|
390
|
+
return e.setDate(e.getDate() + W), U(e);
|
|
389
391
|
}
|
|
390
|
-
function
|
|
392
|
+
function Se(e) {
|
|
391
393
|
let t = /* @__PURE__ */ new Date(`${e}T00:00:00`), n = /* @__PURE__ */ new Date(`${e}T23:59:59.999`);
|
|
392
394
|
return {
|
|
393
395
|
from: t.toISOString(),
|
|
394
396
|
to: n.toISOString()
|
|
395
397
|
};
|
|
396
398
|
}
|
|
397
|
-
function
|
|
398
|
-
let { workspaceId: m = "" } = e(), { toasts:
|
|
399
|
-
let e =
|
|
400
|
-
return e !== null && e <=
|
|
401
|
-
}), [
|
|
399
|
+
function K() {
|
|
400
|
+
let { workspaceId: m = "" } = e(), { toasts: ae, addToast: h, dismissToast: oe } = p(), [se] = fe(), [g, x] = v(() => {
|
|
401
|
+
let e = re(se.get("date"));
|
|
402
|
+
return e !== null && e <= G() ? e : U(/* @__PURE__ */ new Date());
|
|
403
|
+
}), [C, w] = v(null), { from: T, to: D } = _(() => Se(g), [g]), { data: O, loading: A, error: j, refetch: F } = s({
|
|
402
404
|
variables: {
|
|
403
|
-
from:
|
|
404
|
-
to:
|
|
405
|
+
from: T,
|
|
406
|
+
to: D
|
|
405
407
|
},
|
|
406
408
|
skip: !m,
|
|
407
409
|
fetchPolicy: "cache-and-network"
|
|
408
|
-
}), { data:
|
|
410
|
+
}), { data: I } = c({
|
|
409
411
|
variables: { pagination: { limit: 200 } },
|
|
410
412
|
skip: !m
|
|
411
|
-
}), [
|
|
413
|
+
}), [z, { loading: V }] = l(), [W, { loading: K }] = o(), [Ce, { loading: we }] = ee(), [Te, { loading: Ee }] = u(), [De, { loading: Oe }] = d(), q = K || we || Ee || Oe, ke = _e(L(ge, { activationConstraint: { distance: 6 } }), L(he)), J = O?.timeCampusTimeline, Y = _(() => J?.segments ?? [], [J]);
|
|
414
|
+
f(!A && !!J, Y.length > 0);
|
|
415
|
+
let X = J?.summary, Z = _(() => {
|
|
412
416
|
let e = /* @__PURE__ */ new Map();
|
|
413
|
-
for (let t of
|
|
417
|
+
for (let t of I?.projects?.items ?? []) e.set(t.id, t.name);
|
|
414
418
|
return e;
|
|
415
|
-
}, [
|
|
419
|
+
}, [I?.projects?.items]), Ae = _(() => Array.from(Z, ([e, t]) => ({
|
|
416
420
|
id: e,
|
|
417
421
|
name: t
|
|
418
|
-
})), [Z]), Q =
|
|
422
|
+
})), [Z]), Q = _(() => le(Y, Z), [Y, Z]), je = _(() => {
|
|
419
423
|
let e = /* @__PURE__ */ new Map();
|
|
420
424
|
for (let t of X?.byCategory ?? []) e.set(t.category, {
|
|
421
425
|
totalSeconds: t.totalSeconds,
|
|
422
426
|
segmentCount: t.segmentCount
|
|
423
427
|
});
|
|
424
428
|
return e;
|
|
425
|
-
}, [X]),
|
|
426
|
-
!e.isRecategorizable || e.category === t || (await
|
|
429
|
+
}, [X]), Me = async (e, t) => {
|
|
430
|
+
!e.isRecategorizable || e.category === t || (await z({ variables: {
|
|
427
431
|
id: e.sourceId,
|
|
428
432
|
category: t
|
|
429
|
-
} }), await
|
|
433
|
+
} }), await F());
|
|
430
434
|
}, $ = async (e, t) => {
|
|
431
435
|
try {
|
|
432
|
-
await e(), await
|
|
436
|
+
await e(), await F(), h({
|
|
433
437
|
title: t,
|
|
434
438
|
variant: "success"
|
|
435
439
|
});
|
|
436
440
|
} catch (e) {
|
|
437
|
-
|
|
438
|
-
title:
|
|
441
|
+
h({
|
|
442
|
+
title: H(e),
|
|
439
443
|
variant: "error"
|
|
440
444
|
});
|
|
441
445
|
}
|
|
442
|
-
},
|
|
446
|
+
}, Ne = (e) => $(() => W({ variables: { id: e.captureEventId } }), `Assigned to ${e.projectName}`), Pe = (e) => $(() => Ce({ variables: { id: e.captureEventId } }), "Suggestion dismissed"), Fe = (e, t) => {
|
|
443
447
|
if ((e.projectId ?? null) === t) return;
|
|
444
448
|
let n = t ? Z.get(t) : void 0;
|
|
445
|
-
return $(() =>
|
|
449
|
+
return $(() => Te({ variables: {
|
|
446
450
|
id: e.sourceId,
|
|
447
451
|
projectId: t
|
|
448
452
|
} }), n ? `Assigned to ${n}` : "Project removed");
|
|
449
|
-
},
|
|
453
|
+
}, Ie = async (e) => {
|
|
450
454
|
try {
|
|
451
|
-
let t = (await
|
|
452
|
-
await
|
|
455
|
+
let t = (await De({ variables: { id: e.sourceId } })).data?.suggestTimeCampusCaptureEventCategory;
|
|
456
|
+
await F(), h(t?.suggestedProjectId ? {
|
|
453
457
|
title: `Suggested ${t.suggestedProjectName ?? "a project"}`,
|
|
454
458
|
description: "Accept or dismiss it on the activity.",
|
|
455
459
|
variant: "info"
|
|
@@ -459,144 +463,144 @@ function be() {
|
|
|
459
463
|
variant: "info"
|
|
460
464
|
});
|
|
461
465
|
} catch (e) {
|
|
462
|
-
|
|
463
|
-
title:
|
|
466
|
+
h({
|
|
467
|
+
title: H(e),
|
|
464
468
|
variant: "error"
|
|
465
469
|
});
|
|
466
470
|
}
|
|
467
|
-
},
|
|
471
|
+
}, Le = async () => {
|
|
468
472
|
let e = 0;
|
|
469
473
|
try {
|
|
470
|
-
for (let t of Q) await
|
|
471
|
-
|
|
474
|
+
for (let t of Q) await W({ variables: { id: t.captureEventId } }), e++;
|
|
475
|
+
h({
|
|
472
476
|
title: `Accepted ${e} project ${e === 1 ? "suggestion" : "suggestions"}`,
|
|
473
477
|
variant: "success"
|
|
474
478
|
});
|
|
475
479
|
} catch (t) {
|
|
476
|
-
|
|
480
|
+
h({
|
|
477
481
|
title: `Accepted ${e} of ${Q.length}`,
|
|
478
|
-
description:
|
|
482
|
+
description: H(t),
|
|
479
483
|
variant: "error"
|
|
480
484
|
});
|
|
481
485
|
} finally {
|
|
482
|
-
await
|
|
486
|
+
await F();
|
|
483
487
|
}
|
|
484
|
-
},
|
|
485
|
-
projects:
|
|
486
|
-
busy:
|
|
487
|
-
onAccept: (e) => void
|
|
488
|
-
onReject: (e) => void
|
|
489
|
-
onSetProject: (e, t) => void
|
|
490
|
-
onSuggest: (e) => void
|
|
491
|
-
}, Re = (e) => {
|
|
492
|
-
let t = e.active.data.current?.segment;
|
|
493
|
-
D(t ?? null);
|
|
488
|
+
}, Re = {
|
|
489
|
+
projects: Ae,
|
|
490
|
+
busy: q,
|
|
491
|
+
onAccept: (e) => void Ne(e),
|
|
492
|
+
onReject: (e) => void Pe(e),
|
|
493
|
+
onSetProject: (e, t) => void Fe(e, t),
|
|
494
|
+
onSuggest: (e) => void Ie(e)
|
|
494
495
|
}, ze = (e) => {
|
|
495
496
|
let t = e.active.data.current?.segment;
|
|
496
|
-
|
|
497
|
+
w(t ?? null);
|
|
498
|
+
}, Be = (e) => {
|
|
499
|
+
let t = e.active.data.current?.segment;
|
|
500
|
+
w(null);
|
|
497
501
|
let n = e.over?.id;
|
|
498
502
|
if (!t || typeof n != "string") return;
|
|
499
503
|
let r = n.replace(/^category:/, "");
|
|
500
|
-
|
|
501
|
-
},
|
|
502
|
-
return /* @__PURE__ */
|
|
504
|
+
B.includes(r) && Me(t, r);
|
|
505
|
+
}, Ve = X && X.focusRatio != null ? Math.round(X.focusRatio * 100) : 0, He = X?.firstActivityAt && X?.lastActivityAt ? `${n(X.firstActivityAt)} – ${n(X.lastActivityAt)}` : null;
|
|
506
|
+
return /* @__PURE__ */ N(te, {
|
|
503
507
|
title: "Timeline",
|
|
504
508
|
description: "Your day, assembled automatically",
|
|
505
509
|
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.",
|
|
506
|
-
actions: /* @__PURE__ */
|
|
510
|
+
actions: /* @__PURE__ */ N("div", {
|
|
507
511
|
className: "flex flex-wrap items-center gap-3",
|
|
508
|
-
children: [
|
|
512
|
+
children: [He && /* @__PURE__ */ N("span", {
|
|
509
513
|
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",
|
|
510
|
-
children: [/* @__PURE__ */
|
|
511
|
-
}), /* @__PURE__ */
|
|
514
|
+
children: [/* @__PURE__ */ M(y, { className: "h-3.5 w-3.5" }), He]
|
|
515
|
+
}), /* @__PURE__ */ N("label", {
|
|
512
516
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
513
|
-
children: [/* @__PURE__ */
|
|
517
|
+
children: [/* @__PURE__ */ M(ue, { className: "h-4 w-4" }), /* @__PURE__ */ M("input", {
|
|
514
518
|
type: "date",
|
|
515
|
-
value:
|
|
516
|
-
max:
|
|
517
|
-
onChange: (e) =>
|
|
519
|
+
value: g,
|
|
520
|
+
max: G(),
|
|
521
|
+
onChange: (e) => x(e.target.value),
|
|
518
522
|
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"
|
|
519
523
|
})]
|
|
520
524
|
})]
|
|
521
525
|
}),
|
|
522
|
-
children: [
|
|
526
|
+
children: [A && !J ? /* @__PURE__ */ N("div", {
|
|
523
527
|
className: "space-y-6",
|
|
524
|
-
children: [/* @__PURE__ */
|
|
528
|
+
children: [/* @__PURE__ */ M(i, {
|
|
525
529
|
variant: "card",
|
|
526
530
|
count: 4
|
|
527
|
-
}), /* @__PURE__ */
|
|
531
|
+
}), /* @__PURE__ */ M(i, {
|
|
528
532
|
variant: "list",
|
|
529
533
|
count: 6
|
|
530
534
|
})]
|
|
531
|
-
}) :
|
|
535
|
+
}) : j ? /* @__PURE__ */ M("div", {
|
|
532
536
|
className: "rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text",
|
|
533
537
|
children: "Failed to load your timeline. Please try again later."
|
|
534
|
-
}) : /* @__PURE__ */
|
|
535
|
-
sensors:
|
|
536
|
-
onDragStart:
|
|
537
|
-
onDragEnd:
|
|
538
|
-
children: [/* @__PURE__ */
|
|
538
|
+
}) : /* @__PURE__ */ N(pe, {
|
|
539
|
+
sensors: ke,
|
|
540
|
+
onDragStart: ze,
|
|
541
|
+
onDragEnd: Be,
|
|
542
|
+
children: [/* @__PURE__ */ N("div", {
|
|
539
543
|
className: "space-y-6",
|
|
540
544
|
children: [
|
|
541
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ N("div", {
|
|
542
546
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
543
547
|
children: [
|
|
544
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ M(r, {
|
|
545
549
|
featured: !0,
|
|
546
550
|
title: "Tracked time",
|
|
547
551
|
value: t(X?.totalTrackedSeconds ?? 0),
|
|
548
|
-
icon: /* @__PURE__ */
|
|
552
|
+
icon: /* @__PURE__ */ M(y, { className: "h-5 w-5" }),
|
|
549
553
|
description: "Total activity across the day"
|
|
550
554
|
}),
|
|
551
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ M(r, {
|
|
552
556
|
title: "Focus ratio",
|
|
553
|
-
value: `${
|
|
554
|
-
icon: /* @__PURE__ */
|
|
557
|
+
value: `${Ve}%`,
|
|
558
|
+
icon: /* @__PURE__ */ M(b, { className: "h-5 w-5" }),
|
|
555
559
|
description: "Share of time in deep work"
|
|
556
560
|
}),
|
|
557
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ M(r, {
|
|
558
562
|
title: "Context switches",
|
|
559
563
|
value: X?.contextSwitches ?? 0,
|
|
560
|
-
icon: /* @__PURE__ */
|
|
564
|
+
icon: /* @__PURE__ */ M(de, { className: "h-5 w-5" }),
|
|
561
565
|
description: "Category changes through the day"
|
|
562
566
|
}),
|
|
563
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ M(r, {
|
|
564
568
|
title: "Longest focus block",
|
|
565
569
|
value: t(X?.longestFocusBlockSeconds ?? 0),
|
|
566
|
-
icon: /* @__PURE__ */
|
|
570
|
+
icon: /* @__PURE__ */ M(b, { className: "h-5 w-5" }),
|
|
567
571
|
description: "Your deepest uninterrupted stretch"
|
|
568
572
|
})
|
|
569
573
|
]
|
|
570
574
|
}),
|
|
571
|
-
Y.length > 0 && /* @__PURE__ */
|
|
575
|
+
Y.length > 0 && /* @__PURE__ */ N(P, {
|
|
572
576
|
treatment: "glass",
|
|
573
577
|
className: "p-4 sm:p-6",
|
|
574
578
|
children: [
|
|
575
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ M("h2", {
|
|
576
580
|
className: "mb-1 text-sm font-semibold text-text-primary",
|
|
577
581
|
children: "Where the time went"
|
|
578
582
|
}),
|
|
579
|
-
/* @__PURE__ */
|
|
583
|
+
/* @__PURE__ */ M("p", {
|
|
580
584
|
className: "mb-4 text-xs text-text-secondary",
|
|
581
585
|
children: "Drag a segment from the timeline below onto a category to recategorize it — or use its dropdown."
|
|
582
586
|
}),
|
|
583
|
-
|
|
587
|
+
ie(Y) && /* @__PURE__ */ N("p", {
|
|
584
588
|
className: "mb-4 flex items-start gap-1.5 text-xs text-text-secondary",
|
|
585
589
|
"data-testid": "timeline-ai-disclaimer",
|
|
586
|
-
children: [/* @__PURE__ */
|
|
590
|
+
children: [/* @__PURE__ */ M(k, {
|
|
587
591
|
className: "mt-0.5 h-3 w-3 shrink-0",
|
|
588
592
|
"aria-hidden": !0
|
|
589
|
-
}), /* @__PURE__ */
|
|
593
|
+
}), /* @__PURE__ */ N("span", { children: [
|
|
590
594
|
"Some activities here were categorized by AI.",
|
|
591
595
|
" ",
|
|
592
596
|
"AI can get this wrong. Pick another category to correct it, and TimeCampus will use your choice for this app from now on."
|
|
593
597
|
] })]
|
|
594
598
|
}),
|
|
595
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ M("div", {
|
|
596
600
|
className: "flex flex-wrap gap-4",
|
|
597
|
-
children:
|
|
598
|
-
let t =
|
|
599
|
-
return /* @__PURE__ */
|
|
601
|
+
children: B.map((e) => {
|
|
602
|
+
let t = R[e], n = je.get(e);
|
|
603
|
+
return /* @__PURE__ */ M(be, {
|
|
600
604
|
category: e,
|
|
601
605
|
label: t.label,
|
|
602
606
|
dotClassName: t.dot,
|
|
@@ -606,15 +610,15 @@ function be() {
|
|
|
606
610
|
})
|
|
607
611
|
]
|
|
608
612
|
}),
|
|
609
|
-
Q.length > 0 && /* @__PURE__ */
|
|
613
|
+
Q.length > 0 && /* @__PURE__ */ N("div", {
|
|
610
614
|
className: "flex flex-wrap items-center gap-3 rounded-lg border border-border-seam bg-bg-sunken/40 px-4 py-3",
|
|
611
615
|
"data-testid": "timeline-suggestions-banner",
|
|
612
616
|
children: [
|
|
613
|
-
/* @__PURE__ */
|
|
614
|
-
/* @__PURE__ */
|
|
617
|
+
/* @__PURE__ */ M(k, { className: "h-4 w-4 shrink-0 text-primary" }),
|
|
618
|
+
/* @__PURE__ */ N("p", {
|
|
615
619
|
className: "text-sm text-text-secondary",
|
|
616
620
|
children: [
|
|
617
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ N("span", {
|
|
618
622
|
className: "font-medium text-text-primary",
|
|
619
623
|
children: [
|
|
620
624
|
Q.length,
|
|
@@ -627,51 +631,51 @@ function be() {
|
|
|
627
631
|
"waiting for review. Nothing is assigned until you accept."
|
|
628
632
|
]
|
|
629
633
|
}),
|
|
630
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ N("button", {
|
|
631
635
|
type: "button",
|
|
632
|
-
disabled:
|
|
633
|
-
onClick: () => void
|
|
636
|
+
disabled: q,
|
|
637
|
+
onClick: () => void Le(),
|
|
634
638
|
className: "ml-auto inline-flex items-center gap-1 rounded-md bg-action-primary-bg px-3 py-1 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
635
|
-
children: [/* @__PURE__ */
|
|
639
|
+
children: [/* @__PURE__ */ M(S, { className: "h-3.5 w-3.5" }), "Accept all"]
|
|
636
640
|
})
|
|
637
641
|
]
|
|
638
642
|
}),
|
|
639
|
-
Y.length === 0 ? /* @__PURE__ */
|
|
643
|
+
Y.length === 0 ? /* @__PURE__ */ M(a, {
|
|
640
644
|
illustration: "empty-generic",
|
|
641
645
|
title: "No activity captured for this day",
|
|
642
646
|
description: "As you track time, hold meetings, run focus sessions, and connect shared integrations, your day assembles here automatically — categorized and in order."
|
|
643
|
-
}) : /* @__PURE__ */
|
|
647
|
+
}) : /* @__PURE__ */ M(P, {
|
|
644
648
|
treatment: "glass",
|
|
645
649
|
glow: !0,
|
|
646
650
|
className: "overflow-hidden",
|
|
647
|
-
children: /* @__PURE__ */
|
|
651
|
+
children: /* @__PURE__ */ M("ol", {
|
|
648
652
|
className: "divide-y divide-border-seam",
|
|
649
|
-
children: Y.map((e) =>
|
|
653
|
+
children: Y.map((e) => ve(e) ? /* @__PURE__ */ M(ye, { segment: e }, e.id) : /* @__PURE__ */ M(xe, {
|
|
650
654
|
segment: e,
|
|
651
655
|
category: e.category ?? "OTHER",
|
|
652
656
|
projectName: e.projectId ? Z.get(e.projectId) : void 0,
|
|
653
|
-
suggestion:
|
|
654
|
-
recategorizing:
|
|
655
|
-
onRecategorize:
|
|
656
|
-
projectActions:
|
|
657
|
+
suggestion: ce(e, Z),
|
|
658
|
+
recategorizing: V,
|
|
659
|
+
onRecategorize: Me,
|
|
660
|
+
projectActions: Re
|
|
657
661
|
}, e.id))
|
|
658
662
|
})
|
|
659
663
|
})
|
|
660
664
|
]
|
|
661
|
-
}), /* @__PURE__ */
|
|
665
|
+
}), /* @__PURE__ */ M(me, { children: C && /* @__PURE__ */ N("div", {
|
|
662
666
|
className: "flex items-center gap-2 rounded-lg border border-border-seam bg-bg-surface px-3 py-2 shadow-pop",
|
|
663
|
-
children: [/* @__PURE__ */
|
|
667
|
+
children: [/* @__PURE__ */ M(E, { className: "h-4 w-4 text-text-tertiary" }), /* @__PURE__ */ M("span", {
|
|
664
668
|
className: "text-sm font-medium text-text-primary",
|
|
665
|
-
children:
|
|
669
|
+
children: C.title || R[C.category ?? "OTHER"].label
|
|
666
670
|
})]
|
|
667
671
|
}) })]
|
|
668
|
-
}), /* @__PURE__ */
|
|
669
|
-
toasts:
|
|
670
|
-
onDismiss:
|
|
672
|
+
}), /* @__PURE__ */ M(ne, {
|
|
673
|
+
toasts: ae,
|
|
674
|
+
onDismiss: oe
|
|
671
675
|
})]
|
|
672
676
|
});
|
|
673
677
|
}
|
|
674
678
|
//#endregion
|
|
675
|
-
export {
|
|
679
|
+
export { K as TimelinePage };
|
|
676
680
|
|
|
677
681
|
//# sourceMappingURL=TimelinePage.js.map
|