@burdenoff/microfe-timecampus 2026.1203.2 → 2026.1204.1

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 (64) hide show
  1. package/dist/timecampus/components/EmptyState.d.ts +7 -0
  2. package/dist/timecampus/components/EmptyState.js +3 -2
  3. package/dist/timecampus/components/EmptyState.js.map +1 -1
  4. package/dist/timecampus/components/FilterBar.js +1 -0
  5. package/dist/timecampus/pages/admin/AdminPage.js +264 -264
  6. package/dist/timecampus/pages/admin/AdminPage.js.map +1 -1
  7. package/dist/timecampus/pages/application-usage/ApplicationUsagePage.js +78 -78
  8. package/dist/timecampus/pages/application-usage/ApplicationUsagePage.js.map +1 -1
  9. package/dist/timecampus/pages/dashboard/ServerReportExports.js +34 -34
  10. package/dist/timecampus/pages/dashboard/ServerReportExports.js.map +1 -1
  11. package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js +49 -48
  12. package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js.map +1 -1
  13. package/dist/timecampus/pages/extend/AppletDeveloperPage.js +107 -102
  14. package/dist/timecampus/pages/extend/AppletDeveloperPage.js.map +1 -1
  15. package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js +129 -124
  16. package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js.map +1 -1
  17. package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js +94 -94
  18. package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js.map +1 -1
  19. package/dist/timecampus/pages/extend/TimeTriggersPage.js +97 -97
  20. package/dist/timecampus/pages/extend/TimeTriggersPage.js.map +1 -1
  21. package/dist/timecampus/pages/focus/FocusProtectionPage.js +120 -120
  22. package/dist/timecampus/pages/focus/FocusProtectionPage.js.map +1 -1
  23. package/dist/timecampus/pages/geofencing/GeofencingPage.js +343 -343
  24. package/dist/timecampus/pages/geofencing/GeofencingPage.js.map +1 -1
  25. package/dist/timecampus/pages/lifetime/LifeTimelinePage.js +25 -25
  26. package/dist/timecampus/pages/lifetime/LifeTimelinePage.js.map +1 -1
  27. package/dist/timecampus/pages/lifetime/RecommendationsPage.js +296 -296
  28. package/dist/timecampus/pages/lifetime/RecommendationsPage.js.map +1 -1
  29. package/dist/timecampus/pages/lifetime/ValuesGoalsPage.js +189 -189
  30. package/dist/timecampus/pages/lifetime/ValuesGoalsPage.js.map +1 -1
  31. package/dist/timecampus/pages/meetings/ActionItemFormModal.js +47 -46
  32. package/dist/timecampus/pages/meetings/ActionItemFormModal.js.map +1 -1
  33. package/dist/timecampus/pages/meetings/MeetingDetailPage.js +206 -206
  34. package/dist/timecampus/pages/meetings/MeetingDetailPage.js.map +1 -1
  35. package/dist/timecampus/pages/meetings/MeetingFormModal.js +72 -71
  36. package/dist/timecampus/pages/meetings/MeetingFormModal.js.map +1 -1
  37. package/dist/timecampus/pages/meetings/ParticipantFormModal.js +32 -31
  38. package/dist/timecampus/pages/meetings/ParticipantFormModal.js.map +1 -1
  39. package/dist/timecampus/pages/pomodoro/PomodoroPage.js +34 -34
  40. package/dist/timecampus/pages/pomodoro/PomodoroPage.js.map +1 -1
  41. package/dist/timecampus/pages/projects/ProjectDetailPage.js +163 -163
  42. package/dist/timecampus/pages/projects/ProjectDetailPage.js.map +1 -1
  43. package/dist/timecampus/pages/projects/ProjectsPage.js +193 -192
  44. package/dist/timecampus/pages/projects/ProjectsPage.js.map +1 -1
  45. package/dist/timecampus/pages/projects/TasksPage.js +92 -92
  46. package/dist/timecampus/pages/projects/TasksPage.js.map +1 -1
  47. package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js +60 -60
  48. package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js.map +1 -1
  49. package/dist/timecampus/pages/settings/IdleDetectionCard.js +33 -33
  50. package/dist/timecampus/pages/settings/IdleDetectionCard.js.map +1 -1
  51. package/dist/timecampus/pages/settings/PrivacySettingsPage.js +32 -32
  52. package/dist/timecampus/pages/settings/PrivacySettingsPage.js.map +1 -1
  53. package/dist/timecampus/pages/time/TimeEntriesPage.js +163 -163
  54. package/dist/timecampus/pages/time/TimeEntriesPage.js.map +1 -1
  55. package/dist/timecampus/pages/time/TimeTrackingPage.js +32 -32
  56. package/dist/timecampus/pages/time/TimeTrackingPage.js.map +1 -1
  57. package/dist/timecampus/pages/time/TimerPage.js +84 -84
  58. package/dist/timecampus/pages/time/TimerPage.js.map +1 -1
  59. package/dist/timecampus/pages/timeline/TimelinePage.js +223 -223
  60. package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
  61. package/dist/timecampus/shared/hooks/useConfirmedAction.d.ts +10 -0
  62. package/dist/timecampus/shared/hooks/useConfirmedAction.js +14 -0
  63. package/dist/timecampus/shared/hooks/useConfirmedAction.js.map +1 -0
  64. package/package.json +2 -2
@@ -1,32 +1,32 @@
1
1
  import { PhoneViewLink as e } from "../mobile/MobileScreen.js";
2
2
  import { PageLayout as t } from "../../components/PageLayout.js";
3
3
  import { Modal as n } from "../../components/Modal.js";
4
- import { EmptyState as ee } from "../../components/EmptyState.js";
5
- import { LoadingSkeleton as r } from "../../components/LoadingSkeleton.js";
6
- import { useTimeCampusAnalytics as i } from "../../analytics/useTimeCampusAnalytics.js";
7
- import { StatusBadge as te } from "../../components/StatusBadge.js";
8
- import { useTr as a } from "../../shared/hooks/useTr.js";
9
- import { useTimeCampusNavigate as o } from "../../providers/TimeCampusProvider.js";
10
- import { formatTimerDuration as s, getInitials as c } from "../../utils/helpers.js";
11
- import { useTimeCampusStore as l } from "../../store/timecampusStore.js";
4
+ import { EmptyState as r } from "../../components/EmptyState.js";
5
+ import { LoadingSkeleton as i } from "../../components/LoadingSkeleton.js";
6
+ import { useTimeCampusAnalytics as a } from "../../analytics/useTimeCampusAnalytics.js";
7
+ import { StatusBadge as o } from "../../components/StatusBadge.js";
8
+ import { useTr as s } from "../../shared/hooks/useTr.js";
9
+ import { useTimeCampusNavigate as c } from "../../providers/TimeCampusProvider.js";
10
+ import { formatTimerDuration as l, getInitials as ee } from "../../utils/helpers.js";
11
+ import { useTimeCampusStore as te } from "../../store/timecampusStore.js";
12
12
  import "../../hooks/index.js";
13
- import { GetTimeEntryStatsDocument as u, ListRunningTimersDocument as d, ListTimeEntriesDocument as f, useDeleteTimeEntryMutation as p, useListProjectsQuery as ne, useListRunningTimersQuery as re, useStartTimerMutation as ie, useStopTimerMutation as ae } from "../../../generated/wspace-operations.js";
13
+ import { GetTimeEntryStatsDocument as ne, ListRunningTimersDocument as re, ListTimeEntriesDocument as ie, useDeleteTimeEntryMutation as u, useListProjectsQuery as d, useListRunningTimersQuery as f, useStartTimerMutation as p, useStopTimerMutation as m } from "../../../generated/wspace-operations.js";
14
14
  import "../../analytics/index.js";
