@burdenoff/microfe-timecampus 2026.1203.2 → 2026.1205.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.
- package/dist/timecampus/components/EmptyState.d.ts +7 -0
- package/dist/timecampus/components/EmptyState.js +3 -2
- package/dist/timecampus/components/EmptyState.js.map +1 -1
- package/dist/timecampus/components/FilterBar.js +1 -0
- package/dist/timecampus/pages/admin/AdminPage.js +264 -264
- package/dist/timecampus/pages/admin/AdminPage.js.map +1 -1
- package/dist/timecampus/pages/application-usage/ApplicationUsagePage.js +78 -78
- package/dist/timecampus/pages/application-usage/ApplicationUsagePage.js.map +1 -1
- package/dist/timecampus/pages/dashboard/ServerReportExports.js +34 -34
- package/dist/timecampus/pages/dashboard/ServerReportExports.js.map +1 -1
- package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js +49 -48
- package/dist/timecampus/pages/expense-tracking/ExpenseTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/extend/AppletDeveloperPage.js +107 -102
- package/dist/timecampus/pages/extend/AppletDeveloperPage.js.map +1 -1
- package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js +129 -124
- package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js.map +1 -1
- package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js +94 -94
- package/dist/timecampus/pages/extend/ThirdPartyAppletsSection.js.map +1 -1
- package/dist/timecampus/pages/extend/TimeTriggersPage.js +97 -97
- package/dist/timecampus/pages/extend/TimeTriggersPage.js.map +1 -1
- package/dist/timecampus/pages/focus/FocusProtectionPage.js +120 -120
- package/dist/timecampus/pages/focus/FocusProtectionPage.js.map +1 -1
- package/dist/timecampus/pages/geofencing/GeofencingPage.js +343 -343
- package/dist/timecampus/pages/geofencing/GeofencingPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/LifeTimelinePage.js +25 -25
- package/dist/timecampus/pages/lifetime/LifeTimelinePage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/RecommendationsPage.js +296 -296
- package/dist/timecampus/pages/lifetime/RecommendationsPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/ValuesGoalsPage.js +189 -189
- package/dist/timecampus/pages/lifetime/ValuesGoalsPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/ActionItemFormModal.js +47 -46
- package/dist/timecampus/pages/meetings/ActionItemFormModal.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingDetailPage.js +206 -206
- package/dist/timecampus/pages/meetings/MeetingDetailPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingFormModal.js +72 -71
- package/dist/timecampus/pages/meetings/MeetingFormModal.js.map +1 -1
- package/dist/timecampus/pages/meetings/ParticipantFormModal.js +32 -31
- package/dist/timecampus/pages/meetings/ParticipantFormModal.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js +34 -34
- package/dist/timecampus/pages/pomodoro/PomodoroPage.js.map +1 -1
- package/dist/timecampus/pages/projects/ProjectDetailPage.js +163 -163
- package/dist/timecampus/pages/projects/ProjectDetailPage.js.map +1 -1
- package/dist/timecampus/pages/projects/ProjectsPage.js +193 -192
- package/dist/timecampus/pages/projects/ProjectsPage.js.map +1 -1
- package/dist/timecampus/pages/projects/TasksPage.js +92 -92
- package/dist/timecampus/pages/projects/TasksPage.js.map +1 -1
- package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js +60 -60
- package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js.map +1 -1
- package/dist/timecampus/pages/settings/IdleDetectionCard.js +33 -33
- package/dist/timecampus/pages/settings/IdleDetectionCard.js.map +1 -1
- package/dist/timecampus/pages/settings/PrivacySettingsPage.js +32 -32
- package/dist/timecampus/pages/settings/PrivacySettingsPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimeEntriesPage.js +163 -163
- package/dist/timecampus/pages/time/TimeEntriesPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimeTrackingPage.js +32 -32
- package/dist/timecampus/pages/time/TimeTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimerPage.js +84 -84
- package/dist/timecampus/pages/time/TimerPage.js.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.js +223 -223
- package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
- package/dist/timecampus/shared/hooks/useConfirmedAction.d.ts +10 -0
- package/dist/timecampus/shared/hooks/useConfirmedAction.js +14 -0
- package/dist/timecampus/shared/hooks/useConfirmedAction.js.map +1 -0
- package/package.json +2 -2
|
@@ -2,8 +2,9 @@ import { Modal as e } from "../../components/Modal.js";
|
|
|
2
2
|
import { MeetingParticipantRole as t, MeetingParticipantStatus as n } from "../../../generated/wspace-types.js";
|
|
3
3
|
import { useState as r } from "react";
|
|
4
4
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { ThemedSelect as s } from "@burdenoff/fe-libs/ui";
|
|
5
6
|
// src/timecampus/pages/meetings/ParticipantFormModal.tsx
|
|
6
|
-
var
|
|
7
|
+
var c = "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", l = "block text-sm font-medium text-text-primary", u = [
|
|
7
8
|
{
|
|
8
9
|
value: t.Required,
|
|
9
10
|
label: "Required"
|
|
@@ -16,7 +17,7 @@ var s = "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 p
|
|
|
16
17
|
value: t.Organizer,
|
|
17
18
|
label: "Organizer"
|
|
18
19
|
}
|
|
19
|
-
],
|
|
20
|
+
], d = [
|
|
20
21
|
{
|
|
21
22
|
value: n.Pending,
|
|
22
23
|
label: "Pending"
|
|
@@ -33,64 +34,64 @@ var s = "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 p
|
|
|
33
34
|
value: n.Declined,
|
|
34
35
|
label: "Declined"
|
|
35
36
|
}
|
|
36
|
-
],
|
|
37
|
-
let [
|
|
37
|
+
], f = ({ open: f, onClose: p, defaultUserId: m, submitting: h, error: g, onSubmit: _ }) => {
|
|
38
|
+
let [v, y] = r(m ?? ""), [b, x] = r(t.Required), [S, C] = r(n.Pending), w = !!v.trim() && !h;
|
|
38
39
|
return /* @__PURE__ */ o(e, {
|
|
39
|
-
open:
|
|
40
|
-
onClose:
|
|
40
|
+
open: f,
|
|
41
|
+
onClose: p,
|
|
41
42
|
title: "Add participant",
|
|
42
43
|
description: "Record who attended so their time counts toward this meeting's cost.",
|
|
43
44
|
footer: /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("button", {
|
|
44
|
-
onClick:
|
|
45
|
+
onClick: p,
|
|
45
46
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
|
|
46
47
|
children: "Cancel"
|
|
47
48
|
}), /* @__PURE__ */ a("button", {
|
|
48
49
|
onClick: async () => {
|
|
49
|
-
|
|
50
|
-
userId:
|
|
51
|
-
role:
|
|
52
|
-
status:
|
|
50
|
+
w && await _({
|
|
51
|
+
userId: v.trim(),
|
|
52
|
+
role: b,
|
|
53
|
+
status: S
|
|
53
54
|
});
|
|
54
55
|
},
|
|
55
|
-
disabled: !
|
|
56
|
+
disabled: !w,
|
|
56
57
|
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",
|
|
57
|
-
children:
|
|
58
|
+
children: h ? "Adding..." : "Add participant"
|
|
58
59
|
})] }),
|
|
59
|
-
children: [
|
|
60
|
+
children: [g && /* @__PURE__ */ a("div", {
|
|
60
61
|
className: "mb-4 rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text",
|
|
61
62
|
children: "Failed to add participant. Please try again."
|
|
62
63
|
}), /* @__PURE__ */ o("div", {
|
|
63
64
|
className: "space-y-4",
|
|
64
65
|
children: [/* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("label", {
|
|
65
|
-
className:
|
|
66
|
+
className: l,
|
|
66
67
|
children: "User ID"
|
|
67
68
|
}), /* @__PURE__ */ a("input", {
|
|
68
69
|
type: "text",
|
|
69
70
|
placeholder: "User ID",
|
|
70
|
-
value:
|
|
71
|
-
onChange: (e) =>
|
|
72
|
-
className:
|
|
71
|
+
value: v,
|
|
72
|
+
onChange: (e) => y(e.target.value),
|
|
73
|
+
className: c
|
|
73
74
|
})] }), /* @__PURE__ */ o("div", {
|
|
74
75
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
75
76
|
children: [/* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("label", {
|
|
76
|
-
className:
|
|
77
|
+
className: l,
|
|
77
78
|
children: "Role"
|
|
78
|
-
}), /* @__PURE__ */ a(
|
|
79
|
-
value:
|
|
80
|
-
onChange: (e) =>
|
|
81
|
-
className:
|
|
82
|
-
children:
|
|
79
|
+
}), /* @__PURE__ */ a(s, {
|
|
80
|
+
value: b,
|
|
81
|
+
onChange: (e) => x(e.target.value),
|
|
82
|
+
className: c,
|
|
83
|
+
children: u.map((e) => /* @__PURE__ */ a("option", {
|
|
83
84
|
value: e.value,
|
|
84
85
|
children: e.label
|
|
85
86
|
}, e.value))
|
|
86
87
|
})] }), /* @__PURE__ */ o("div", { children: [/* @__PURE__ */ a("label", {
|
|
87
|
-
className:
|
|
88
|
+
className: l,
|
|
88
89
|
children: "Status"
|
|
89
|
-
}), /* @__PURE__ */ a(
|
|
90
|
-
value:
|
|
91
|
-
onChange: (e) =>
|
|
92
|
-
className:
|
|
93
|
-
children:
|
|
90
|
+
}), /* @__PURE__ */ a(s, {
|
|
91
|
+
value: S,
|
|
92
|
+
onChange: (e) => C(e.target.value),
|
|
93
|
+
className: c,
|
|
94
|
+
children: d.map((e) => /* @__PURE__ */ a("option", {
|
|
94
95
|
value: e.value,
|
|
95
96
|
children: e.label
|
|
96
97
|
}, e.value))
|
|
@@ -99,6 +100,6 @@ var s = "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 p
|
|
|
99
100
|
})]
|
|
100
101
|
});
|
|
101
102
|
};
|
|
102
|
-
export {
|
|
103
|
+
export { f as ParticipantFormModal };
|
|
103
104
|
|
|
104
105
|
//# sourceMappingURL=ParticipantFormModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParticipantFormModal.js","names":["_Fragment","inputClass","labelClass","ROLES","MeetingParticipantRole","STATUSES","MeetingParticipantStatus","ParticipantFormModal","userId","setUserId","useState","defaultUserId","role","setRole","status","setStatus","canSubmit","submitting","Modal","Fragment","onClose","onSubmit","error","r","s"],"sources":["../../../../src/timecampus/pages/meetings/ParticipantFormModal.tsx"],"sourcesContent":["import { useState, type FC } from \"react\";\nimport { Modal } from \"../../components/Modal\";\nimport {\n MeetingParticipantRole,\n MeetingParticipantStatus,\n type AddMeetingParticipantInput,\n} from \"@/generated/wspace-types\";\n\nconst inputClass =\n \"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\";\nconst labelClass = \"block text-sm font-medium text-text-primary\";\n\nconst ROLES: { value: MeetingParticipantRole; label: string }[] = [\n { value: MeetingParticipantRole.Required, label: \"Required\" },\n { value: MeetingParticipantRole.Optional, label: \"Optional\" },\n { value: MeetingParticipantRole.Organizer, label: \"Organizer\" },\n];\n\nconst STATUSES: { value: MeetingParticipantStatus; label: string }[] = [\n { value: MeetingParticipantStatus.Pending, label: \"Pending\" },\n { value: MeetingParticipantStatus.Accepted, label: \"Accepted\" },\n { value: MeetingParticipantStatus.Tentative, label: \"Tentative\" },\n { value: MeetingParticipantStatus.Declined, label: \"Declined\" },\n];\n\ninterface ParticipantFormModalProps {\n open: boolean;\n onClose: () => void;\n defaultUserId?: string;\n submitting: boolean;\n error?: boolean;\n onSubmit: (input: AddMeetingParticipantInput) => Promise<void> | void;\n}\n\nexport const ParticipantFormModal: FC<ParticipantFormModalProps> = ({\n open,\n onClose,\n defaultUserId,\n submitting,\n error,\n onSubmit,\n}) => {\n const [userId, setUserId] = useState(defaultUserId ?? \"\");\n const [role, setRole] = useState<MeetingParticipantRole>(\n MeetingParticipantRole.Required,\n );\n const [status, setStatus] = useState<MeetingParticipantStatus>(\n MeetingParticipantStatus.Pending,\n );\n\n const canSubmit = Boolean(userId.trim()) && !submitting;\n\n const handleSubmit = async () => {\n if (!canSubmit) return;\n await onSubmit({ userId: userId.trim(), role, status });\n };\n\n return (\n <Modal\n open={open}\n onClose={onClose}\n title=\"Add participant\"\n description=\"Record who attended so their time counts toward this meeting's cost.\"\n footer={\n <>\n <button\n onClick={onClose}\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 Cancel\n </button>\n <button\n onClick={handleSubmit}\n disabled={!canSubmit}\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 {submitting ? \"Adding...\" : \"Add participant\"}\n </button>\n </>\n }\n >\n {error && (\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 Failed to add participant. Please try again.\n </div>\n )}\n <div className=\"space-y-4\">\n <div>\n <label className={labelClass}>User ID</label>\n <input\n type=\"text\"\n placeholder=\"User ID\"\n value={userId}\n onChange={(e) => setUserId(e.target.value)}\n className={inputClass}\n />\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label className={labelClass}>Role</label>\n <
|
|
1
|
+
{"version":3,"file":"ParticipantFormModal.js","names":["_Fragment","inputClass","labelClass","ROLES","MeetingParticipantRole","STATUSES","MeetingParticipantStatus","ParticipantFormModal","userId","setUserId","useState","defaultUserId","role","setRole","status","setStatus","canSubmit","submitting","Modal","Fragment","onClose","onSubmit","error","ThemedSelect","r","s"],"sources":["../../../../src/timecampus/pages/meetings/ParticipantFormModal.tsx"],"sourcesContent":["import { useState, type FC } from \"react\";\nimport { Modal } from \"../../components/Modal\";\nimport {\n MeetingParticipantRole,\n MeetingParticipantStatus,\n type AddMeetingParticipantInput,\n} from \"@/generated/wspace-types\";\n\nimport { ThemedSelect } from \"@burdenoff/fe-libs/ui\";\nconst inputClass =\n \"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\";\nconst labelClass = \"block text-sm font-medium text-text-primary\";\n\nconst ROLES: { value: MeetingParticipantRole; label: string }[] = [\n { value: MeetingParticipantRole.Required, label: \"Required\" },\n { value: MeetingParticipantRole.Optional, label: \"Optional\" },\n { value: MeetingParticipantRole.Organizer, label: \"Organizer\" },\n];\n\nconst STATUSES: { value: MeetingParticipantStatus; label: string }[] = [\n { value: MeetingParticipantStatus.Pending, label: \"Pending\" },\n { value: MeetingParticipantStatus.Accepted, label: \"Accepted\" },\n { value: MeetingParticipantStatus.Tentative, label: \"Tentative\" },\n { value: MeetingParticipantStatus.Declined, label: \"Declined\" },\n];\n\ninterface ParticipantFormModalProps {\n open: boolean;\n onClose: () => void;\n defaultUserId?: string;\n submitting: boolean;\n error?: boolean;\n onSubmit: (input: AddMeetingParticipantInput) => Promise<void> | void;\n}\n\nexport const ParticipantFormModal: FC<ParticipantFormModalProps> = ({\n open,\n onClose,\n defaultUserId,\n submitting,\n error,\n onSubmit,\n}) => {\n const [userId, setUserId] = useState(defaultUserId ?? \"\");\n const [role, setRole] = useState<MeetingParticipantRole>(\n MeetingParticipantRole.Required,\n );\n const [status, setStatus] = useState<MeetingParticipantStatus>(\n MeetingParticipantStatus.Pending,\n );\n\n const canSubmit = Boolean(userId.trim()) && !submitting;\n\n const handleSubmit = async () => {\n if (!canSubmit) return;\n await onSubmit({ userId: userId.trim(), role, status });\n };\n\n return (\n <Modal\n open={open}\n onClose={onClose}\n title=\"Add participant\"\n description=\"Record who attended so their time counts toward this meeting's cost.\"\n footer={\n <>\n <button\n onClick={onClose}\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 Cancel\n </button>\n <button\n onClick={handleSubmit}\n disabled={!canSubmit}\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 {submitting ? \"Adding...\" : \"Add participant\"}\n </button>\n </>\n }\n >\n {error && (\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 Failed to add participant. Please try again.\n </div>\n )}\n <div className=\"space-y-4\">\n <div>\n <label className={labelClass}>User ID</label>\n <input\n type=\"text\"\n placeholder=\"User ID\"\n value={userId}\n onChange={(e) => setUserId(e.target.value)}\n className={inputClass}\n />\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label className={labelClass}>Role</label>\n <ThemedSelect\n value={role}\n onChange={(e) =>\n setRole(e.target.value as MeetingParticipantRole)\n }\n className={inputClass}\n >\n {ROLES.map((r) => (\n <option key={r.value} value={r.value}>\n {r.label}\n </option>\n ))}\n </ThemedSelect>\n </div>\n <div>\n <label className={labelClass}>Status</label>\n <ThemedSelect\n value={status}\n onChange={(e) =>\n setStatus(e.target.value as MeetingParticipantStatus)\n }\n className={inputClass}\n >\n {STATUSES.map((s) => (\n <option key={s.value} value={s.value}>\n {s.label}\n </option>\n ))}\n </ThemedSelect>\n </div>\n </div>\n </div>\n </Modal>\n );\n};\n"],"mappings":";;;;;;AASA,IAAMC,IACJ,wIACIC,IAAa,+CAEbC,IAA4D;CAChE;EAAE,OAAOC,EAAuB;EAAU,OAAO;CAAW;CAC5D;EAAE,OAAOA,EAAuB;EAAU,OAAO;CAAW;CAC5D;EAAE,OAAOA,EAAuB;EAAW,OAAO;CAAY;AAChE,GAEMC,IAAiE;CACrE;EAAE,OAAOC,EAAyB;EAAS,OAAO;CAAU;CAC5D;EAAE,OAAOA,EAAyB;EAAU,OAAO;CAAW;CAC9D;EAAE,OAAOA,EAAyB;EAAW,OAAO;CAA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EV,UAAAE,EAAM,KAAK,MACV,kBAAC,UAAD;MAAsB,OAAOqB,EAAE;MAC5B,UAAAA,EAAE;KACG,GAFKA,EAAE,KAEP,CACT;IACW,CAAA,CACX,EAAA,CAAA,GACL,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;KAAO,WAAWtB;KAAY,UAAA;IAAa,CAAA,GAC3C,kBAACqB,GAAD;KACE,OAAOT;KACP,WAAW,MACTC,EAAU,EAAE,OAAO,KAAiC;KAEtD,WAAWd;KAEV,UAAAI,EAAS,KAAK,MACb,kBAAC,UAAD;MAAsB,OAAOoB,EAAE;MAC5B,UAAAA,EAAE;KACG,GAFKA,EAAE,KAEP,CACT;IACW,CAAA,CACX,EAAA,CAAA,CACF;GACF,CAAA,CAAA;EACA,CAAA,CAAA;;AAEX"}
|
|
@@ -12,7 +12,7 @@ import { durationForSession as _e, nextSessionAfter as o } from "./pomodoroDurat
|
|
|
12
12
|
import { useCallback as s, useEffect as c, useRef as ve, useState as l } from "react";
|
|
13
13
|
import { Pause as ye, Pencil as be, Play as xe, Plus as Se, RotateCcw as Ce, SkipForward as we, Target as Te, Trash2 as Ee } from "lucide-react";
|
|
14
14
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
15
|
-
import { GlassCard as p, NextSteps as De } from "@burdenoff/fe-libs/ui";
|
|
15
|
+
import { GlassCard as p, NextSteps as De, ThemedSelect as Oe } from "@burdenoff/fe-libs/ui";
|
|
16
16
|
// src/timecampus/pages/pomodoro/PomodoroPage.tsx
|
|
17
17
|
var m = "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", h = "block text-sm font-medium text-text-primary";
|
|
18
18
|
function g(e) {
|
|
@@ -37,16 +37,16 @@ function y(e) {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
function b() {
|
|
40
|
-
let { workspaceId: g = "" } = ne(), _ = re(), { data: b, loading:
|
|
40
|
+
let { workspaceId: g = "" } = ne(), _ = re(), { data: b, loading: ke, error: Ae } = le({
|
|
41
41
|
variables: { workspaceId: g },
|
|
42
42
|
skip: !g
|
|
43
|
-
}), { data:
|
|
43
|
+
}), { data: je, loading: Me, error: Ne } = se({
|
|
44
44
|
variables: { workspaceId: g },
|
|
45
45
|
skip: !g
|
|
46
|
-
}), { data:
|
|
46
|
+
}), { data: Pe, loading: x, error: Fe } = ce({
|
|
47
47
|
variables: { workspaceId: g },
|
|
48
48
|
skip: !g
|
|
49
|
-
}), { data:
|
|
49
|
+
}), { data: Ie } = fe({
|
|
50
50
|
variables: {
|
|
51
51
|
workspaceId: g,
|
|
52
52
|
orderBy: {
|
|
@@ -59,20 +59,20 @@ function b() {
|
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
skip: !g
|
|
62
|
-
}), [S] = pe(), [C] = ie(), w = te(), [
|
|
62
|
+
}), [S] = pe(), [C] = ie(), w = te(), [Le] = ue(), { data: Re, refetch: T } = de({
|
|
63
63
|
variables: { workspaceId: g },
|
|
64
64
|
skip: !g
|
|
65
|
-
}), E =
|
|
65
|
+
}), E = Re?.pomodoroGoals ?? [], [ze, { loading: D, error: Be }] = ae(), [Ve, { loading: O, error: He }] = me(), [Ue, { loading: k, error: We }] = oe(), [Ge, A] = l(!1), [j, M] = l(null), [N, P] = l(null), [F, I] = l(y()), L = (e, t) => I((n) => ({
|
|
66
66
|
...n,
|
|
67
67
|
[e]: t
|
|
68
|
-
})),
|
|
68
|
+
})), Ke = () => {
|
|
69
69
|
M(null), I(y()), A(!0);
|
|
70
|
-
},
|
|
70
|
+
}, qe = (e) => {
|
|
71
71
|
M(e), I(y(e)), A(!0);
|
|
72
|
-
},
|
|
72
|
+
}, Je = async () => {
|
|
73
73
|
if (!g) return;
|
|
74
74
|
let e = Number(F.target);
|
|
75
|
-
!e || e <= 0 || (j ? await
|
|
75
|
+
!e || e <= 0 || (j ? await Ve({ variables: {
|
|
76
76
|
id: j.id,
|
|
77
77
|
workspaceId: g,
|
|
78
78
|
input: {
|
|
@@ -82,7 +82,7 @@ function b() {
|
|
|
82
82
|
startDate: new Date(F.startDate).toISOString(),
|
|
83
83
|
endDate: new Date(F.endDate).toISOString()
|
|
84
84
|
}
|
|
85
|
-
} }) : await
|
|
85
|
+
} }) : await ze({ variables: { input: {
|
|
86
86
|
workspaceId: g,
|
|
87
87
|
type: F.type,
|
|
88
88
|
target: e,
|
|
@@ -90,12 +90,12 @@ function b() {
|
|
|
90
90
|
startDate: new Date(F.startDate).toISOString(),
|
|
91
91
|
endDate: new Date(F.endDate).toISOString()
|
|
92
92
|
} } }), A(!1), await T());
|
|
93
|
-
},
|
|
94
|
-
N && g && (await
|
|
93
|
+
}, Ye = async () => {
|
|
94
|
+
N && g && (await Ue({ variables: {
|
|
95
95
|
id: N.id,
|
|
96
96
|
workspaceId: g
|
|
97
97
|
} }), P(null), await T());
|
|
98
|
-
}, R = b?.pomodoroStats, z =
|
|
98
|
+
}, R = b?.pomodoroStats, z = je?.activePomodoroSession, B = Pe?.pomodoroSettings, V = Ie?.pomodoroSessions[0], [H, U] = l(1500), [W, G] = l(!1), [K, q] = l(a.Focus), J = ve(null), Y = s((e) => _e(e, B), [B]), X = s((e) => {
|
|
99
99
|
let t = (R?.completedSessions ?? 0) + 1;
|
|
100
100
|
return o(e, t, B?.sessionsBeforeLongBreak ?? 4);
|
|
101
101
|
}, [B?.sessionsBeforeLongBreak, R?.completedSessions]);
|
|
@@ -159,7 +159,7 @@ function b() {
|
|
|
159
159
|
W,
|
|
160
160
|
H
|
|
161
161
|
]);
|
|
162
|
-
let
|
|
162
|
+
let Xe = (e) => {
|
|
163
163
|
let t = Math.floor(e / 60), n = e % 60;
|
|
164
164
|
return `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
165
165
|
}, Q = s(async () => {
|
|
@@ -183,8 +183,8 @@ function b() {
|
|
|
183
183
|
Y,
|
|
184
184
|
K,
|
|
185
185
|
S
|
|
186
|
-
]),
|
|
187
|
-
G(!1), z && g && (await
|
|
186
|
+
]), Ze = async () => {
|
|
187
|
+
G(!1), z && g && (await Le({
|
|
188
188
|
variables: {
|
|
189
189
|
id: z.id,
|
|
190
190
|
workspaceId: g,
|
|
@@ -198,7 +198,7 @@ function b() {
|
|
|
198
198
|
awaitRefetchQueries: !0
|
|
199
199
|
}), q(z.type)), U(Y(z?.type ?? K));
|
|
200
200
|
};
|
|
201
|
-
if (
|
|
201
|
+
if (ke || Me || x) return /* @__PURE__ */ d(t, {
|
|
202
202
|
title: "Pomodoro Timer",
|
|
203
203
|
description: "Focus with the Pomodoro Technique",
|
|
204
204
|
children: /* @__PURE__ */ d(ee, {
|
|
@@ -206,7 +206,7 @@ function b() {
|
|
|
206
206
|
count: 3
|
|
207
207
|
})
|
|
208
208
|
});
|
|
209
|
-
if (
|
|
209
|
+
if (Ae || Ne || Fe) return /* @__PURE__ */ d(t, {
|
|
210
210
|
title: "Pomodoro Timer",
|
|
211
211
|
description: "Focus with the Pomodoro Technique",
|
|
212
212
|
children: /* @__PURE__ */ d("div", {
|
|
@@ -214,7 +214,7 @@ function b() {
|
|
|
214
214
|
children: "Failed to load pomodoro data. Please try again later."
|
|
215
215
|
})
|
|
216
216
|
});
|
|
217
|
-
let
|
|
217
|
+
let Qe = Math.floor((R?.totalFocusMinutes ?? 0) / 60), $e = (R?.totalFocusMinutes ?? 0) % 60, $ = z?.type ?? K, et = $ === a.ShortBreak ? z ? "Short Break" : "Short Break Ready" : $ === a.LongBreak ? z ? "Long Break" : "Long Break Ready" : z ? "Focus Session" : "Focus Ready", tt = $ === a.ShortBreak ? "Start Short Break" : $ === a.LongBreak ? "Start Long Break" : "Start Focus";
|
|
218
218
|
return /* @__PURE__ */ f(t, {
|
|
219
219
|
title: "Pomodoro Timer",
|
|
220
220
|
description: "Focus with the Pomodoro Technique",
|
|
@@ -255,7 +255,7 @@ function b() {
|
|
|
255
255
|
}),
|
|
256
256
|
/* @__PURE__ */ d(n, {
|
|
257
257
|
title: "Focus Time",
|
|
258
|
-
value: `${
|
|
258
|
+
value: `${Qe}h ${$e}m`,
|
|
259
259
|
trend: {
|
|
260
260
|
value: R?.completionRate ?? 0,
|
|
261
261
|
label: "completion rate"
|
|
@@ -280,12 +280,12 @@ function b() {
|
|
|
280
280
|
children: /* @__PURE__ */ d("span", {
|
|
281
281
|
"aria-live": "polite",
|
|
282
282
|
className: "inline-flex rounded-full bg-action-primary-bg/10 px-3 py-1 text-xs font-medium text-primary",
|
|
283
|
-
children:
|
|
283
|
+
children: et
|
|
284
284
|
})
|
|
285
285
|
}),
|
|
286
286
|
/* @__PURE__ */ d("p", {
|
|
287
287
|
className: "text-7xl font-mono font-bold text-text-primary",
|
|
288
|
-
children:
|
|
288
|
+
children: Xe(H)
|
|
289
289
|
}),
|
|
290
290
|
/* @__PURE__ */ d("p", {
|
|
291
291
|
className: "mt-2 text-sm text-text-secondary",
|
|
@@ -301,7 +301,7 @@ function b() {
|
|
|
301
301
|
}) : /* @__PURE__ */ f("button", {
|
|
302
302
|
onClick: Q,
|
|
303
303
|
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",
|
|
304
|
-
children: [/* @__PURE__ */ d(xe, { className: "h-4 w-4" }),
|
|
304
|
+
children: [/* @__PURE__ */ d(xe, { className: "h-4 w-4" }), tt]
|
|
305
305
|
}),
|
|
306
306
|
/* @__PURE__ */ f("button", {
|
|
307
307
|
onClick: Z,
|
|
@@ -310,7 +310,7 @@ function b() {
|
|
|
310
310
|
children: [/* @__PURE__ */ d(we, { className: "h-4 w-4" }), "Skip"]
|
|
311
311
|
}),
|
|
312
312
|
/* @__PURE__ */ f("button", {
|
|
313
|
-
onClick: () => void
|
|
313
|
+
onClick: () => void Ze(),
|
|
314
314
|
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",
|
|
315
315
|
children: [/* @__PURE__ */ d(Ce, { className: "h-4 w-4" }), "Reset"]
|
|
316
316
|
})
|
|
@@ -328,7 +328,7 @@ function b() {
|
|
|
328
328
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
329
329
|
children: [/* @__PURE__ */ d(Te, { className: "h-4 w-4" }), "Focus Goals"]
|
|
330
330
|
}), /* @__PURE__ */ f("button", {
|
|
331
|
-
onClick:
|
|
331
|
+
onClick: Ke,
|
|
332
332
|
className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
333
333
|
children: [/* @__PURE__ */ d(Se, { className: "h-4 w-4" }), "Add Goal"]
|
|
334
334
|
})]
|
|
@@ -362,7 +362,7 @@ function b() {
|
|
|
362
362
|
children: [t, "%"]
|
|
363
363
|
}),
|
|
364
364
|
/* @__PURE__ */ d("button", {
|
|
365
|
-
onClick: () =>
|
|
365
|
+
onClick: () => qe(e),
|
|
366
366
|
className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary",
|
|
367
367
|
"aria-label": "Edit goal",
|
|
368
368
|
children: /* @__PURE__ */ d(be, { className: "h-4 w-4" })
|
|
@@ -387,7 +387,7 @@ function b() {
|
|
|
387
387
|
})]
|
|
388
388
|
}),
|
|
389
389
|
/* @__PURE__ */ f(r, {
|
|
390
|
-
open:
|
|
390
|
+
open: Ge,
|
|
391
391
|
onClose: () => A(!1),
|
|
392
392
|
title: j ? "Edit Focus Goal" : "Add Focus Goal",
|
|
393
393
|
description: "Set a target number of focus sessions",
|
|
@@ -396,12 +396,12 @@ function b() {
|
|
|
396
396
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
|
|
397
397
|
children: "Cancel"
|
|
398
398
|
}), /* @__PURE__ */ d("button", {
|
|
399
|
-
onClick:
|
|
399
|
+
onClick: Je,
|
|
400
400
|
disabled: D || O || Number(F.target) <= 0,
|
|
401
401
|
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",
|
|
402
402
|
children: D || O ? "Saving..." : j ? "Save Changes" : "Add Goal"
|
|
403
403
|
})] }),
|
|
404
|
-
children: [(
|
|
404
|
+
children: [(Be || He) && /* @__PURE__ */ d("div", {
|
|
405
405
|
className: "mb-4 rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text",
|
|
406
406
|
children: "Failed to save goal. Please try again."
|
|
407
407
|
}), /* @__PURE__ */ f("div", {
|
|
@@ -410,7 +410,7 @@ function b() {
|
|
|
410
410
|
/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
411
411
|
className: h,
|
|
412
412
|
children: "Goal Type"
|
|
413
|
-
}), /* @__PURE__ */ f(
|
|
413
|
+
}), /* @__PURE__ */ f(Oe, {
|
|
414
414
|
value: F.type,
|
|
415
415
|
onChange: (e) => {
|
|
416
416
|
let t = e.target.value;
|
|
@@ -481,12 +481,12 @@ function b() {
|
|
|
481
481
|
className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
|
|
482
482
|
children: "Cancel"
|
|
483
483
|
}), /* @__PURE__ */ d("button", {
|
|
484
|
-
onClick:
|
|
484
|
+
onClick: Ye,
|
|
485
485
|
disabled: k,
|
|
486
486
|
className: "rounded-md bg-status-error-bg px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg/90 disabled:opacity-50",
|
|
487
487
|
children: k ? "Deleting..." : "Delete"
|
|
488
488
|
})] }),
|
|
489
|
-
children: [
|
|
489
|
+
children: [We && /* @__PURE__ */ d("div", {
|
|
490
490
|
className: "mb-4 rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text",
|
|
491
491
|
children: "Failed to delete goal. Please try again."
|
|
492
492
|
}), /* @__PURE__ */ f("p", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PomodoroPage.js","names":["_Fragment","inputClasses","labelClasses","toDateInput","d","iso","todayInput","futureInput","days","toGoalState","goal","PomodoroGoalType","PomodoroPage","useTimeCampus","navigate","useTimeCampusNavigate","statsData","statsLoading","statsError","useGetPomodoroStatsQuery","workspaceId","activeData","activeLoading","activeError","useGetActivePomodoroSessionQuery","settingsData","settingsLoading","settingsError","useGetPomodoroSettingsQuery","recentSessionsData","useListPomodoroSessionsQuery","PomodoroSessionOrderByField","TimeCampusSortDirection","startSession","useStartPomodoroSessionMutation","completeSession","useCompletePomodoroSessionMutation","analytics","useTimeCampusAnalytics","interruptSession","useInterruptPomodoroSessionMutation","goalsData","refetchGoals","useListPomodoroGoalsQuery","goals","createGoal","creatingGoal","createGoalError","useCreatePomodoroGoalMutation","updateGoal","updatingGoal","updateGoalError","useUpdatePomodoroGoalMutation","deleteGoal","deletingGoal","deleteGoalError","useDeletePomodoroGoalMutation","goalModalOpen","setGoalModalOpen","useState","editingGoal","setEditingGoal","deletingGoalEntry","setDeletingGoalEntry","goalForm","setGoalForm","setGoalField","f","key","v","openCreateGoal","openEditGoal","handleSaveGoal","target","handleDeleteGoal","stats","activeSession","settings","lastSession","timerSeconds","setTimerSeconds","isRunning","setIsRunning","nextSessionType","setNextSessionType","PomodoroSessionType","completingSessionRef","useRef","getDuration","useCallback","durationForSession","type","getNextSessionType","focusSessions","nextSessionAfter","completedType","useEffect","next","elapsed","duration","remaining","handleComplete","completed","timeout","previous","formatTimer","m","seconds","s","handleStart","handleReset","PageLayout","LoadingSkeleton","totalFocusH","totalFocusM","displayedSessionType","phaseLabel","startLabel","PhoneViewLink","NextSteps","StatCard","GlassCard","Pause","Play","SkipForward","RotateCcw","Target","Plus","pct","Pencil","Trash2","Modal","Fragment"],"sources":["../../../../src/timecampus/pages/pomodoro/PomodoroPage.tsx"],"sourcesContent":["import { useState, useEffect, useCallback, useRef } from \"react\";\nimport { PhoneViewLink } from \"../mobile/MobileScreen\";\nimport {\n Play,\n Pause,\n SkipForward,\n RotateCcw,\n Target,\n Plus,\n Pencil,\n Trash2,\n} from \"lucide-react\";\nimport { GlassCard, NextSteps } from \"@burdenoff/fe-libs/ui\";\nimport { PageLayout } from \"../../components/PageLayout\";\nimport { StatCard } from \"../../components/StatCard\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport { Modal } from \"../../components/Modal\";\nimport {\n useTimeCampus,\n useTimeCampusNavigate,\n} from \"../../providers/TimeCampusProvider\";\nimport {\n useGetActivePomodoroSessionQuery,\n useGetPomodoroSettingsQuery,\n useGetPomodoroStatsQuery,\n useListPomodoroSessionsQuery,\n useStartPomodoroSessionMutation,\n useCompletePomodoroSessionMutation,\n useInterruptPomodoroSessionMutation,\n useListPomodoroGoalsQuery,\n useCreatePomodoroGoalMutation,\n useUpdatePomodoroGoalMutation,\n useDeletePomodoroGoalMutation,\n type PomodoroGoalFieldsFragment,\n} from \"@/generated/wspace-operations\";\nimport { useTimeCampusAnalytics } from \"../../analytics\";\nimport {\n PomodoroGoalType,\n PomodoroSessionOrderByField,\n PomodoroSessionType,\n TimeCampusSortDirection,\n} from \"@/generated/wspace-types\";\nimport { durationForSession, nextSessionAfter } from \"./pomodoroDuration\";\n\ninterface GoalFormState {\n type: PomodoroGoalType;\n target: string;\n period: string;\n startDate: string;\n endDate: string;\n}\n\nconst inputClasses =\n \"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\";\nconst labelClasses = \"block text-sm font-medium text-text-primary\";\n\nfunction toDateInput(iso: string): string {\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return \"\";\n const local = new Date(d.getTime() - d.getTimezoneOffset() * 60000);\n return local.toISOString().slice(0, 10);\n}\n\nfunction todayInput(): string {\n const d = new Date();\n const local = new Date(d.getTime() - d.getTimezoneOffset() * 60000);\n return local.toISOString().slice(0, 10);\n}\n\nfunction futureInput(days: number): string {\n const d = new Date();\n d.setDate(d.getDate() + days);\n const local = new Date(d.getTime() - d.getTimezoneOffset() * 60000);\n return local.toISOString().slice(0, 10);\n}\n\nfunction toGoalState(goal?: PomodoroGoalFieldsFragment): GoalFormState {\n return {\n type: goal?.type ?? PomodoroGoalType.Daily,\n target: goal?.target != null ? String(goal.target) : \"8\",\n period: goal?.period ?? \"DAILY\",\n startDate: goal?.startDate ? toDateInput(goal.startDate) : todayInput(),\n endDate: goal?.endDate ? toDateInput(goal.endDate) : futureInput(0),\n };\n}\n\nexport function PomodoroPage() {\n const { workspaceId = \"\" } = useTimeCampus();\n const navigate = useTimeCampusNavigate();\n\n const {\n data: statsData,\n loading: statsLoading,\n error: statsError,\n } = useGetPomodoroStatsQuery({\n variables: { workspaceId },\n skip: !workspaceId,\n });\n\n const {\n data: activeData,\n loading: activeLoading,\n error: activeError,\n } = useGetActivePomodoroSessionQuery({\n variables: { workspaceId },\n skip: !workspaceId,\n });\n\n const {\n data: settingsData,\n loading: settingsLoading,\n error: settingsError,\n } = useGetPomodoroSettingsQuery({\n variables: { workspaceId },\n skip: !workspaceId,\n });\n\n const { data: recentSessionsData } = useListPomodoroSessionsQuery({\n variables: {\n workspaceId,\n orderBy: {\n field: PomodoroSessionOrderByField.StartTime,\n direction: TimeCampusSortDirection.Desc,\n },\n pagination: { limit: 1, offset: 0 },\n },\n skip: !workspaceId,\n });\n\n const [startSession] = useStartPomodoroSessionMutation();\n const [completeSession] = useCompletePomodoroSessionMutation();\n const analytics = useTimeCampusAnalytics();\n const [interruptSession] = useInterruptPomodoroSessionMutation();\n\n // Focus goals\n const { data: goalsData, refetch: refetchGoals } = useListPomodoroGoalsQuery({\n variables: { workspaceId },\n skip: !workspaceId,\n });\n const goals = goalsData?.pomodoroGoals ?? [];\n\n const [createGoal, { loading: creatingGoal, error: createGoalError }] =\n useCreatePomodoroGoalMutation();\n const [updateGoal, { loading: updatingGoal, error: updateGoalError }] =\n useUpdatePomodoroGoalMutation();\n const [deleteGoal, { loading: deletingGoal, error: deleteGoalError }] =\n useDeletePomodoroGoalMutation();\n\n const [goalModalOpen, setGoalModalOpen] = useState(false);\n const [editingGoal, setEditingGoal] =\n useState<PomodoroGoalFieldsFragment | null>(null);\n const [deletingGoalEntry, setDeletingGoalEntry] =\n useState<PomodoroGoalFieldsFragment | null>(null);\n const [goalForm, setGoalForm] = useState<GoalFormState>(toGoalState());\n\n const setGoalField = <K extends keyof GoalFormState>(\n key: K,\n v: GoalFormState[K],\n ) => setGoalForm((f) => ({ ...f, [key]: v }));\n\n const openCreateGoal = () => {\n setEditingGoal(null);\n setGoalForm(toGoalState());\n setGoalModalOpen(true);\n };\n\n const openEditGoal = (goal: PomodoroGoalFieldsFragment) => {\n setEditingGoal(goal);\n setGoalForm(toGoalState(goal));\n setGoalModalOpen(true);\n };\n\n const handleSaveGoal = async () => {\n if (!workspaceId) return;\n const target = Number(goalForm.target);\n if (!target || target <= 0) return;\n if (editingGoal) {\n await updateGoal({\n variables: {\n id: editingGoal.id,\n workspaceId,\n input: {\n type: goalForm.type,\n target,\n period: goalForm.period.trim() || goalForm.type,\n startDate: new Date(goalForm.startDate).toISOString(),\n endDate: new Date(goalForm.endDate).toISOString(),\n },\n },\n });\n } else {\n await createGoal({\n variables: {\n input: {\n workspaceId,\n type: goalForm.type,\n target,\n period: goalForm.period.trim() || goalForm.type,\n startDate: new Date(goalForm.startDate).toISOString(),\n endDate: new Date(goalForm.endDate).toISOString(),\n },\n },\n });\n }\n setGoalModalOpen(false);\n await refetchGoals();\n };\n\n const handleDeleteGoal = async () => {\n if (!deletingGoalEntry || !workspaceId) return;\n await deleteGoal({\n variables: { id: deletingGoalEntry.id, workspaceId },\n });\n setDeletingGoalEntry(null);\n await refetchGoals();\n };\n\n const stats = statsData?.pomodoroStats;\n const activeSession = activeData?.activePomodoroSession;\n const settings = settingsData?.pomodoroSettings;\n const lastSession = recentSessionsData?.pomodoroSessions[0];\n\n const [timerSeconds, setTimerSeconds] = useState(25 * 60);\n const [isRunning, setIsRunning] = useState(false);\n const [nextSessionType, setNextSessionType] = useState(\n PomodoroSessionType.Focus,\n );\n const completingSessionRef = useRef<string | null>(null);\n\n const getDuration = useCallback(\n (type: PomodoroSessionType) => durationForSession(type, settings),\n [settings],\n );\n\n const getNextSessionType = useCallback(\n (completedType: PomodoroSessionType) => {\n const focusSessions = (stats?.completedSessions ?? 0) + 1;\n return nextSessionAfter(\n completedType,\n focusSessions,\n settings?.sessionsBeforeLongBreak ?? 4,\n );\n },\n [settings?.sessionsBeforeLongBreak, stats?.completedSessions],\n );\n\n useEffect(() => {\n if (activeSession || !lastSession?.completed) return;\n const next = nextSessionAfter(\n lastSession.type,\n stats?.completedSessions ?? 0,\n settings?.sessionsBeforeLongBreak ?? 4,\n );\n setNextSessionType(next);\n setTimerSeconds(getDuration(next));\n }, [activeSession, getDuration, lastSession, settings, stats]);\n\n useEffect(() => {\n if (activeSession && !activeSession.completed) {\n const elapsed = Math.floor(\n (Date.now() - new Date(activeSession.startTime).getTime()) / 1000,\n );\n const duration =\n activeSession.duration ?? getDuration(activeSession.type);\n const remaining = Math.max(0, duration - elapsed);\n setTimerSeconds(remaining);\n setIsRunning(remaining > 0);\n }\n }, [activeSession, getDuration]);\n\n const handleComplete = useCallback(async () => {\n if (!activeSession || !workspaceId) return;\n if (completingSessionRef.current === activeSession.id) return;\n completingSessionRef.current = activeSession.id;\n try {\n const result = await completeSession({\n variables: { id: activeSession.id, workspaceId },\n refetchQueries: [\n \"GetActivePomodoroSession\",\n \"GetPomodoroStats\",\n \"ListPomodoroSessions\",\n ],\n awaitRefetchQueries: true,\n });\n const completed = result.data?.completePomodoroSession;\n if (completed) analytics.pomodoroCompleted(completed.id);\n const next = getNextSessionType(activeSession.type);\n setNextSessionType(next);\n setTimerSeconds(getDuration(next));\n setIsRunning(false);\n } finally {\n completingSessionRef.current = null;\n }\n }, [\n activeSession,\n analytics,\n completeSession,\n getDuration,\n getNextSessionType,\n workspaceId,\n ]);\n\n useEffect(() => {\n if (timerSeconds <= 0) {\n setIsRunning(false);\n void handleComplete();\n return;\n }\n if (!isRunning) return;\n const timeout = window.setTimeout(\n () => setTimerSeconds((previous) => Math.max(0, previous - 1)),\n 1000,\n );\n return () => window.clearTimeout(timeout);\n }, [handleComplete, isRunning, timerSeconds]);\n\n const formatTimer = (seconds: number) => {\n const m = Math.floor(seconds / 60);\n const s = seconds % 60;\n return `${String(m).padStart(2, \"0\")}:${String(s).padStart(2, \"0\")}`;\n };\n\n const handleStart = useCallback(async () => {\n if (!workspaceId) return;\n if (activeSession && !activeSession.completed) {\n setIsRunning(true);\n return;\n }\n const type = nextSessionType;\n await startSession({\n variables: { input: { workspaceId, type } },\n refetchQueries: [\"GetActivePomodoroSession\", \"GetPomodoroStats\"],\n awaitRefetchQueries: true,\n });\n setTimerSeconds(getDuration(type));\n setIsRunning(true);\n }, [workspaceId, activeSession, getDuration, nextSessionType, startSession]);\n\n const handleReset = async () => {\n setIsRunning(false);\n if (activeSession && workspaceId) {\n await interruptSession({\n variables: {\n id: activeSession.id,\n workspaceId,\n reason: \"Reset by user\",\n },\n refetchQueries: [\n \"GetActivePomodoroSession\",\n \"GetPomodoroStats\",\n \"ListPomodoroSessions\",\n ],\n awaitRefetchQueries: true,\n });\n setNextSessionType(activeSession.type);\n }\n setTimerSeconds(getDuration(activeSession?.type ?? nextSessionType));\n };\n\n if (statsLoading || activeLoading || settingsLoading) {\n return (\n <PageLayout\n title=\"Pomodoro Timer\"\n description=\"Focus with the Pomodoro Technique\"\n >\n <LoadingSkeleton variant=\"card\" count={3} />\n </PageLayout>\n );\n }\n\n if (statsError || activeError || settingsError) {\n return (\n <PageLayout\n title=\"Pomodoro Timer\"\n description=\"Focus with the Pomodoro Technique\"\n >\n <div className=\"rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text\">\n Failed to load pomodoro data. Please try again later.\n </div>\n </PageLayout>\n );\n }\n\n const totalFocusH = Math.floor((stats?.totalFocusMinutes ?? 0) / 60);\n const totalFocusM = (stats?.totalFocusMinutes ?? 0) % 60;\n const displayedSessionType = activeSession?.type ?? nextSessionType;\n const phaseLabel =\n displayedSessionType === PomodoroSessionType.ShortBreak\n ? activeSession\n ? \"Short Break\"\n : \"Short Break Ready\"\n : displayedSessionType === PomodoroSessionType.LongBreak\n ? activeSession\n ? \"Long Break\"\n : \"Long Break Ready\"\n : activeSession\n ? \"Focus Session\"\n : \"Focus Ready\";\n const startLabel =\n displayedSessionType === PomodoroSessionType.ShortBreak\n ? \"Start Short Break\"\n : displayedSessionType === PomodoroSessionType.LongBreak\n ? \"Start Long Break\"\n : \"Start Focus\";\n\n return (\n <PageLayout\n title=\"Pomodoro Timer\"\n description=\"Focus with the Pomodoro Technique\"\n purpose=\"Work in focused sprints with prompted short and long breaks — configure a cadence that fits your rhythm and build a deep-work streak you can measure.\"\n >\n <PhoneViewLink path=\"/mobile/timer\" />\n <NextSteps\n storageKey=\"timecampus-pomodoro\"\n className=\"mb-6\"\n steps={[\n {\n id: \"start\",\n label: \"Start a focus session\",\n description: \"Begin a 25-minute sprint on one task.\",\n onClick: () => handleStart(),\n },\n {\n id: \"analytics\",\n label: \"Review your pomodoro stats\",\n description: \"See streaks, completion rate and focus time.\",\n onClick: () => navigate(\"/pomodoro/analytics\"),\n },\n {\n id: \"settings\",\n label: \"Tune your intervals\",\n description: \"Adjust focus and break lengths to fit you.\",\n onClick: () => navigate(\"/pomodoro/settings\"),\n },\n ]}\n />\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n <StatCard\n title=\"Sessions Today\"\n value={String(stats?.completedSessions ?? 0)}\n description={`Total: ${stats?.totalSessions ?? 0} sessions`}\n />\n <StatCard\n title=\"Focus Time\"\n value={`${totalFocusH}h ${totalFocusM}m`}\n trend={{\n value: stats?.completionRate ?? 0,\n label: \"completion rate\",\n }}\n />\n <StatCard\n title=\"Current Streak\"\n value={`${stats?.streakDays ?? 0} days`}\n description={`Avg: ${stats?.averageSessionMinutes ?? 0}m per session`}\n />\n </div>\n\n <div className=\"mx-auto max-w-md\">\n <GlassCard treatment=\"glass\" glow className=\"p-8 text-center\">\n <div className=\"mb-2\">\n <span\n aria-live=\"polite\"\n className=\"inline-flex rounded-full bg-action-primary-bg/10 px-3 py-1 text-xs font-medium text-primary\"\n >\n {phaseLabel}\n </span>\n </div>\n <p className=\"text-7xl font-mono font-bold text-text-primary\">\n {formatTimer(timerSeconds)}\n </p>\n <p className=\"mt-2 text-sm text-text-secondary\">\n {stats\n ? `${stats.completedSessions} of ${stats.totalSessions} sessions`\n : \"No sessions yet\"}\n </p>\n <div className=\"mt-6 flex items-center justify-center gap-3\">\n {!isRunning ? (\n <button\n onClick={handleStart}\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\"\n >\n <Play className=\"h-4 w-4\" />\n {startLabel}\n </button>\n ) : (\n <button\n onClick={() => setIsRunning(false)}\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\"\n >\n <Pause className=\"h-4 w-4\" />\n Pause\n </button>\n )}\n <button\n onClick={handleComplete}\n disabled={!activeSession}\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 >\n <SkipForward className=\"h-4 w-4\" />\n Skip\n </button>\n <button\n onClick={() => void handleReset()}\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\"\n >\n <RotateCcw className=\"h-4 w-4\" />\n Reset\n </button>\n </div>\n </GlassCard>\n </div>\n\n {/* Focus Goals */}\n <GlassCard treatment=\"glass\" className=\"p-6\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h3 className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <Target className=\"h-4 w-4\" />\n Focus Goals\n </h3>\n <button\n onClick={openCreateGoal}\n className=\"inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90\"\n >\n <Plus className=\"h-4 w-4\" />\n Add Goal\n </button>\n </div>\n {goals.length === 0 ? (\n <p className=\"py-6 text-center text-sm text-text-secondary\">\n No focus goals yet. Set a daily or weekly target to build a\n consistent focus habit.\n </p>\n ) : (\n <div className=\"space-y-3\">\n {goals.map((goal: PomodoroGoalFieldsFragment) => {\n const pct = goal.target\n ? Math.min(100, Math.round((goal.current / goal.target) * 100))\n : 0;\n return (\n <div\n key={goal.id}\n className=\"rounded-lg border border-border-subtle p-4\"\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium capitalize text-text-primary\">\n {goal.type.toLowerCase()} goal\n </p>\n <p className=\"text-xs text-text-secondary\">\n {goal.current} of {goal.target} sessions\n </p>\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm font-medium text-text-primary\">\n {pct}%\n </span>\n <button\n onClick={() => openEditGoal(goal)}\n className=\"rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary\"\n aria-label=\"Edit goal\"\n >\n <Pencil className=\"h-4 w-4\" />\n </button>\n <button\n onClick={() => setDeletingGoalEntry(goal)}\n className=\"rounded-md p-1.5 text-text-secondary hover:bg-status-error-bg hover:text-status-error-text\"\n aria-label=\"Delete goal\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n <div className=\"mt-3 h-2 w-full rounded-full bg-bg-sunken\">\n <div\n className=\"h-2 rounded-full bg-action-primary-bg\"\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n })}\n </div>\n )}\n </GlassCard>\n\n {/* Goal create/edit modal */}\n <Modal\n open={goalModalOpen}\n onClose={() => setGoalModalOpen(false)}\n title={editingGoal ? \"Edit Focus Goal\" : \"Add Focus Goal\"}\n description=\"Set a target number of focus sessions\"\n footer={\n <>\n <button\n onClick={() => setGoalModalOpen(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 Cancel\n </button>\n <button\n onClick={handleSaveGoal}\n disabled={\n creatingGoal || updatingGoal || Number(goalForm.target) <= 0\n }\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 {creatingGoal || updatingGoal\n ? \"Saving...\"\n : editingGoal\n ? \"Save Changes\"\n : \"Add Goal\"}\n </button>\n </>\n }\n >\n {(createGoalError || updateGoalError) && (\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 Failed to save goal. Please try again.\n </div>\n )}\n <div className=\"space-y-4\">\n <div>\n <label className={labelClasses}>Goal Type</label>\n <select\n value={goalForm.type}\n onChange={(e) => {\n const type = e.target.value as PomodoroGoalType;\n setGoalForm((f) => ({\n ...f,\n type,\n period: type,\n endDate:\n type === PomodoroGoalType.Daily\n ? futureInput(0)\n : type === PomodoroGoalType.Weekly\n ? futureInput(7)\n : futureInput(30),\n }));\n }}\n className={inputClasses}\n >\n <option value={PomodoroGoalType.Daily}>Daily</option>\n <option value={PomodoroGoalType.Weekly}>Weekly</option>\n <option value={PomodoroGoalType.Monthly}>Monthly</option>\n </select>\n </div>\n <div>\n <label className={labelClasses}>Target Sessions</label>\n <input\n type=\"number\"\n min=\"1\"\n placeholder=\"8\"\n value={goalForm.target}\n onChange={(e) => setGoalField(\"target\", e.target.value)}\n className={inputClasses}\n />\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label className={labelClasses}>Start Date</label>\n <input\n type=\"date\"\n value={goalForm.startDate}\n onChange={(e) => setGoalField(\"startDate\", e.target.value)}\n className={inputClasses}\n />\n </div>\n <div>\n <label className={labelClasses}>End Date</label>\n <input\n type=\"date\"\n value={goalForm.endDate}\n onChange={(e) => setGoalField(\"endDate\", e.target.value)}\n className={inputClasses}\n />\n </div>\n </div>\n </div>\n </Modal>\n\n {/* Goal delete confirm modal */}\n <Modal\n open={deletingGoalEntry !== null}\n onClose={() => setDeletingGoalEntry(null)}\n title=\"Delete Focus Goal\"\n size=\"sm\"\n footer={\n <>\n <button\n onClick={() => setDeletingGoalEntry(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 Cancel\n </button>\n <button\n onClick={handleDeleteGoal}\n disabled={deletingGoal}\n className=\"rounded-md bg-status-error-bg px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg/90 disabled:opacity-50\"\n >\n {deletingGoal ? \"Deleting...\" : \"Delete\"}\n </button>\n </>\n }\n >\n {deleteGoalError && (\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 Failed to delete goal. Please try again.\n </div>\n )}\n <p className=\"text-sm text-text-secondary\">\n Are you sure you want to delete this{\" \"}\n {deletingGoalEntry?.type.toLowerCase()} focus goal? This action cannot\n be undone.\n </p>\n </Modal>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoDA,IAAMC,IACJ,wIACIC,IAAe;AAErB,SAASC,EAAY,GAAqB;CACxC,IAAMC,IAAI,IAAI,KAAKC,CAAG;CAGtB,OAFI,OAAO,MAAMD,EAAE,QAAQ,CAAC,IAAU,sBAE/B,IADW,KAAKA,EAAE,QAAQ,IAAIA,EAAE,kBAAkB,IAAI,GACtD,EAAA,CAAM,YAAY,CAAC,CAAC,MAAM,GAAG,EAAE;AACxC;AAEA,SAASE,IAAqB;CAC5B,IAAMF,oBAAI,IAAI,KAAK;CAEnB,wBAAO,IADW,KAAKA,EAAE,QAAQ,IAAIA,EAAE,kBAAkB,IAAI,GACtD,EAAA,CAAM,YAAY,CAAC,CAAC,MAAM,GAAG,EAAE;AACxC;AAEA,SAASG,EAAY,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ACL,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;QAAO,WAAWC;QAAc,UAAA;OAAiB,CAAA,GACjD,kBAAC,SAAD;QACE,MAAK;QACL,OAAO8D,EAAS;QAChB,WAAW,MAAME,EAAa,aAAa,EAAE,OAAO,KAAK;QACzD,WAAWjE;OACZ,CAAA,CACE,EAAA,CAAA,GACL,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;QAAO,WAAWC;QAAc,UAAA;OAAe,CAAA,GAC/C,kBAAC,SAAD;QACE,MAAK;QACL,OAAO8D,EAAS;QAChB,WAAW,MAAME,EAAa,WAAW,EAAE,OAAO,KAAK;QACvD,WAAWjE;OACZ,CAAA,CACE,EAAA,CAAA,CACF;;KACF;IACA,CAAA,CAAA;;GAGP,kBAACkI,GAAD;IACE,MAAMrE,MAAsB;IAC5B,eAAeC,EAAqB,IAAI;IACxC,OAAM;IACN,MAAK;IACL,QACE,kBAAA/D,GAAA,EAAA,UAAA,CACE,kBAAC,UAAD;KACE,eAAe+D,EAAqB,IAAI;KACxC,WAAU;KACX,UAAA;IAEO,CAAA,GACR,kBAAC,UAAD;KACE,SAASW;KACT,UAAUpB;KACV,WAAU;KAET,UAAAA,IAAe,gBAAgB;IAC1B,CAAA,CACR,EAAA,CAAA;IApBN,UAAA,CAuBGC,MACC,kBAAC,OAAD;KAAK,WAAU;KAAyG,UAAA;IAEnH,CAAA,GAEP,kBAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MAA2C;MACJ;MACpCO,GAAmB,KAAK,YAAY;MAAE;KAEtC;IACE,CAAA,CAAA;;EACG;;AAEhB"}
|
|
1
|
+
{"version":3,"file":"PomodoroPage.js","names":["_Fragment","inputClasses","labelClasses","toDateInput","d","iso","todayInput","futureInput","days","toGoalState","goal","PomodoroGoalType","PomodoroPage","useTimeCampus","navigate","useTimeCampusNavigate","statsData","statsLoading","statsError","useGetPomodoroStatsQuery","workspaceId","activeData","activeLoading","activeError","useGetActivePomodoroSessionQuery","settingsData","settingsLoading","settingsError","useGetPomodoroSettingsQuery","recentSessionsData","useListPomodoroSessionsQuery","PomodoroSessionOrderByField","TimeCampusSortDirection","startSession","useStartPomodoroSessionMutation","completeSession","useCompletePomodoroSessionMutation","analytics","useTimeCampusAnalytics","interruptSession","useInterruptPomodoroSessionMutation","goalsData","refetchGoals","useListPomodoroGoalsQuery","goals","createGoal","creatingGoal","createGoalError","useCreatePomodoroGoalMutation","updateGoal","updatingGoal","updateGoalError","useUpdatePomodoroGoalMutation","deleteGoal","deletingGoal","deleteGoalError","useDeletePomodoroGoalMutation","goalModalOpen","setGoalModalOpen","useState","editingGoal","setEditingGoal","deletingGoalEntry","setDeletingGoalEntry","goalForm","setGoalForm","setGoalField","f","key","v","openCreateGoal","openEditGoal","handleSaveGoal","target","handleDeleteGoal","stats","activeSession","settings","lastSession","timerSeconds","setTimerSeconds","isRunning","setIsRunning","nextSessionType","setNextSessionType","PomodoroSessionType","completingSessionRef","useRef","getDuration","useCallback","durationForSession","type","getNextSessionType","focusSessions","nextSessionAfter","completedType","useEffect","next","elapsed","duration","remaining","handleComplete","completed","timeout","previous","formatTimer","m","seconds","s","handleStart","handleReset","PageLayout","LoadingSkeleton","totalFocusH","totalFocusM","displayedSessionType","phaseLabel","startLabel","PhoneViewLink","NextSteps","StatCard","GlassCard","Pause","Play","SkipForward","RotateCcw","Target","Plus","pct","Pencil","Trash2","Modal","Fragment","ThemedSelect"],"sources":["../../../../src/timecampus/pages/pomodoro/PomodoroPage.tsx"],"sourcesContent":["import { useState, useEffect, useCallback, useRef } from \"react\";\nimport { PhoneViewLink } from \"../mobile/MobileScreen\";\nimport {\n Play,\n Pause,\n SkipForward,\n RotateCcw,\n Target,\n Plus,\n Pencil,\n Trash2,\n} from \"lucide-react\";\nimport { GlassCard, NextSteps, ThemedSelect } from \"@burdenoff/fe-libs/ui\";\nimport { PageLayout } from \"../../components/PageLayout\";\nimport { StatCard } from \"../../components/StatCard\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport { Modal } from \"../../components/Modal\";\nimport {\n useTimeCampus,\n useTimeCampusNavigate,\n} from \"../../providers/TimeCampusProvider\";\nimport {\n useGetActivePomodoroSessionQuery,\n useGetPomodoroSettingsQuery,\n useGetPomodoroStatsQuery,\n useListPomodoroSessionsQuery,\n useStartPomodoroSessionMutation,\n useCompletePomodoroSessionMutation,\n useInterruptPomodoroSessionMutation,\n useListPomodoroGoalsQuery,\n useCreatePomodoroGoalMutation,\n useUpdatePomodoroGoalMutation,\n useDeletePomodoroGoalMutation,\n type PomodoroGoalFieldsFragment,\n} from \"@/generated/wspace-operations\";\nimport { useTimeCampusAnalytics } from \"../../analytics\";\nimport {\n PomodoroGoalType,\n PomodoroSessionOrderByField,\n PomodoroSessionType,\n TimeCampusSortDirection,\n} from \"@/generated/wspace-types\";\nimport { durationForSession, nextSessionAfter } from \"./pomodoroDuration\";\n\ninterface GoalFormState {\n type: PomodoroGoalType;\n target: string;\n period: string;\n startDate: string;\n endDate: string;\n}\n\nconst inputClasses =\n \"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\";\nconst labelClasses = \"block text-sm font-medium text-text-primary\";\n\nfunction toDateInput(iso: string): string {\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return \"\";\n const local = new Date(d.getTime() - d.getTimezoneOffset() * 60000);\n return local.toISOString().slice(0, 10);\n}\n\nfunction todayInput(): string {\n const d = new Date();\n const local = new Date(d.getTime() - d.getTimezoneOffset() * 60000);\n return local.toISOString().slice(0, 10);\n}\n\nfunction futureInput(days: number): string {\n const d = new Date();\n d.setDate(d.getDate() + days);\n const local = new Date(d.getTime() - d.getTimezoneOffset() * 60000);\n return local.toISOString().slice(0, 10);\n}\n\nfunction toGoalState(goal?: PomodoroGoalFieldsFragment): GoalFormState {\n return {\n type: goal?.type ?? PomodoroGoalType.Daily,\n target: goal?.target != null ? String(goal.target) : \"8\",\n period: goal?.period ?? \"DAILY\",\n startDate: goal?.startDate ? toDateInput(goal.startDate) : todayInput(),\n endDate: goal?.endDate ? toDateInput(goal.endDate) : futureInput(0),\n };\n}\n\nexport function PomodoroPage() {\n const { workspaceId = \"\" } = useTimeCampus();\n const navigate = useTimeCampusNavigate();\n\n const {\n data: statsData,\n loading: statsLoading,\n error: statsError,\n } = useGetPomodoroStatsQuery({\n variables: { workspaceId },\n skip: !workspaceId,\n });\n\n const {\n data: activeData,\n loading: activeLoading,\n error: activeError,\n } = useGetActivePomodoroSessionQuery({\n variables: { workspaceId },\n skip: !workspaceId,\n });\n\n const {\n data: settingsData,\n loading: settingsLoading,\n error: settingsError,\n } = useGetPomodoroSettingsQuery({\n variables: { workspaceId },\n skip: !workspaceId,\n });\n\n const { data: recentSessionsData } = useListPomodoroSessionsQuery({\n variables: {\n workspaceId,\n orderBy: {\n field: PomodoroSessionOrderByField.StartTime,\n direction: TimeCampusSortDirection.Desc,\n },\n pagination: { limit: 1, offset: 0 },\n },\n skip: !workspaceId,\n });\n\n const [startSession] = useStartPomodoroSessionMutation();\n const [completeSession] = useCompletePomodoroSessionMutation();\n const analytics = useTimeCampusAnalytics();\n const [interruptSession] = useInterruptPomodoroSessionMutation();\n\n // Focus goals\n const { data: goalsData, refetch: refetchGoals } = useListPomodoroGoalsQuery({\n variables: { workspaceId },\n skip: !workspaceId,\n });\n const goals = goalsData?.pomodoroGoals ?? [];\n\n const [createGoal, { loading: creatingGoal, error: createGoalError }] =\n useCreatePomodoroGoalMutation();\n const [updateGoal, { loading: updatingGoal, error: updateGoalError }] =\n useUpdatePomodoroGoalMutation();\n const [deleteGoal, { loading: deletingGoal, error: deleteGoalError }] =\n useDeletePomodoroGoalMutation();\n\n const [goalModalOpen, setGoalModalOpen] = useState(false);\n const [editingGoal, setEditingGoal] =\n useState<PomodoroGoalFieldsFragment | null>(null);\n const [deletingGoalEntry, setDeletingGoalEntry] =\n useState<PomodoroGoalFieldsFragment | null>(null);\n const [goalForm, setGoalForm] = useState<GoalFormState>(toGoalState());\n\n const setGoalField = <K extends keyof GoalFormState>(\n key: K,\n v: GoalFormState[K],\n ) => setGoalForm((f) => ({ ...f, [key]: v }));\n\n const openCreateGoal = () => {\n setEditingGoal(null);\n setGoalForm(toGoalState());\n setGoalModalOpen(true);\n };\n\n const openEditGoal = (goal: PomodoroGoalFieldsFragment) => {\n setEditingGoal(goal);\n setGoalForm(toGoalState(goal));\n setGoalModalOpen(true);\n };\n\n const handleSaveGoal = async () => {\n if (!workspaceId) return;\n const target = Number(goalForm.target);\n if (!target || target <= 0) return;\n if (editingGoal) {\n await updateGoal({\n variables: {\n id: editingGoal.id,\n workspaceId,\n input: {\n type: goalForm.type,\n target,\n period: goalForm.period.trim() || goalForm.type,\n startDate: new Date(goalForm.startDate).toISOString(),\n endDate: new Date(goalForm.endDate).toISOString(),\n },\n },\n });\n } else {\n await createGoal({\n variables: {\n input: {\n workspaceId,\n type: goalForm.type,\n target,\n period: goalForm.period.trim() || goalForm.type,\n startDate: new Date(goalForm.startDate).toISOString(),\n endDate: new Date(goalForm.endDate).toISOString(),\n },\n },\n });\n }\n setGoalModalOpen(false);\n await refetchGoals();\n };\n\n const handleDeleteGoal = async () => {\n if (!deletingGoalEntry || !workspaceId) return;\n await deleteGoal({\n variables: { id: deletingGoalEntry.id, workspaceId },\n });\n setDeletingGoalEntry(null);\n await refetchGoals();\n };\n\n const stats = statsData?.pomodoroStats;\n const activeSession = activeData?.activePomodoroSession;\n const settings = settingsData?.pomodoroSettings;\n const lastSession = recentSessionsData?.pomodoroSessions[0];\n\n const [timerSeconds, setTimerSeconds] = useState(25 * 60);\n const [isRunning, setIsRunning] = useState(false);\n const [nextSessionType, setNextSessionType] = useState(\n PomodoroSessionType.Focus,\n );\n const completingSessionRef = useRef<string | null>(null);\n\n const getDuration = useCallback(\n (type: PomodoroSessionType) => durationForSession(type, settings),\n [settings],\n );\n\n const getNextSessionType = useCallback(\n (completedType: PomodoroSessionType) => {\n const focusSessions = (stats?.completedSessions ?? 0) + 1;\n return nextSessionAfter(\n completedType,\n focusSessions,\n settings?.sessionsBeforeLongBreak ?? 4,\n );\n },\n [settings?.sessionsBeforeLongBreak, stats?.completedSessions],\n );\n\n useEffect(() => {\n if (activeSession || !lastSession?.completed) return;\n const next = nextSessionAfter(\n lastSession.type,\n stats?.completedSessions ?? 0,\n settings?.sessionsBeforeLongBreak ?? 4,\n );\n setNextSessionType(next);\n setTimerSeconds(getDuration(next));\n }, [activeSession, getDuration, lastSession, settings, stats]);\n\n useEffect(() => {\n if (activeSession && !activeSession.completed) {\n const elapsed = Math.floor(\n (Date.now() - new Date(activeSession.startTime).getTime()) / 1000,\n );\n const duration =\n activeSession.duration ?? getDuration(activeSession.type);\n const remaining = Math.max(0, duration - elapsed);\n setTimerSeconds(remaining);\n setIsRunning(remaining > 0);\n }\n }, [activeSession, getDuration]);\n\n const handleComplete = useCallback(async () => {\n if (!activeSession || !workspaceId) return;\n if (completingSessionRef.current === activeSession.id) return;\n completingSessionRef.current = activeSession.id;\n try {\n const result = await completeSession({\n variables: { id: activeSession.id, workspaceId },\n refetchQueries: [\n \"GetActivePomodoroSession\",\n \"GetPomodoroStats\",\n \"ListPomodoroSessions\",\n ],\n awaitRefetchQueries: true,\n });\n const completed = result.data?.completePomodoroSession;\n if (completed) analytics.pomodoroCompleted(completed.id);\n const next = getNextSessionType(activeSession.type);\n setNextSessionType(next);\n setTimerSeconds(getDuration(next));\n setIsRunning(false);\n } finally {\n completingSessionRef.current = null;\n }\n }, [\n activeSession,\n analytics,\n completeSession,\n getDuration,\n getNextSessionType,\n workspaceId,\n ]);\n\n useEffect(() => {\n if (timerSeconds <= 0) {\n setIsRunning(false);\n void handleComplete();\n return;\n }\n if (!isRunning) return;\n const timeout = window.setTimeout(\n () => setTimerSeconds((previous) => Math.max(0, previous - 1)),\n 1000,\n );\n return () => window.clearTimeout(timeout);\n }, [handleComplete, isRunning, timerSeconds]);\n\n const formatTimer = (seconds: number) => {\n const m = Math.floor(seconds / 60);\n const s = seconds % 60;\n return `${String(m).padStart(2, \"0\")}:${String(s).padStart(2, \"0\")}`;\n };\n\n const handleStart = useCallback(async () => {\n if (!workspaceId) return;\n if (activeSession && !activeSession.completed) {\n setIsRunning(true);\n return;\n }\n const type = nextSessionType;\n await startSession({\n variables: { input: { workspaceId, type } },\n refetchQueries: [\"GetActivePomodoroSession\", \"GetPomodoroStats\"],\n awaitRefetchQueries: true,\n });\n setTimerSeconds(getDuration(type));\n setIsRunning(true);\n }, [workspaceId, activeSession, getDuration, nextSessionType, startSession]);\n\n const handleReset = async () => {\n setIsRunning(false);\n if (activeSession && workspaceId) {\n await interruptSession({\n variables: {\n id: activeSession.id,\n workspaceId,\n reason: \"Reset by user\",\n },\n refetchQueries: [\n \"GetActivePomodoroSession\",\n \"GetPomodoroStats\",\n \"ListPomodoroSessions\",\n ],\n awaitRefetchQueries: true,\n });\n setNextSessionType(activeSession.type);\n }\n setTimerSeconds(getDuration(activeSession?.type ?? nextSessionType));\n };\n\n if (statsLoading || activeLoading || settingsLoading) {\n return (\n <PageLayout\n title=\"Pomodoro Timer\"\n description=\"Focus with the Pomodoro Technique\"\n >\n <LoadingSkeleton variant=\"card\" count={3} />\n </PageLayout>\n );\n }\n\n if (statsError || activeError || settingsError) {\n return (\n <PageLayout\n title=\"Pomodoro Timer\"\n description=\"Focus with the Pomodoro Technique\"\n >\n <div className=\"rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text\">\n Failed to load pomodoro data. Please try again later.\n </div>\n </PageLayout>\n );\n }\n\n const totalFocusH = Math.floor((stats?.totalFocusMinutes ?? 0) / 60);\n const totalFocusM = (stats?.totalFocusMinutes ?? 0) % 60;\n const displayedSessionType = activeSession?.type ?? nextSessionType;\n const phaseLabel =\n displayedSessionType === PomodoroSessionType.ShortBreak\n ? activeSession\n ? \"Short Break\"\n : \"Short Break Ready\"\n : displayedSessionType === PomodoroSessionType.LongBreak\n ? activeSession\n ? \"Long Break\"\n : \"Long Break Ready\"\n : activeSession\n ? \"Focus Session\"\n : \"Focus Ready\";\n const startLabel =\n displayedSessionType === PomodoroSessionType.ShortBreak\n ? \"Start Short Break\"\n : displayedSessionType === PomodoroSessionType.LongBreak\n ? \"Start Long Break\"\n : \"Start Focus\";\n\n return (\n <PageLayout\n title=\"Pomodoro Timer\"\n description=\"Focus with the Pomodoro Technique\"\n purpose=\"Work in focused sprints with prompted short and long breaks — configure a cadence that fits your rhythm and build a deep-work streak you can measure.\"\n >\n <PhoneViewLink path=\"/mobile/timer\" />\n <NextSteps\n storageKey=\"timecampus-pomodoro\"\n className=\"mb-6\"\n steps={[\n {\n id: \"start\",\n label: \"Start a focus session\",\n description: \"Begin a 25-minute sprint on one task.\",\n onClick: () => handleStart(),\n },\n {\n id: \"analytics\",\n label: \"Review your pomodoro stats\",\n description: \"See streaks, completion rate and focus time.\",\n onClick: () => navigate(\"/pomodoro/analytics\"),\n },\n {\n id: \"settings\",\n label: \"Tune your intervals\",\n description: \"Adjust focus and break lengths to fit you.\",\n onClick: () => navigate(\"/pomodoro/settings\"),\n },\n ]}\n />\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n <StatCard\n title=\"Sessions Today\"\n value={String(stats?.completedSessions ?? 0)}\n description={`Total: ${stats?.totalSessions ?? 0} sessions`}\n />\n <StatCard\n title=\"Focus Time\"\n value={`${totalFocusH}h ${totalFocusM}m`}\n trend={{\n value: stats?.completionRate ?? 0,\n label: \"completion rate\",\n }}\n />\n <StatCard\n title=\"Current Streak\"\n value={`${stats?.streakDays ?? 0} days`}\n description={`Avg: ${stats?.averageSessionMinutes ?? 0}m per session`}\n />\n </div>\n\n <div className=\"mx-auto max-w-md\">\n <GlassCard treatment=\"glass\" glow className=\"p-8 text-center\">\n <div className=\"mb-2\">\n <span\n aria-live=\"polite\"\n className=\"inline-flex rounded-full bg-action-primary-bg/10 px-3 py-1 text-xs font-medium text-primary\"\n >\n {phaseLabel}\n </span>\n </div>\n <p className=\"text-7xl font-mono font-bold text-text-primary\">\n {formatTimer(timerSeconds)}\n </p>\n <p className=\"mt-2 text-sm text-text-secondary\">\n {stats\n ? `${stats.completedSessions} of ${stats.totalSessions} sessions`\n : \"No sessions yet\"}\n </p>\n <div className=\"mt-6 flex items-center justify-center gap-3\">\n {!isRunning ? (\n <button\n onClick={handleStart}\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\"\n >\n <Play className=\"h-4 w-4\" />\n {startLabel}\n </button>\n ) : (\n <button\n onClick={() => setIsRunning(false)}\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\"\n >\n <Pause className=\"h-4 w-4\" />\n Pause\n </button>\n )}\n <button\n onClick={handleComplete}\n disabled={!activeSession}\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 >\n <SkipForward className=\"h-4 w-4\" />\n Skip\n </button>\n <button\n onClick={() => void handleReset()}\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\"\n >\n <RotateCcw className=\"h-4 w-4\" />\n Reset\n </button>\n </div>\n </GlassCard>\n </div>\n\n {/* Focus Goals */}\n <GlassCard treatment=\"glass\" className=\"p-6\">\n <div className=\"mb-4 flex items-center justify-between\">\n <h3 className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <Target className=\"h-4 w-4\" />\n Focus Goals\n </h3>\n <button\n onClick={openCreateGoal}\n className=\"inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90\"\n >\n <Plus className=\"h-4 w-4\" />\n Add Goal\n </button>\n </div>\n {goals.length === 0 ? (\n <p className=\"py-6 text-center text-sm text-text-secondary\">\n No focus goals yet. Set a daily or weekly target to build a\n consistent focus habit.\n </p>\n ) : (\n <div className=\"space-y-3\">\n {goals.map((goal: PomodoroGoalFieldsFragment) => {\n const pct = goal.target\n ? Math.min(100, Math.round((goal.current / goal.target) * 100))\n : 0;\n return (\n <div\n key={goal.id}\n className=\"rounded-lg border border-border-subtle p-4\"\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium capitalize text-text-primary\">\n {goal.type.toLowerCase()} goal\n </p>\n <p className=\"text-xs text-text-secondary\">\n {goal.current} of {goal.target} sessions\n </p>\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm font-medium text-text-primary\">\n {pct}%\n </span>\n <button\n onClick={() => openEditGoal(goal)}\n className=\"rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary\"\n aria-label=\"Edit goal\"\n >\n <Pencil className=\"h-4 w-4\" />\n </button>\n <button\n onClick={() => setDeletingGoalEntry(goal)}\n className=\"rounded-md p-1.5 text-text-secondary hover:bg-status-error-bg hover:text-status-error-text\"\n aria-label=\"Delete goal\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n <div className=\"mt-3 h-2 w-full rounded-full bg-bg-sunken\">\n <div\n className=\"h-2 rounded-full bg-action-primary-bg\"\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n })}\n </div>\n )}\n </GlassCard>\n\n {/* Goal create/edit modal */}\n <Modal\n open={goalModalOpen}\n onClose={() => setGoalModalOpen(false)}\n title={editingGoal ? \"Edit Focus Goal\" : \"Add Focus Goal\"}\n description=\"Set a target number of focus sessions\"\n footer={\n <>\n <button\n onClick={() => setGoalModalOpen(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 Cancel\n </button>\n <button\n onClick={handleSaveGoal}\n disabled={\n creatingGoal || updatingGoal || Number(goalForm.target) <= 0\n }\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 {creatingGoal || updatingGoal\n ? \"Saving...\"\n : editingGoal\n ? \"Save Changes\"\n : \"Add Goal\"}\n </button>\n </>\n }\n >\n {(createGoalError || updateGoalError) && (\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 Failed to save goal. Please try again.\n </div>\n )}\n <div className=\"space-y-4\">\n <div>\n <label className={labelClasses}>Goal Type</label>\n <ThemedSelect\n value={goalForm.type}\n onChange={(e) => {\n const type = e.target.value as PomodoroGoalType;\n setGoalForm((f) => ({\n ...f,\n type,\n period: type,\n endDate:\n type === PomodoroGoalType.Daily\n ? futureInput(0)\n : type === PomodoroGoalType.Weekly\n ? futureInput(7)\n : futureInput(30),\n }));\n }}\n className={inputClasses}\n >\n <option value={PomodoroGoalType.Daily}>Daily</option>\n <option value={PomodoroGoalType.Weekly}>Weekly</option>\n <option value={PomodoroGoalType.Monthly}>Monthly</option>\n </ThemedSelect>\n </div>\n <div>\n <label className={labelClasses}>Target Sessions</label>\n <input\n type=\"number\"\n min=\"1\"\n placeholder=\"8\"\n value={goalForm.target}\n onChange={(e) => setGoalField(\"target\", e.target.value)}\n className={inputClasses}\n />\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label className={labelClasses}>Start Date</label>\n <input\n type=\"date\"\n value={goalForm.startDate}\n onChange={(e) => setGoalField(\"startDate\", e.target.value)}\n className={inputClasses}\n />\n </div>\n <div>\n <label className={labelClasses}>End Date</label>\n <input\n type=\"date\"\n value={goalForm.endDate}\n onChange={(e) => setGoalField(\"endDate\", e.target.value)}\n className={inputClasses}\n />\n </div>\n </div>\n </div>\n </Modal>\n\n {/* Goal delete confirm modal */}\n <Modal\n open={deletingGoalEntry !== null}\n onClose={() => setDeletingGoalEntry(null)}\n title=\"Delete Focus Goal\"\n size=\"sm\"\n footer={\n <>\n <button\n onClick={() => setDeletingGoalEntry(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 Cancel\n </button>\n <button\n onClick={handleDeleteGoal}\n disabled={deletingGoal}\n className=\"rounded-md bg-status-error-bg px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg/90 disabled:opacity-50\"\n >\n {deletingGoal ? \"Deleting...\" : \"Delete\"}\n </button>\n </>\n }\n >\n {deleteGoalError && (\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 Failed to delete goal. Please try again.\n </div>\n )}\n <p className=\"text-sm text-text-secondary\">\n Are you sure you want to delete this{\" \"}\n {deletingGoalEntry?.type.toLowerCase()} focus goal? This action cannot\n be undone.\n </p>\n </Modal>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoDA,IAAMC,IACJ,wIACIC,IAAe;AAErB,SAASC,EAAY,GAAqB;CACxC,IAAMC,IAAI,IAAI,KAAKC,CAAG;CAGtB,OAFI,OAAO,MAAMD,EAAE,QAAQ,CAAC,IAAU,sBAE/B,IADW,KAAKA,EAAE,QAAQ,IAAIA,EAAE,kBAAkB,IAAI,GACtD,EAAA,CAAM,YAAY,CAAC,CAAC,MAAM,GAAG,EAAE;AACxC;AAEA,SAASE,IAAqB;CAC5B,IAAMF,oBAAI,IAAI,KAAK;CAEnB,wBAAO,IADW,KAAKA,EAAE,QAAQ,IAAIA,EAAE,kBAAkB,IAAI,GACtD,EAAA,CAAM,YAAY,CAAC,CAAC,MAAM,GAAG,EAAE;AACxC;AAEA,SAASG,EAAY,GAAsB;CACzC,IAAMH,oBAAI,IAAI,KAAK;CAGnB,OAFAA,EAAE,QAAQA,EAAE,QAAQ,IAAII,CAAI,oBAErB,IADW,KAAKJ,EAAE,QAAQ,IAAIA,EAAE,kBAAkB,IAA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