15
- import { useEffect as m, useState as h } from "react";
16
- import { Play as g, RotateCcw as _, Square as v } from "lucide-react";
17
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
18
- import { GlassCard as S, NextSteps as C } from "@burdenoff/fe-libs/ui";
15
+ import { useEffect as h, useState as g } from "react";
16
+ import { Play as _, RotateCcw as v, Square as y } from "lucide-react";
17
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
18
+ import { GlassCard as C, NextSteps as ae, ThemedSelect as oe } from "@burdenoff/fe-libs/ui";
19
19
  // src/timecampus/pages/time/TimerPage.tsx
20
20
  function w() {
21
- let { activeTimer: w, tickTimer: T, syncTimerFromServer: E } = l(), D = o(), O = a(), [oe, k] = h(!1), [A, j] = h(""), [M, N] = h(""), [P, F] = h(!1), [I, L] = h(null), { data: R, loading: z, refetch: B } = re({ fetchPolicy: "cache-and-network" }), { data: V } = ne({ variables: { pagination: { limit: 50 } } }), H = V?.projects?.items ?? [], U = R?.runningTimers ?? [], W = U[0] ?? null, G = [
22
- { query: d },
21
+ let { activeTimer: w, tickTimer: T, syncTimerFromServer: E } = te(), D = c(), O = s(), [se, k] = g(!1), [A, j] = g(""), [M, N] = g(""), [P, F] = g(!1), [I, L] = g(null), { data: R, loading: z, refetch: B } = f({ fetchPolicy: "cache-and-network" }), { data: V } = d({ variables: { pagination: { limit: 50 } } }), H = V?.projects?.items ?? [], U = R?.runningTimers ?? [], W = U[0] ?? null, G = [
22
+ { query: re },
23
23
  {
24
- query: f,
24
+ query: ie,
25
25
  variables: { pagination: { limit: 50 } }
26
26
  },
27
- { query: u }
28
- ], [K, { loading: q, error: se }] = ie({ refetchQueries: G }), [J, { loading: Y }] = ae({ refetchQueries: G }), X = i(), [ce, { loading: Z }] = p({ refetchQueries: G });
29
- m(() => {
27
+ { query: ne }
28
+ ], [ce, { loading: K, error: le }] = p({ refetchQueries: G }), [q, { loading: J }] = m({ refetchQueries: G }), Y = a(), [X, { loading: Z }] = u({ refetchQueries: G });
29
+ h(() => {
30
30
  W ? E({
31
31
  timeEntryId: W.timeEntry.id,
32
32
  elapsedSeconds: W.elapsedSeconds,
@@ -38,44 +38,44 @@ function w() {
38
38
  W?.timeEntry.id,
39
39
  W?.elapsedSeconds,
40
40
  z
41
- ]), m(() => {
41
+ ]), h(() => {
42
42
  if (!w?.isRunning) return;
43
43
  let e = setInterval(() => T(), 1e3);
44
44
  return () => clearInterval(e);
45
45
  }, [w?.isRunning, T]);
46
- let le = async () => {
47
- let e = (await K({ variables: { input: {
46
+ let ue = async () => {
47
+ let e = (await ce({ variables: { input: {
48
48
  description: A.trim() || void 0,
49
49
  projectId: M || void 0,
50
50
  billable: P,
51
51
  source: "timer"
52
52
  } } })).data?.startTimer;
53
- e && X.timerStarted({
53
+ e && Y.timerStarted({
54
54
  timeEntryId: e.id,
55
55
  surface: "timer_page",
56
56
  hasProject: !!e.projectId
57
57
  }), k(!1), j(""), N(""), F(!1), await B();
58
58
  }, Q = async () => {
59
59
  if (!W) return;
60
- let e = (await J({ variables: { id: W.timeEntry.id } })).data?.stopTimer;
61
- e && X.timerStopped({
60
+ let e = (await q({ variables: { id: W.timeEntry.id } })).data?.stopTimer;
61
+ e && Y.timerStopped({
62
62
  timeEntryId: e.id,
63
63
  surface: "timer_page",
64
64
  hasProject: !!e.projectId
65
65
  }), await B();
66
- }, ue = async () => {
67
- I && (await J({ variables: { id: I.timeEntry.id } }), await ce({ variables: { id: I.timeEntry.id } }), L(null), await B());
66
+ }, de = async () => {
67
+ I && (await q({ variables: { id: I.timeEntry.id } }), await X({ variables: { id: I.timeEntry.id } }), L(null), await B());
68
68
  }, $ = !!W;
69
- return /* @__PURE__ */ x(t, {
69
+ return /* @__PURE__ */ S(t, {
70
70
  title: O("timecampus.timer.title", "Timer"),
71
71
  description: O("timecampus.timer.description", "Focus timer for deep work sessions"),
72
72
  purpose: O("timecampus.timer.purpose", "A single, distraction-free stopwatch for the task in front of you — start it when you begin focused work and it logs the session as a time entry you can attribute to a project later."),
73
73
  children: [
74
- /* @__PURE__ */ x("div", {
74
+ /* @__PURE__ */ S("div", {
75
75
  className: "mx-auto max-w-lg",
76
76
  children: [
77
- /* @__PURE__ */ b(e, { path: "/mobile/timer" }),
78
- /* @__PURE__ */ b(C, {
77
+ /* @__PURE__ */ x(e, { path: "/mobile/timer" }),
78
+ /* @__PURE__ */ x(ae, {
79
79
  storageKey: "timecampus-timer",
80
80
  className: "mb-6",
81
81
  steps: [
@@ -99,83 +99,83 @@ function w() {
99
99
  }
100
100
  ]
101
101
  }),
102
- /* @__PURE__ */ x(S, {
102
+ /* @__PURE__ */ S(C, {
103
103
  treatment: "glass",
104
104
  glow: !0,
105
105
  className: "p-6 text-center sm:p-8",
106
106
  children: [
107
- /* @__PURE__ */ b("p", {
107
+ /* @__PURE__ */ x("p", {
108
108
  className: "font-mono text-5xl font-bold tabular-nums text-text-primary sm:text-6xl",
109
- children: w ? s(w.seconds) : O("timecampus.timer.elapsedDefault", "00:00:00")
109
+ children: w ? l(w.seconds) : O("timecampus.timer.elapsedDefault", "00:00:00")
110
110
  }),
111
- w?.description && /* @__PURE__ */ b("p", {
111
+ w?.description && /* @__PURE__ */ x("p", {
112
112
  className: "mt-2 text-sm text-text-secondary",
113
113
  children: w.description
114
114
  }),
115
- /* @__PURE__ */ x("div", {
115
+ /* @__PURE__ */ S("div", {
116
116
  className: "mt-6 flex flex-wrap items-center justify-center gap-3",
117
- children: [$ ? /* @__PURE__ */ x("button", {
117
+ children: [$ ? /* @__PURE__ */ S("button", {
118
118
  onClick: Q,
119
- disabled: Y,
119
+ disabled: J,
120
120
  className: "inline-flex items-center gap-2 rounded-md bg-action-danger-bg px-6 py-3 text-sm font-medium text-action-primary-text hover:bg-action-danger-bg/90 disabled:opacity-50",
121
- children: [/* @__PURE__ */ b(v, { className: "h-4 w-4" }), Y ? O("timecampus.timer.stopping", "Stopping...") : O("timecampus.timer.stop", "Stop")]
122
- }) : /* @__PURE__ */ x("button", {
121
+ children: [/* @__PURE__ */ x(y, { className: "h-4 w-4" }), J ? O("timecampus.timer.stopping", "Stopping...") : O("timecampus.timer.stop", "Stop")]
122
+ }) : /* @__PURE__ */ S("button", {
123
123
  onClick: () => k(!0),
124
- disabled: q,
124
+ disabled: K,
125
125
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-6 py-3 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
126
- children: [/* @__PURE__ */ b(g, { className: "h-4 w-4" }), O("timecampus.timer.start", "Start")]
127
- }), /* @__PURE__ */ x("button", {
126
+ children: [/* @__PURE__ */ x(_, { className: "h-4 w-4" }), O("timecampus.timer.start", "Start")]
127
+ }), /* @__PURE__ */ S("button", {
128
128
  onClick: () => W && L(W),
129
129
  disabled: !$ || Z,
130
130
  className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50",
131
131
  title: O("timecampus.timer.resetTooltip", "Discard the running timer without saving"),
132
- children: [/* @__PURE__ */ b(_, { className: "h-4 w-4" }), O("timecampus.timer.reset", "Reset")]
132
+ children: [/* @__PURE__ */ x(v, { className: "h-4 w-4" }), O("timecampus.timer.reset", "Reset")]
133
133
  })]
134
134
  })
135
135
  ]
136
136
  }),
137
- /* @__PURE__ */ x(S, {
137
+ /* @__PURE__ */ S(C, {
138
138
  treatment: "glass",
139
139
  className: "mt-6 p-6",
140
- children: [/* @__PURE__ */ x("div", {
140
+ children: [/* @__PURE__ */ S("div", {
141
141
  className: "mb-4 flex items-center justify-between",
142
- children: [/* @__PURE__ */ b("h3", {
142
+ children: [/* @__PURE__ */ x("h3", {
143
143
  className: "text-sm font-semibold text-text-primary",
144
144
  children: O("timecampus.timer.runningTimers.title", "Running Timers")
145
- }), U.length > 0 && /* @__PURE__ */ b(te, {
145
+ }), U.length > 0 && /* @__PURE__ */ x(o, {
146
146
  label: O("timecampus.timer.runningTimers.active", "{{count}} active", { count: U.length }),
147
147
  variant: "success",
148
148
  dot: !0
149
149
  })]
150
- }), z && U.length === 0 ? /* @__PURE__ */ b(r, {
150
+ }), z && U.length === 0 ? /* @__PURE__ */ x(i, {
151
151
  variant: "list",
152
152
  count: 2
153
- }) : U.length === 0 ? /* @__PURE__ */ b(ee, {
153
+ }) : U.length === 0 ? /* @__PURE__ */ x(r, {
154
154
  illustration: "empty-sessions",
155
155
  title: O("timecampus.timer.runningTimers.emptyTitle", "No active timers on the server"),
156
156
  description: O("timecampus.timer.runningTimers.emptyDescription", "Timers you start sync here so you can pick them up on any device.")
157
- }) : /* @__PURE__ */ b("div", {
157
+ }) : /* @__PURE__ */ x("div", {
158
158
  className: "flex flex-col gap-2",
159
- children: U.map((e) => /* @__PURE__ */ x("div", {
159
+ children: U.map((e) => /* @__PURE__ */ S("div", {
160
160
  className: "flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface p-3",
161
161
  children: [
162
- /* @__PURE__ */ b("span", {
162
+ /* @__PURE__ */ x("span", {
163
163
  className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-xs font-semibold text-primary",
164
- children: c(e.timeEntry.project?.name ?? O("timecampus.timer.runningTimers.noProject", "No Project"))
164
+ children: ee(e.timeEntry.project?.name ?? O("timecampus.timer.runningTimers.noProject", "No Project"))
165
165
  }),
166
- /* @__PURE__ */ x("div", {
166
+ /* @__PURE__ */ S("div", {
167
167
  className: "min-w-0 flex-1",
168
- children: [/* @__PURE__ */ b("p", {
168
+ children: [/* @__PURE__ */ x("p", {
169
169
  className: "truncate text-sm font-medium text-text-primary",
170
170
  children: e.timeEntry.project?.name ?? O("timecampus.timer.runningTimers.noProject", "No Project")
171
- }), /* @__PURE__ */ b("p", {
171
+ }), /* @__PURE__ */ x("p", {
172
172
  className: "truncate text-xs text-text-secondary",
173
173
  children: e.timeEntry.description ?? O("timecampus.timer.runningTimers.noDescription", "No description")
174
174
  })]
175
175
  }),
176
- /* @__PURE__ */ b("p", {
176
+ /* @__PURE__ */ x("p", {
177
177
  className: "ms-2 shrink-0 font-mono text-sm font-medium text-text-primary",
178
- children: s(e.elapsedSeconds)
178
+ children: l(e.elapsedSeconds)
179
179
  })
180
180
  ]
181
181
  }, e.timeEntry.id))
@@ -183,55 +183,55 @@ function w() {
183
183
  })
184
184
  ]
185
185
  }),
186
- /* @__PURE__ */ x(n, {
187
- open: oe,
186
+ /* @__PURE__ */ S(n, {
187
+ open: se,
188
188
  onClose: () => k(!1),
189
189
  title: O("timecampus.timer.modal.startTitle", "Start a timer"),
190
190
  description: O("timecampus.timer.modal.startDescription", "Track the task you're working on right now."),
191
- footer: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("button", {
191
+ footer: /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("button", {
192
192
  onClick: () => k(!1),
193
193
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
194
194
  children: O("timecampus.timer.modal.cancel", "Cancel")
195
- }), /* @__PURE__ */ b("button", {
196
- onClick: le,
197
- disabled: q,
195
+ }), /* @__PURE__ */ x("button", {
196
+ onClick: ue,
197
+ disabled: K,
198
198
  className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
199
- children: q ? O("timecampus.timer.modal.starting", "Starting...") : O("timecampus.timer.modal.startTimer", "Start Timer")
199
+ children: K ? O("timecampus.timer.modal.starting", "Starting...") : O("timecampus.timer.modal.startTimer", "Start Timer")
200
200
  })] }),
201
- children: [se && /* @__PURE__ */ b("div", {
201
+ children: [le && /* @__PURE__ */ x("div", {
202
202
  className: "mb-4 rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text",
203
203
  children: O("timecampus.timer.modal.startError", "Failed to start the timer. Please try again.")
204
- }), /* @__PURE__ */ x("div", {
204
+ }), /* @__PURE__ */ S("div", {
205
205
  className: "space-y-4",
206
206
  children: [
207
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
207
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
208
208
  className: "block text-sm font-medium text-text-primary",
209
209
  children: O("timecampus.timer.modal.descriptionLabel", "What are you working on?")
210
- }), /* @__PURE__ */ b("input", {
210
+ }), /* @__PURE__ */ x("input", {
211
211
  type: "text",
212
212
  placeholder: O("timecampus.timer.modal.descriptionPlaceholder", "Description"),
213
213
  value: A,
214
214
  onChange: (e) => j(e.target.value),
215
215
  className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary"
216
216
  })] }),
217
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
217
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
218
218
  className: "block text-sm font-medium text-text-primary",
219
219
  children: O("timecampus.timer.modal.projectLabel", "Project")
220
- }), /* @__PURE__ */ x("select", {
220
+ }), /* @__PURE__ */ S(oe, {
221
221
  value: M,
222
222
  onChange: (e) => N(e.target.value),
223
223
  className: "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary",
224
- children: [/* @__PURE__ */ b("option", {
224
+ children: [/* @__PURE__ */ x("option", {
225
225
  value: "",
226
226
  children: O("timecampus.timer.modal.noProject", "No Project")
227
- }), H.map((e) => /* @__PURE__ */ b("option", {
227
+ }), H.map((e) => /* @__PURE__ */ x("option", {
228
228
  value: e.id,
229
229
  children: e.name
230
230
  }, e.id))]
231
231
  })] }),
232
- /* @__PURE__ */ x("label", {
232
+ /* @__PURE__ */ S("label", {
233
233
  className: "flex items-center gap-2 text-sm text-text-primary",
234
- children: [/* @__PURE__ */ b("input", {
234
+ children: [/* @__PURE__ */ x("input", {
235
235
  type: "checkbox",
236
236
  checked: P,
237
237
  onChange: (e) => F(e.target.checked),
@@ -241,27 +241,27 @@ function w() {
241
241
  ]
242
242
  })]
243
243
  }),
244
- /* @__PURE__ */ b(n, {
244
+ /* @__PURE__ */ x(n, {
245
245
  open: !!I,
246
246
  onClose: () => L(null),
247
247
  title: O("timecampus.timer.modal.discardTitle", "Discard running timer?"),
248
248
  description: O("timecampus.timer.modal.discardDescription", "This stops the timer and deletes the in-progress entry. It cannot be undone."),
249
- footer: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("button", {
249
+ footer: /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x("button", {
250
250
  onClick: () => L(null),
251
251
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
252
252
  children: O("timecampus.timer.modal.cancel", "Cancel")
253
- }), /* @__PURE__ */ b("button", {
254
- onClick: ue,
255
- disabled: Y || Z,
253
+ }), /* @__PURE__ */ x("button", {
254
+ onClick: de,
255
+ disabled: J || Z,
256
256
  className: "rounded-md bg-action-danger-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-danger-bg/90 disabled:opacity-50",
257
- children: Y || Z ? O("timecampus.timer.modal.discarding", "Discarding...") : O("timecampus.timer.modal.discard", "Discard")
257
+ children: J || Z ? O("timecampus.timer.modal.discarding", "Discarding...") : O("timecampus.timer.modal.discard", "Discard")
258
258
  })] }),
259
- children: /* @__PURE__ */ x("p", {
259
+ children: /* @__PURE__ */ S("p", {
260
260
  className: "text-sm text-text-secondary",
261
261
  children: [
262
262
  O("timecampus.timer.modal.discardMessagePrefix", "The timer for"),
263
263
  " ",
264
- /* @__PURE__ */ b("span", {
264
+ /* @__PURE__ */ x("span", {
265
265
  className: "font-medium text-text-primary",
266
266
  children: I?.timeEntry.project?.name ?? I?.timeEntry.description ?? O("timecampus.timer.modal.sessionFallback", "this session")
267
267
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"TimerPage.js","names":["_Fragment","TimerPage","useTimeCampusStore","navigate","useTimeCampusNavigate","t","useTr","startOpen","setStartOpen","useState","description","setDescription","projectId","setProjectId","billable","setBillable","resetTarget","setResetTarget","runningData","runningLoading","refetchRunning","useListRunningTimersQuery","projectsData","useListProjectsQuery","projects","runningTimers","serverTimer","refetchAll","ListRunningTimersDocument","ListTimeEntriesDocument","GetTimeEntryStatsDocument","startTimerMutation","starting","startError","useStartTimerMutation","stopTimerMutation","stopping","useStopTimerMutation","analytics","useTimeCampusAnalytics","deleteTimeEntry","deleting","useDeleteTimeEntryMutation","useEffect","syncTimerFromServer","activeTimer","interval","tickTimer","handleStart","started","handleStop","stopped","handleReset","isRunning","PageLayout","PhoneViewLink","NextSteps","GlassCard","formatTimerDuration","Square","Play","RotateCcw","StatusBadge","LoadingSkeleton","EmptyState","getInitials","timer","Modal","Fragment","project"],"sources":["../../../../src/timecampus/pages/time/TimerPage.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { PhoneViewLink } from \"../mobile/MobileScreen\";\nimport { Play, Square, RotateCcw } from \"lucide-react\";\nimport { GlassCard, NextSteps } from \"@burdenoff/fe-libs/ui\";\nimport { PageLayout } from \"../../components/PageLayout\";\nimport { Modal } from \"../../components/Modal\";\nimport { EmptyState } from \"../../components/EmptyState\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport { StatusBadge } from \"../../components/StatusBadge\";\nimport { useTimeCampusNavigate } from \"../../providers/TimeCampusProvider\";\nimport { formatTimerDuration, getInitials } from \"../../utils/helpers\";\nimport { useTimeCampusStore } from \"../../store/timecampusStore\";\nimport { useTr } from \"../../hooks\";\nimport {\n useListRunningTimersQuery,\n useStartTimerMutation,\n useStopTimerMutation,\n useDeleteTimeEntryMutation,\n useListProjectsQuery,\n ListRunningTimersDocument,\n ListTimeEntriesDocument,\n GetTimeEntryStatsDocument,\n type ListRunningTimersQuery,\n type ListProjectsQuery,\n} from \"@/generated/wspace-operations\";\nimport { useTimeCampusAnalytics } from \"../../analytics\";\n\ntype RunningTimerItem = ListRunningTimersQuery[\"runningTimers\"][number];\ntype ProjectOption = ListProjectsQuery[\"projects\"][\"items\"][number];\n\nexport function TimerPage() {\n const { activeTimer, tickTimer, syncTimerFromServer } = useTimeCampusStore();\n const navigate = useTimeCampusNavigate();\n const t = useTr();\n\n const [startOpen, setStartOpen] = useState(false);\n const [description, setDescription] = useState(\"\");\n const [projectId, setProjectId] = useState(\"\");\n const [billable, setBillable] = useState(false);\n const [resetTarget, setResetTarget] = useState<RunningTimerItem | null>(null);\n\n const {\n data: runningData,\n loading: runningLoading,\n refetch: refetchRunning,\n } = useListRunningTimersQuery({ fetchPolicy: \"cache-and-network\" });\n\n const { data: projectsData } = useListProjectsQuery({\n variables: { pagination: { limit: 50 } },\n });\n const projects: ProjectOption[] = projectsData?.projects?.items ?? [];\n\n const runningTimers = runningData?.runningTimers ?? [];\n const serverTimer = runningTimers[0] ?? null;\n\n const refetchAll = [\n { query: ListRunningTimersDocument },\n {\n query: ListTimeEntriesDocument,\n variables: { pagination: { limit: 50 } },\n },\n { query: GetTimeEntryStatsDocument },\n ];\n\n const [startTimerMutation, { loading: starting, error: startError }] =\n useStartTimerMutation({ refetchQueries: refetchAll });\n const [stopTimerMutation, { loading: stopping }] = useStopTimerMutation({\n refetchQueries: refetchAll,\n });\n const analytics = useTimeCampusAnalytics();\n const [deleteTimeEntry, { loading: deleting }] = useDeleteTimeEntryMutation({\n refetchQueries: refetchAll,\n });\n\n // Backend is the source of truth for whether a timer is running — mirror the\n // server running timer into the local display store whenever it changes.\n useEffect(() => {\n if (serverTimer) {\n syncTimerFromServer({\n timeEntryId: serverTimer.timeEntry.id,\n elapsedSeconds: serverTimer.elapsedSeconds,\n projectId: serverTimer.timeEntry.projectId ?? undefined,\n taskId: serverTimer.timeEntry.taskId ?? undefined,\n description: serverTimer.timeEntry.description ?? undefined,\n });\n } else if (!runningLoading) {\n syncTimerFromServer(null);\n }\n // Only re-sync when the server's running timer identity/elapsed changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [serverTimer?.timeEntry.id, serverTimer?.elapsedSeconds, runningLoading]);\n\n // Local ticking display for the live seconds counter.\n useEffect(() => {\n if (!activeTimer?.isRunning) return;\n const interval = setInterval(() => tickTimer(), 1000);\n return () => clearInterval(interval);\n }, [activeTimer?.isRunning, tickTimer]);\n\n const handleStart = async () => {\n const result = await startTimerMutation({\n variables: {\n input: {\n description: description.trim() || undefined,\n projectId: projectId || undefined,\n billable,\n source: \"timer\",\n },\n },\n });\n const started = result.data?.startTimer;\n if (started) {\n analytics.timerStarted({\n timeEntryId: started.id,\n surface: \"timer_page\",\n hasProject: Boolean(started.projectId),\n });\n }\n setStartOpen(false);\n setDescription(\"\");\n setProjectId(\"\");\n setBillable(false);\n await refetchRunning();\n };\n\n const handleStop = async () => {\n if (!serverTimer) return;\n const result = await stopTimerMutation({\n variables: { id: serverTimer.timeEntry.id },\n });\n const stopped = result.data?.stopTimer;\n if (stopped) {\n analytics.timerStopped({\n timeEntryId: stopped.id,\n surface: \"timer_page\",\n hasProject: Boolean(stopped.projectId),\n });\n }\n await refetchRunning();\n };\n\n const handleReset = async () => {\n if (!resetTarget) return;\n // Discard the in-progress session: stop it, then delete the entry.\n await stopTimerMutation({ variables: { id: resetTarget.timeEntry.id } });\n await deleteTimeEntry({ variables: { id: resetTarget.timeEntry.id } });\n setResetTarget(null);\n await refetchRunning();\n };\n\n const isRunning = Boolean(serverTimer);\n\n return (\n <PageLayout\n title={t(\"timecampus.timer.title\", \"Timer\")}\n description={t(\n \"timecampus.timer.description\",\n \"Focus timer for deep work sessions\",\n )}\n purpose={t(\n \"timecampus.timer.purpose\",\n \"A single, distraction-free stopwatch for the task in front of you — start it when you begin focused work and it logs the session as a time entry you can attribute to a project later.\",\n )}\n >\n <div className=\"mx-auto max-w-lg\">\n <PhoneViewLink path=\"/mobile/timer\" />\n <NextSteps\n storageKey=\"timecampus-timer\"\n className=\"mb-6\"\n steps={[\n {\n id: \"start\",\n label: isRunning\n ? t(\n \"timecampus.timer.nextSteps.stopRunning\",\n \"Stop the running timer\",\n )\n : t(\"timecampus.timer.nextSteps.start\", \"Start the timer\"),\n description: isRunning\n ? t(\n \"timecampus.timer.nextSteps.stopDescription\",\n \"End this session and save it as a time entry.\",\n )\n : t(\n \"timecampus.timer.nextSteps.startDescription\",\n \"Begin tracking the task you're working on right now.\",\n ),\n onClick: () => (isRunning ? handleStop() : setStartOpen(true)),\n },\n {\n id: \"assign-project\",\n label: t(\n \"timecampus.timer.nextSteps.assignProject\",\n \"Assign work to a project\",\n ),\n description: t(\n \"timecampus.timer.nextSteps.assignDescription\",\n \"Pick a project so this time bills correctly.\",\n ),\n onClick: () => navigate(\"/projects\"),\n },\n {\n id: \"review-entries\",\n label: t(\n \"timecampus.timer.nextSteps.review\",\n \"Review your time entries\",\n ),\n description: t(\n \"timecampus.timer.nextSteps.reviewDescription\",\n \"Check and tidy everything you've logged.\",\n ),\n onClick: () => navigate(\"/time/entries\"),\n },\n ]}\n />\n <GlassCard treatment=\"glass\" glow className=\"p-6 text-center sm:p-8\">\n <p className=\"font-mono text-5xl font-bold tabular-nums text-text-primary sm:text-6xl\">\n {activeTimer\n ? formatTimerDuration(activeTimer.seconds)\n : t(\"timecampus.timer.elapsedDefault\", \"00:00:00\")}\n </p>\n {activeTimer?.description && (\n <p className=\"mt-2 text-sm text-text-secondary\">\n {activeTimer.description}\n </p>\n )}\n <div className=\"mt-6 flex flex-wrap items-center justify-center gap-3\">\n {isRunning ? (\n <button\n onClick={handleStop}\n disabled={stopping}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-danger-bg px-6 py-3 text-sm font-medium text-action-primary-text hover:bg-action-danger-bg/90 disabled:opacity-50\"\n >\n <Square className=\"h-4 w-4\" />\n {stopping\n ? t(\"timecampus.timer.stopping\", \"Stopping...\")\n : t(\"timecampus.timer.stop\", \"Stop\")}\n </button>\n ) : (\n <button\n onClick={() => setStartOpen(true)}\n disabled={starting}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-6 py-3 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50\"\n >\n <Play className=\"h-4 w-4\" />\n {t(\"timecampus.timer.start\", \"Start\")}\n </button>\n )}\n <button\n onClick={() => serverTimer && setResetTarget(serverTimer)}\n disabled={!isRunning || deleting}\n className=\"inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50\"\n title={t(\n \"timecampus.timer.resetTooltip\",\n \"Discard the running timer without saving\",\n )}\n >\n <RotateCcw className=\"h-4 w-4\" />\n {t(\"timecampus.timer.reset\", \"Reset\")}\n </button>\n </div>\n </GlassCard>\n\n {/* Server-side running timers */}\n <GlassCard treatment=\"glass\" className=\"mt-6 p-6\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t(\"timecampus.timer.runningTimers.title\", \"Running Timers\")}\n </h3>\n {runningTimers.length > 0 && (\n <StatusBadge\n label={t(\n \"timecampus.timer.runningTimers.active\",\n \"{{count}} active\",\n { count: runningTimers.length },\n )}\n variant=\"success\"\n dot\n />\n )}\n </div>\n {runningLoading && runningTimers.length === 0 ? (\n <LoadingSkeleton variant=\"list\" count={2} />\n ) : runningTimers.length === 0 ? (\n <EmptyState\n illustration=\"empty-sessions\"\n title={t(\n \"timecampus.timer.runningTimers.emptyTitle\",\n \"No active timers on the server\",\n )}\n description={t(\n \"timecampus.timer.runningTimers.emptyDescription\",\n \"Timers you start sync here so you can pick them up on any device.\",\n )}\n />\n ) : (\n <div className=\"flex flex-col gap-2\">\n {runningTimers.map((timer: RunningTimerItem) => (\n <div\n key={timer.timeEntry.id}\n className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface p-3\"\n >\n <span className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-xs font-semibold text-primary\">\n {getInitials(\n timer.timeEntry.project?.name ??\n t(\n \"timecampus.timer.runningTimers.noProject\",\n \"No Project\",\n ),\n )}\n </span>\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {timer.timeEntry.project?.name ??\n t(\n \"timecampus.timer.runningTimers.noProject\",\n \"No Project\",\n )}\n </p>\n <p className=\"truncate text-xs text-text-secondary\">\n {timer.timeEntry.description ??\n t(\n \"timecampus.timer.runningTimers.noDescription\",\n \"No description\",\n )}\n </p>\n </div>\n <p className=\"ms-2 shrink-0 font-mono text-sm font-medium text-text-primary\">\n {formatTimerDuration(timer.elapsedSeconds)}\n </p>\n </div>\n ))}\n </div>\n )}\n </GlassCard>\n </div>\n\n {/* Start timer modal */}\n <Modal\n open={startOpen}\n onClose={() => setStartOpen(false)}\n title={t(\"timecampus.timer.modal.startTitle\", \"Start a timer\")}\n description={t(\n \"timecampus.timer.modal.startDescription\",\n \"Track the task you're working on right now.\",\n )}\n footer={\n <>\n <button\n onClick={() => setStartOpen(false)}\n className=\"rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50\"\n >\n {t(\"timecampus.timer.modal.cancel\", \"Cancel\")}\n </button>\n <button\n onClick={handleStart}\n disabled={starting}\n className=\"rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50\"\n >\n {starting\n ? t(\"timecampus.timer.modal.starting\", \"Starting...\")\n : t(\"timecampus.timer.modal.startTimer\", \"Start Timer\")}\n </button>\n </>\n }\n >\n {startError && (\n <div className=\"mb-4 rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text\">\n {t(\n \"timecampus.timer.modal.startError\",\n \"Failed to start the timer. Please try again.\",\n )}\n </div>\n )}\n <div className=\"space-y-4\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary\">\n {t(\n \"timecampus.timer.modal.descriptionLabel\",\n \"What are you working on?\",\n )}\n </label>\n <input\n type=\"text\"\n placeholder={t(\n \"timecampus.timer.modal.descriptionPlaceholder\",\n \"Description\",\n )}\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n className=\"mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary\"\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary\">\n {t(\"timecampus.timer.modal.projectLabel\", \"Project\")}\n </label>\n <select\n value={projectId}\n onChange={(e) => setProjectId(e.target.value)}\n className=\"mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n >\n <option value=\"\">\n {t(\"timecampus.timer.modal.noProject\", \"No Project\")}\n </option>\n {projects.map((project) => (\n <option key={project.id} value={project.id}>\n {project.name}\n </option>\n ))}\n </select>\n </div>\n <label className=\"flex items-center gap-2 text-sm text-text-primary\">\n <input\n type=\"checkbox\"\n checked={billable}\n onChange={(e) => setBillable(e.target.checked)}\n className=\"h-4 w-4 rounded border-border-subtle\"\n />\n {t(\"timecampus.timer.modal.billable\", \"Billable\")}\n </label>\n </div>\n </Modal>\n\n {/* Reset / discard confirm modal */}\n <Modal\n open={Boolean(resetTarget)}\n onClose={() => setResetTarget(null)}\n title={t(\n \"timecampus.timer.modal.discardTitle\",\n \"Discard running timer?\",\n )}\n description={t(\n \"timecampus.timer.modal.discardDescription\",\n \"This stops the timer and deletes the in-progress entry. It cannot be undone.\",\n )}\n footer={\n <>\n <button\n onClick={() => setResetTarget(null)}\n className=\"rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50\"\n >\n {t(\"timecampus.timer.modal.cancel\", \"Cancel\")}\n </button>\n <button\n onClick={handleReset}\n disabled={stopping || deleting}\n className=\"rounded-md bg-action-danger-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-danger-bg/90 disabled:opacity-50\"\n >\n {stopping || deleting\n ? t(\"timecampus.timer.modal.discarding\", \"Discarding...\")\n : t(\"timecampus.timer.modal.discard\", \"Discard\")}\n </button>\n </>\n }\n >\n <p className=\"text-sm text-text-secondary\">\n {t(\"timecampus.timer.modal.discardMessagePrefix\", \"The timer for\")}{\" \"}\n <span className=\"font-medium text-text-primary\">\n {resetTarget?.timeEntry.project?.name ??\n resetTarget?.timeEntry.description ??\n t(\"timecampus.timer.modal.sessionFallback\", \"this session\")}\n </span>{\" \"}\n {t(\n \"timecampus.timer.modal.discardMessageSuffix\",\n \"will be discarded.\",\n )}\n </p>\n </Modal>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,SAAgBC,IAAY;CAC1B,IAAM,EAAE,gBAAa,cAAW,2BAAwBC,EAAmB,GACrEC,IAAWC,EAAsB,GACjCC,IAAIC,EAAM,GAEV,CAACC,IAAWC,KAAgBC,EAAS,EAAK,GAC1C,CAACC,GAAaC,KAAkBF,EAAS,EAAE,GAC3C,CAACG,GAAWC,KAAgBJ,EAAS,EAAE,GACvC,CAACK,GAAUC,KAAeN,EAAS,EAAK,GACxC,CAACO,GAAaC,KAAkBR,EAAkC,IAAI,GAEtE,EACJ,MAAMS,GACN,SAASC,GACT,SAASC,MACPC,GAA0B,EAAE,aAAa,oBAAoB,CAAC,GAE5D,EAAE,MAAMC,MAAiBC,GAAqB,EAClD,WAAW,EAAE,YAAY,EAAE,OAAO,GAAG,EAAE,EACzC,CAAC,GACKC,IAA4BF,GAAc,UAAU,SAAS,CAAC,G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OAAOZ,EACL,uCACA,wBACF;IACA,aAAaA,EACX,6CACA,8EACF;IACA,QACE,kBAAAL,GAAA,EAAA,UAAA,CACE,kBAAC,UAAD;KACE,eAAeiB,EAAe,IAAI;KAClC,WAAU;KAET,UAAAZ,EAAE,iCAAiC,QAAQ;IACtC,CAAA,GACR,kBAAC,UAAD;KACE,SAAS+C;KACT,UAAUhB,KAAYK;KACtB,WAAU;KAET,UAAAL,KAAYK,IACTpC,EAAE,qCAAqC,eAAe,IACtDA,EAAE,kCAAkC,SAAS;IAC3C,CAAA,CACR,EAAA,CAAA;IAGJ,UAAA,kBAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MACGA,EAAE,+CAA+C,eAAe;MAAG;MACpE,kBAAC,QAAD;OAAM,WAAU;OACb,UAAAW,GAAa,UAAU,SAAS,QAC/BA,GAAa,UAAU,eACvBX,EAAE,0CAA0C,cAAc;MACxD,CAAA;MAAE;MACPA,EACC,+CACA,oBACF;KACC;;GACE,CAAA;EACG;;AAEhB"}
1
+ {"version":3,"file":"TimerPage.js","names":["_Fragment","TimerPage","useTimeCampusStore","navigate","useTimeCampusNavigate","t","useTr","startOpen","setStartOpen","useState","description","setDescription","projectId","setProjectId","billable","setBillable","resetTarget","setResetTarget","runningData","runningLoading","refetchRunning","useListRunningTimersQuery","projectsData","useListProjectsQuery","projects","runningTimers","serverTimer","refetchAll","ListRunningTimersDocument","ListTimeEntriesDocument","GetTimeEntryStatsDocument","startTimerMutation","starting","startError","useStartTimerMutation","stopTimerMutation","stopping","useStopTimerMutation","analytics","useTimeCampusAnalytics","deleteTimeEntry","deleting","useDeleteTimeEntryMutation","useEffect","syncTimerFromServer","activeTimer","interval","tickTimer","handleStart","started","handleStop","stopped","handleReset","isRunning","PageLayout","PhoneViewLink","NextSteps","GlassCard","formatTimerDuration","Square","Play","RotateCcw","StatusBadge","LoadingSkeleton","EmptyState","getInitials","timer","Modal","Fragment","ThemedSelect","project"],"sources":["../../../../src/timecampus/pages/time/TimerPage.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { PhoneViewLink } from \"../mobile/MobileScreen\";\nimport { Play, Square, RotateCcw } from \"lucide-react\";\nimport { GlassCard, NextSteps, ThemedSelect } from \"@burdenoff/fe-libs/ui\";\nimport { PageLayout } from \"../../components/PageLayout\";\nimport { Modal } from \"../../components/Modal\";\nimport { EmptyState } from \"../../components/EmptyState\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport { StatusBadge } from \"../../components/StatusBadge\";\nimport { useTimeCampusNavigate } from \"../../providers/TimeCampusProvider\";\nimport { formatTimerDuration, getInitials } from \"../../utils/helpers\";\nimport { useTimeCampusStore } from \"../../store/timecampusStore\";\nimport { useTr } from \"../../hooks\";\nimport {\n useListRunningTimersQuery,\n useStartTimerMutation,\n useStopTimerMutation,\n useDeleteTimeEntryMutation,\n useListProjectsQuery,\n ListRunningTimersDocument,\n ListTimeEntriesDocument,\n GetTimeEntryStatsDocument,\n type ListRunningTimersQuery,\n type ListProjectsQuery,\n} from \"@/generated/wspace-operations\";\nimport { useTimeCampusAnalytics } from \"../../analytics\";\n\ntype RunningTimerItem = ListRunningTimersQuery[\"runningTimers\"][number];\ntype ProjectOption = ListProjectsQuery[\"projects\"][\"items\"][number];\n\nexport function TimerPage() {\n const { activeTimer, tickTimer, syncTimerFromServer } = useTimeCampusStore();\n const navigate = useTimeCampusNavigate();\n const t = useTr();\n\n const [startOpen, setStartOpen] = useState(false);\n const [description, setDescription] = useState(\"\");\n const [projectId, setProjectId] = useState(\"\");\n const [billable, setBillable] = useState(false);\n const [resetTarget, setResetTarget] = useState<RunningTimerItem | null>(null);\n\n const {\n data: runningData,\n loading: runningLoading,\n refetch: refetchRunning,\n } = useListRunningTimersQuery({ fetchPolicy: \"cache-and-network\" });\n\n const { data: projectsData } = useListProjectsQuery({\n variables: { pagination: { limit: 50 } },\n });\n const projects: ProjectOption[] = projectsData?.projects?.items ?? [];\n\n const runningTimers = runningData?.runningTimers ?? [];\n const serverTimer = runningTimers[0] ?? null;\n\n const refetchAll = [\n { query: ListRunningTimersDocument },\n {\n query: ListTimeEntriesDocument,\n variables: { pagination: { limit: 50 } },\n },\n { query: GetTimeEntryStatsDocument },\n ];\n\n const [startTimerMutation, { loading: starting, error: startError }] =\n useStartTimerMutation({ refetchQueries: refetchAll });\n const [stopTimerMutation, { loading: stopping }] = useStopTimerMutation({\n refetchQueries: refetchAll,\n });\n const analytics = useTimeCampusAnalytics();\n const [deleteTimeEntry, { loading: deleting }] = useDeleteTimeEntryMutation({\n refetchQueries: refetchAll,\n });\n\n // Backend is the source of truth for whether a timer is running — mirror the\n // server running timer into the local display store whenever it changes.\n useEffect(() => {\n if (serverTimer) {\n syncTimerFromServer({\n timeEntryId: serverTimer.timeEntry.id,\n elapsedSeconds: serverTimer.elapsedSeconds,\n projectId: serverTimer.timeEntry.projectId ?? undefined,\n taskId: serverTimer.timeEntry.taskId ?? undefined,\n description: serverTimer.timeEntry.description ?? undefined,\n });\n } else if (!runningLoading) {\n syncTimerFromServer(null);\n }\n // Only re-sync when the server's running timer identity/elapsed changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [serverTimer?.timeEntry.id, serverTimer?.elapsedSeconds, runningLoading]);\n\n // Local ticking display for the live seconds counter.\n useEffect(() => {\n if (!activeTimer?.isRunning) return;\n const interval = setInterval(() => tickTimer(), 1000);\n return () => clearInterval(interval);\n }, [activeTimer?.isRunning, tickTimer]);\n\n const handleStart = async () => {\n const result = await startTimerMutation({\n variables: {\n input: {\n description: description.trim() || undefined,\n projectId: projectId || undefined,\n billable,\n source: \"timer\",\n },\n },\n });\n const started = result.data?.startTimer;\n if (started) {\n analytics.timerStarted({\n timeEntryId: started.id,\n surface: \"timer_page\",\n hasProject: Boolean(started.projectId),\n });\n }\n setStartOpen(false);\n setDescription(\"\");\n setProjectId(\"\");\n setBillable(false);\n await refetchRunning();\n };\n\n const handleStop = async () => {\n if (!serverTimer) return;\n const result = await stopTimerMutation({\n variables: { id: serverTimer.timeEntry.id },\n });\n const stopped = result.data?.stopTimer;\n if (stopped) {\n analytics.timerStopped({\n timeEntryId: stopped.id,\n surface: \"timer_page\",\n hasProject: Boolean(stopped.projectId),\n });\n }\n await refetchRunning();\n };\n\n const handleReset = async () => {\n if (!resetTarget) return;\n // Discard the in-progress session: stop it, then delete the entry.\n await stopTimerMutation({ variables: { id: resetTarget.timeEntry.id } });\n await deleteTimeEntry({ variables: { id: resetTarget.timeEntry.id } });\n setResetTarget(null);\n await refetchRunning();\n };\n\n const isRunning = Boolean(serverTimer);\n\n return (\n <PageLayout\n title={t(\"timecampus.timer.title\", \"Timer\")}\n description={t(\n \"timecampus.timer.description\",\n \"Focus timer for deep work sessions\",\n )}\n purpose={t(\n \"timecampus.timer.purpose\",\n \"A single, distraction-free stopwatch for the task in front of you — start it when you begin focused work and it logs the session as a time entry you can attribute to a project later.\",\n )}\n >\n <div className=\"mx-auto max-w-lg\">\n <PhoneViewLink path=\"/mobile/timer\" />\n <NextSteps\n storageKey=\"timecampus-timer\"\n className=\"mb-6\"\n steps={[\n {\n id: \"start\",\n label: isRunning\n ? t(\n \"timecampus.timer.nextSteps.stopRunning\",\n \"Stop the running timer\",\n )\n : t(\"timecampus.timer.nextSteps.start\", \"Start the timer\"),\n description: isRunning\n ? t(\n \"timecampus.timer.nextSteps.stopDescription\",\n \"End this session and save it as a time entry.\",\n )\n : t(\n \"timecampus.timer.nextSteps.startDescription\",\n \"Begin tracking the task you're working on right now.\",\n ),\n onClick: () => (isRunning ? handleStop() : setStartOpen(true)),\n },\n {\n id: \"assign-project\",\n label: t(\n \"timecampus.timer.nextSteps.assignProject\",\n \"Assign work to a project\",\n ),\n description: t(\n \"timecampus.timer.nextSteps.assignDescription\",\n \"Pick a project so this time bills correctly.\",\n ),\n onClick: () => navigate(\"/projects\"),\n },\n {\n id: \"review-entries\",\n label: t(\n \"timecampus.timer.nextSteps.review\",\n \"Review your time entries\",\n ),\n description: t(\n \"timecampus.timer.nextSteps.reviewDescription\",\n \"Check and tidy everything you've logged.\",\n ),\n onClick: () => navigate(\"/time/entries\"),\n },\n ]}\n />\n <GlassCard treatment=\"glass\" glow className=\"p-6 text-center sm:p-8\">\n <p className=\"font-mono text-5xl font-bold tabular-nums text-text-primary sm:text-6xl\">\n {activeTimer\n ? formatTimerDuration(activeTimer.seconds)\n : t(\"timecampus.timer.elapsedDefault\", \"00:00:00\")}\n </p>\n {activeTimer?.description && (\n <p className=\"mt-2 text-sm text-text-secondary\">\n {activeTimer.description}\n </p>\n )}\n <div className=\"mt-6 flex flex-wrap items-center justify-center gap-3\">\n {isRunning ? (\n <button\n onClick={handleStop}\n disabled={stopping}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-danger-bg px-6 py-3 text-sm font-medium text-action-primary-text hover:bg-action-danger-bg/90 disabled:opacity-50\"\n >\n <Square className=\"h-4 w-4\" />\n {stopping\n ? t(\"timecampus.timer.stopping\", \"Stopping...\")\n : t(\"timecampus.timer.stop\", \"Stop\")}\n </button>\n ) : (\n <button\n onClick={() => setStartOpen(true)}\n disabled={starting}\n className=\"inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-6 py-3 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50\"\n >\n <Play className=\"h-4 w-4\" />\n {t(\"timecampus.timer.start\", \"Start\")}\n </button>\n )}\n <button\n onClick={() => serverTimer && setResetTarget(serverTimer)}\n disabled={!isRunning || deleting}\n className=\"inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50\"\n title={t(\n \"timecampus.timer.resetTooltip\",\n \"Discard the running timer without saving\",\n )}\n >\n <RotateCcw className=\"h-4 w-4\" />\n {t(\"timecampus.timer.reset\", \"Reset\")}\n </button>\n </div>\n </GlassCard>\n\n {/* Server-side running timers */}\n <GlassCard treatment=\"glass\" className=\"mt-6 p-6\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h3 className=\"text-sm font-semibold text-text-primary\">\n {t(\"timecampus.timer.runningTimers.title\", \"Running Timers\")}\n </h3>\n {runningTimers.length > 0 && (\n <StatusBadge\n label={t(\n \"timecampus.timer.runningTimers.active\",\n \"{{count}} active\",\n { count: runningTimers.length },\n )}\n variant=\"success\"\n dot\n />\n )}\n </div>\n {runningLoading && runningTimers.length === 0 ? (\n <LoadingSkeleton variant=\"list\" count={2} />\n ) : runningTimers.length === 0 ? (\n <EmptyState\n illustration=\"empty-sessions\"\n title={t(\n \"timecampus.timer.runningTimers.emptyTitle\",\n \"No active timers on the server\",\n )}\n description={t(\n \"timecampus.timer.runningTimers.emptyDescription\",\n \"Timers you start sync here so you can pick them up on any device.\",\n )}\n />\n ) : (\n <div className=\"flex flex-col gap-2\">\n {runningTimers.map((timer: RunningTimerItem) => (\n <div\n key={timer.timeEntry.id}\n className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface p-3\"\n >\n <span className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-xs font-semibold text-primary\">\n {getInitials(\n timer.timeEntry.project?.name ??\n t(\n \"timecampus.timer.runningTimers.noProject\",\n \"No Project\",\n ),\n )}\n </span>\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {timer.timeEntry.project?.name ??\n t(\n \"timecampus.timer.runningTimers.noProject\",\n \"No Project\",\n )}\n </p>\n <p className=\"truncate text-xs text-text-secondary\">\n {timer.timeEntry.description ??\n t(\n \"timecampus.timer.runningTimers.noDescription\",\n \"No description\",\n )}\n </p>\n </div>\n <p className=\"ms-2 shrink-0 font-mono text-sm font-medium text-text-primary\">\n {formatTimerDuration(timer.elapsedSeconds)}\n </p>\n </div>\n ))}\n </div>\n )}\n </GlassCard>\n </div>\n\n {/* Start timer modal */}\n <Modal\n open={startOpen}\n onClose={() => setStartOpen(false)}\n title={t(\"timecampus.timer.modal.startTitle\", \"Start a timer\")}\n description={t(\n \"timecampus.timer.modal.startDescription\",\n \"Track the task you're working on right now.\",\n )}\n footer={\n <>\n <button\n onClick={() => setStartOpen(false)}\n className=\"rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50\"\n >\n {t(\"timecampus.timer.modal.cancel\", \"Cancel\")}\n </button>\n <button\n onClick={handleStart}\n disabled={starting}\n className=\"rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50\"\n >\n {starting\n ? t(\"timecampus.timer.modal.starting\", \"Starting...\")\n : t(\"timecampus.timer.modal.startTimer\", \"Start Timer\")}\n </button>\n </>\n }\n >\n {startError && (\n <div className=\"mb-4 rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text\">\n {t(\n \"timecampus.timer.modal.startError\",\n \"Failed to start the timer. Please try again.\",\n )}\n </div>\n )}\n <div className=\"space-y-4\">\n <div>\n <label className=\"block text-sm font-medium text-text-primary\">\n {t(\n \"timecampus.timer.modal.descriptionLabel\",\n \"What are you working on?\",\n )}\n </label>\n <input\n type=\"text\"\n placeholder={t(\n \"timecampus.timer.modal.descriptionPlaceholder\",\n \"Description\",\n )}\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n className=\"mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary\"\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium text-text-primary\">\n {t(\"timecampus.timer.modal.projectLabel\", \"Project\")}\n </label>\n <ThemedSelect\n value={projectId}\n onChange={(e) => setProjectId(e.target.value)}\n className=\"mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary\"\n >\n <option value=\"\">\n {t(\"timecampus.timer.modal.noProject\", \"No Project\")}\n </option>\n {projects.map((project) => (\n <option key={project.id} value={project.id}>\n {project.name}\n </option>\n ))}\n </ThemedSelect>\n </div>\n <label className=\"flex items-center gap-2 text-sm text-text-primary\">\n <input\n type=\"checkbox\"\n checked={billable}\n onChange={(e) => setBillable(e.target.checked)}\n className=\"h-4 w-4 rounded border-border-subtle\"\n />\n {t(\"timecampus.timer.modal.billable\", \"Billable\")}\n </label>\n </div>\n </Modal>\n\n {/* Reset / discard confirm modal */}\n <Modal\n open={Boolean(resetTarget)}\n onClose={() => setResetTarget(null)}\n title={t(\n \"timecampus.timer.modal.discardTitle\",\n \"Discard running timer?\",\n )}\n description={t(\n \"timecampus.timer.modal.discardDescription\",\n \"This stops the timer and deletes the in-progress entry. It cannot be undone.\",\n )}\n footer={\n <>\n <button\n onClick={() => setResetTarget(null)}\n className=\"rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50\"\n >\n {t(\"timecampus.timer.modal.cancel\", \"Cancel\")}\n </button>\n <button\n onClick={handleReset}\n disabled={stopping || deleting}\n className=\"rounded-md bg-action-danger-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-danger-bg/90 disabled:opacity-50\"\n >\n {stopping || deleting\n ? t(\"timecampus.timer.modal.discarding\", \"Discarding...\")\n : t(\"timecampus.timer.modal.discard\", \"Discard\")}\n </button>\n </>\n }\n >\n <p className=\"text-sm text-text-secondary\">\n {t(\"timecampus.timer.modal.discardMessagePrefix\", \"The timer for\")}{\" \"}\n <span className=\"font-medium text-text-primary\">\n {resetTarget?.timeEntry.project?.name ??\n resetTarget?.timeEntry.description ??\n t(\"timecampus.timer.modal.sessionFallback\", \"this session\")}\n </span>{\" \"}\n {t(\n \"timecampus.timer.modal.discardMessageSuffix\",\n \"will be discarded.\",\n )}\n </p>\n </Modal>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,SAAgBC,IAAY;CAC1B,IAAM,EAAE,gBAAa,cAAW,2BAAwBC,GAAmB,GACrEC,IAAWC,EAAsB,GACjCC,IAAIC,EAAM,GAEV,CAACC,IAAWC,KAAgBC,EAAS,EAAK,GAC1C,CAAC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