@burdenoff/microfe-timecampus 2026.1202.1 → 2026.1203.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/timecampus/components/Toast.js +1 -1
- package/dist/timecampus/components/Toast.js.map +1 -1
- package/dist/timecampus/components/charts/Heatmap.js +1 -1
- package/dist/timecampus/components/charts/Heatmap.js.map +1 -1
- package/dist/timecampus/components/maps/LocationGeofenceMap.js +3 -3
- package/dist/timecampus/components/maps/LocationGeofenceMap.js.map +1 -1
- package/dist/timecampus/pages/HomePage.js +1 -1
- package/dist/timecampus/pages/HomePage.js.map +1 -1
- package/dist/timecampus/pages/admin/AdminPage.js +20 -20
- package/dist/timecampus/pages/admin/AdminPage.js.map +1 -1
- package/dist/timecampus/pages/application-usage/ApplicationUsagePage.js +1 -1
- package/dist/timecampus/pages/application-usage/ApplicationUsagePage.js.map +1 -1
- package/dist/timecampus/pages/channels/ChannelsPage.js +8 -8
- package/dist/timecampus/pages/channels/ChannelsPage.js.map +1 -1
- package/dist/timecampus/pages/client-portal/ClientPortalPage.js +2 -2
- package/dist/timecampus/pages/client-portal/ClientPortalPage.js.map +1 -1
- package/dist/timecampus/pages/extend/AppletDeveloperPage.js +15 -15
- package/dist/timecampus/pages/extend/AppletDeveloperPage.js.map +1 -1
- package/dist/timecampus/pages/extend/AppletReviewPage.js +2 -2
- package/dist/timecampus/pages/extend/AppletReviewPage.js.map +1 -1
- package/dist/timecampus/pages/extend/AppletStorePage.js +2 -2
- package/dist/timecampus/pages/extend/AppletStorePage.js.map +1 -1
- package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js +2 -2
- package/dist/timecampus/pages/extend/MarketplaceCertificationPage.js.map +1 -1
- package/dist/timecampus/pages/extend/TimeTriggersPage.js +1 -1
- package/dist/timecampus/pages/extend/TimeTriggersPage.js.map +1 -1
- package/dist/timecampus/pages/focus/FocusProtectionPage.js +4 -4
- package/dist/timecampus/pages/focus/FocusProtectionPage.js.map +1 -1
- package/dist/timecampus/pages/geofencing/GeofencingPage.js +6 -6
- package/dist/timecampus/pages/geofencing/GeofencingPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/LifeBalancePage.js +3 -3
- package/dist/timecampus/pages/lifetime/LifeBalancePage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/RecommendationsPage.js +1 -1
- package/dist/timecampus/pages/lifetime/RecommendationsPage.js.map +1 -1
- package/dist/timecampus/pages/location-tracking/LocationTrackingPage.js +2 -2
- package/dist/timecampus/pages/location-tracking/LocationTrackingPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingDetailPage.js +1 -1
- package/dist/timecampus/pages/meetings/MeetingDetailPage.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingFormModal.js +1 -1
- package/dist/timecampus/pages/meetings/MeetingFormModal.js.map +1 -1
- package/dist/timecampus/pages/meetings/MeetingsPage.js +1 -1
- package/dist/timecampus/pages/meetings/MeetingsPage.js.map +1 -1
- package/dist/timecampus/pages/mobile/MobileScreen.js +1 -1
- package/dist/timecampus/pages/mobile/MobileScreen.js.map +1 -1
- package/dist/timecampus/pages/mobile/MobileTimelinePage.js +8 -8
- package/dist/timecampus/pages/mobile/MobileTimelinePage.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroAnalyticsPage.js +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroAnalyticsPage.js.map +1 -1
- package/dist/timecampus/pages/pomodoro/PomodoroSettingsPage.js +3 -3
- package/dist/timecampus/pages/pomodoro/PomodoroSettingsPage.js.map +1 -1
- package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js +6 -6
- package/dist/timecampus/pages/resource-planning/ResourcePlanningPage.js.map +1 -1
- package/dist/timecampus/pages/settings/SettingsPage.js +3 -3
- package/dist/timecampus/pages/settings/SettingsPage.js.map +1 -1
- package/dist/timecampus/pages/team/TeamMembersPage.js +1 -1
- package/dist/timecampus/pages/team/TeamMembersPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimeEntriesPage.js +6 -6
- package/dist/timecampus/pages/time/TimeEntriesPage.js.map +1 -1
- package/dist/timecampus/pages/time/TimerPage.js +1 -1
- package/dist/timecampus/pages/time/TimerPage.js.map +1 -1
- package/dist/timecampus/pages/time-approval/SubmitTimesheetModal.js +1 -1
- package/dist/timecampus/pages/time-approval/SubmitTimesheetModal.js.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.js +4 -4
- package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
- package/package.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MeetingsPage.js","names":["_Fragment","PAGE_SIZE","MEETING_TYPE_LABELS","MeetingType","meetingTypeLabel","type","idMonogram","id","ParticipantAvatars","shown","participants","overflow","p","StarRating","value","rating","Star","cn","v","MeetingsPage","useTimeCampus","navigate","useTimeCampusNavigate","limit","setLimit","useState","createOpen","setCreateOpen","editing","setEditing","deleting","setDeleting","useListMeetingsQuery","workspaceId","createMeeting","creating","createError","useCreateMeetingMutation","analytics","useTimeCampusAnalytics","updateMeeting","updating","updateError","useUpdateMeetingMutation","deleteMeeting","deletingLoading","useDeleteMeetingMutation","meetings","data","hasMore","handleCreate","created","refetch","handleUpdate","handleDelete","handleLoadMore","nextLimit","fetchMore","addButton","Plus","loading","PageLayout","LoadingSkeleton","error","EmptyState","Fragment","GlassCard","meeting","e","CalendarDays","Video","formatDate","formatTime","StatusBadge","formatCurrency","Pencil","Trash2","MeetingFormModal","Modal"],"sources":["../../../../src/timecampus/pages/meetings/MeetingsPage.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { CalendarDays, Plus, Video, Pencil, Trash2, Star } from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { PageLayout } from \"../../components/PageLayout\";\nimport { StatusBadge } from \"../../components/StatusBadge\";\nimport { EmptyState } from \"../../components/EmptyState\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport { Modal } from \"../../components/Modal\";\nimport {\n cn,\n formatCurrency,\n formatDate,\n formatTime,\n} from \"../../utils/helpers\";\nimport {\n useTimeCampus,\n useTimeCampusNavigate,\n} from \"../../providers/TimeCampusProvider\";\nimport {\n useListMeetingsQuery,\n useCreateMeetingMutation,\n useUpdateMeetingMutation,\n useDeleteMeetingMutation,\n type MeetingFieldsFragment,\n} from \"@/generated/wspace-operations\";\nimport { useTimeCampusAnalytics } from \"../../analytics\";\nimport {\n MeetingType,\n type CreateMeetingInput,\n type UpdateMeetingInput,\n} from \"@/generated/wspace-types\";\nimport { MeetingFormModal } from \"./MeetingFormModal\";\n\nconst PAGE_SIZE = 25;\n\nconst MEETING_TYPE_LABELS: Record<MeetingType, string> = {\n [MeetingType.Standup]: \"Standup\",\n [MeetingType.OneOnOne]: \"1-on-1\",\n [MeetingType.Team]: \"Team\",\n [MeetingType.Review]: \"Review\",\n [MeetingType.Planning]: \"Planning\",\n [MeetingType.Retrospective]: \"Retro\",\n [MeetingType.External]: \"External\",\n};\n\nfunction meetingTypeLabel(type: MeetingType): string {\n return MEETING_TYPE_LABELS[type] ?? type;\n}\n\n/** Deterministic 2-char monogram from an opaque participant id. */\nfunction idMonogram(id: string): string {\n return (\n id\n .replace(/[^a-zA-Z0-9]/g, \"\")\n .slice(0, 2)\n .toUpperCase() || \"?\"\n );\n}\n\nfunction ParticipantAvatars({\n participants,\n}: {\n participants: MeetingFieldsFragment[\"participants\"];\n}) {\n const shown = participants.slice(0, 4);\n const overflow = participants.length - shown.length;\n return (\n <div className=\"flex items-center -space-x-2\">\n {shown.map((p) => (\n <span\n key={p.id}\n title={p.userId}\n className=\"flex h-8 w-8 items-center justify-center rounded-full bg-action-primary-bg/10 text-[11px] font-semibold text-primary ring-2 ring-bg-surface\"\n >\n {idMonogram(p.userId)}\n </span>\n ))}\n {overflow > 0 && (\n <span className=\"flex h-8 w-8 items-center justify-center rounded-full bg-bg-sunken text-[11px] font-semibold text-text-secondary ring-2 ring-bg-surface\">\n +{overflow}\n </span>\n )}\n </div>\n );\n}\n\nfunction StarRating({ rating }: { rating: number | null | undefined }) {\n const value = rating ?? 0;\n return (\n <div className=\"flex items-center gap-0.5\">\n {[1, 2, 3, 4, 5].map((v) => (\n <Star\n key={v}\n className={cn(\n \"h-3.5 w-3.5\",\n v <= value\n ? \"fill-status-warning-text text-status-warning-text\"\n : \"text-border-seam\",\n )}\n />\n ))}\n <span className=\"ml-1 text-xs font-medium tabular-nums text-text-secondary\">\n {rating != null ? rating.toFixed(1) : \"—\"}\n </span>\n </div>\n );\n}\n\nexport function MeetingsPage() {\n const { workspaceId = \"\" } = useTimeCampus();\n const navigate = useTimeCampusNavigate();\n\n const [limit, setLimit] = useState(PAGE_SIZE);\n const [createOpen, setCreateOpen] = useState(false);\n const [editing, setEditing] = useState<MeetingFieldsFragment | null>(null);\n const [deleting, setDeleting] = useState<MeetingFieldsFragment | null>(null);\n\n const { data, loading, error, refetch, fetchMore } = useListMeetingsQuery({\n variables: { workspaceId, pagination: { limit, offset: 0 } },\n skip: !workspaceId,\n notifyOnNetworkStatusChange: true,\n });\n\n const [createMeeting, { loading: creating, error: createError }] =\n useCreateMeetingMutation();\n const analytics = useTimeCampusAnalytics();\n const [updateMeeting, { loading: updating, error: updateError }] =\n useUpdateMeetingMutation();\n const [deleteMeeting, { loading: deletingLoading }] =\n useDeleteMeetingMutation();\n\n const meetings = data?.meetings ?? [];\n const hasMore = meetings.length >= limit;\n\n const handleCreate = async (input: CreateMeetingInput) => {\n const result = await createMeeting({ variables: { input } });\n const created = result.data?.createMeeting;\n // Keep the dialog open on failure so the error banner stays visible.\n if (!created) return;\n analytics.meetingCreated({\n meetingId: created.id,\n surface: \"meetings_page\",\n });\n await refetch();\n setCreateOpen(false);\n };\n\n const handleUpdate = async (input: UpdateMeetingInput) => {\n if (!editing) return;\n await updateMeeting({\n variables: { id: editing.id, workspaceId, input },\n });\n await refetch();\n setEditing(null);\n };\n\n const handleDelete = async () => {\n if (!deleting) return;\n await deleteMeeting({\n variables: { id: deleting.id, workspaceId },\n });\n setDeleting(null);\n await refetch();\n };\n\n const handleLoadMore = async () => {\n const nextLimit = limit + PAGE_SIZE;\n setLimit(nextLimit);\n await fetchMore({\n variables: { pagination: { limit: nextLimit, offset: 0 } },\n });\n };\n\n const addButton = (\n <button\n onClick={() => setCreateOpen(true)}\n className=\"inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90\"\n >\n <Plus className=\"h-4 w-4\" />\n Schedule Meeting\n </button>\n );\n\n if (loading && meetings.length === 0) {\n return (\n <PageLayout\n title=\"Meetings\"\n description=\"Schedule and track meetings\"\n actions={addButton}\n >\n <LoadingSkeleton variant=\"list\" count={5} />\n </PageLayout>\n );\n }\n\n if (error) {\n return (\n <PageLayout title=\"Meetings\" description=\"Schedule and track meetings\">\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 meetings. Please try again later.\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title=\"Meetings\"\n description=\"Schedule and track meetings\"\n purpose=\"Keep every meeting and its recording in one place and see how much of your week goes to them — so you can protect focus time, trim low-value calls, and account for meeting hours in your tracking.\"\n actions={addButton}\n >\n {meetings.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title=\"No meetings found\"\n description=\"Schedule your first meeting to start tracking calls and their time impact.\"\n action={addButton}\n />\n ) : (\n <>\n <div className=\"space-y-3\">\n {meetings.map((meeting: MeetingFieldsFragment) => (\n <GlassCard\n key={meeting.id}\n treatment=\"glass\"\n role=\"button\"\n tabIndex={0}\n onClick={() => navigate(`/meetings/${meeting.id}`)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n navigate(`/meetings/${meeting.id}`);\n }\n }}\n className=\"cursor-pointer p-4 transition-colors hover:bg-bg-sunken/30 sm:p-5\"\n >\n <div className=\"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between\">\n {/* Title + meta */}\n <div className=\"flex min-w-0 items-start gap-3\">\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary\">\n <CalendarDays className=\"h-5 w-5\" />\n </div>\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-2\">\n <p className=\"truncate text-sm font-semibold text-text-primary\">\n {meeting.title}\n </p>\n {meeting.recordingUrl && (\n <Video\n className=\"h-3.5 w-3.5 shrink-0 text-primary\"\n aria-label=\"Has recording\"\n />\n )}\n </div>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {formatDate(meeting.startTime)} ·{\" \"}\n {formatTime(meeting.startTime)}\n {meeting.endTime\n ? `–${formatTime(meeting.endTime)}`\n : \"\"}{\" \"}\n · {meeting.duration ?? 0} min\n </p>\n <div className=\"mt-2 flex flex-wrap items-center gap-1.5\">\n <StatusBadge\n label={meetingTypeLabel(meeting.meetingType)}\n variant=\"default\"\n />\n <StatusBadge\n label={meeting.endTime ? \"Completed\" : \"Scheduled\"}\n variant={meeting.endTime ? \"success\" : \"info\"}\n dot\n />\n </div>\n </div>\n </div>\n\n {/* Metrics + actions */}\n <div className=\"flex flex-wrap items-center gap-x-6 gap-y-3 lg:shrink-0 lg:justify-end\">\n <div>\n <p className=\"text-[11px] font-medium uppercase tracking-wide text-text-muted\">\n Est. cost\n </p>\n <p className=\"text-sm font-semibold tabular-nums text-primary\">\n {meeting.cost != null\n ? formatCurrency(meeting.cost)\n : \"—\"}\n </p>\n </div>\n <div>\n <p className=\"text-[11px] font-medium uppercase tracking-wide text-text-muted\">\n Rating\n </p>\n <StarRating rating={meeting.rating} />\n </div>\n <div>\n <p className=\"text-[11px] font-medium uppercase tracking-wide text-text-muted\">\n {meeting.participants.length}{\" \"}\n {meeting.participants.length === 1\n ? \"participant\"\n : \"participants\"}\n </p>\n {meeting.participants.length > 0 ? (\n <div className=\"mt-0.5\">\n <ParticipantAvatars\n participants={meeting.participants}\n />\n </div>\n ) : (\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n None yet\n </p>\n )}\n </div>\n <div className=\"flex items-center gap-1\">\n <button\n onClick={(e) => {\n e.stopPropagation();\n setEditing(meeting);\n }}\n className=\"rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary\"\n aria-label=\"Edit meeting\"\n >\n <Pencil className=\"h-4 w-4\" />\n </button>\n <button\n onClick={(e) => {\n e.stopPropagation();\n setDeleting(meeting);\n }}\n className=\"rounded-md p-1.5 text-text-secondary hover:bg-status-error-bg hover:text-status-error-text\"\n aria-label=\"Delete meeting\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n </div>\n </GlassCard>\n ))}\n </div>\n {hasMore && (\n <div className=\"mt-4 flex justify-center\">\n <button\n onClick={handleLoadMore}\n disabled={loading}\n className=\"rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50\"\n >\n {loading ? \"Loading...\" : \"Load more\"}\n </button>\n </div>\n )}\n </>\n )}\n\n {createOpen && (\n <MeetingFormModal\n open\n onClose={() => setCreateOpen(false)}\n workspaceId={workspaceId}\n submitting={creating}\n error={Boolean(createError)}\n onCreate={handleCreate}\n />\n )}\n\n {editing && (\n <MeetingFormModal\n open\n onClose={() => setEditing(null)}\n workspaceId={workspaceId}\n meeting={editing}\n submitting={updating}\n error={Boolean(updateError)}\n onUpdate={handleUpdate}\n />\n )}\n\n <Modal\n open={Boolean(deleting)}\n onClose={() => setDeleting(null)}\n title=\"Delete meeting\"\n description=\"This permanently removes the meeting and its analytics.\"\n size=\"sm\"\n footer={\n <>\n <button\n onClick={() => setDeleting(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={handleDelete}\n disabled={deletingLoading}\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 {deletingLoading ? \"Deleting...\" : \"Delete\"}\n </button>\n </>\n }\n >\n <p className=\"text-sm text-text-secondary\">\n Are you sure you want to delete{\" \"}\n <span className=\"font-medium text-text-primary\">\n {deleting?.title}\n </span>\n ? This action cannot be undone.\n </p>\n </Modal>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCA,IAAMC,IAAY,IAEZC,IAAmD;EACtDC,EAAY,UAAU;EACtBA,EAAY,WAAW;EACvBA,EAAY,OAAO;EACnBA,EAAY,SAAS;EACrBA,EAAY,WAAW;EACvBA,EAAY,gBAAgB;EAC5BA,EAAY,WAAW;AAC1B;AAEA,SAASC,EAAiB,GAA2B;CACnD,OAAOF,EAAoBG,MAASA;AACtC;AAGA,SAASC,EAAW,GAAoB;CACtC,OACEC,EACG,QAAQ,iBAAiB,EAAE,CAAC,CAC5B,MAAM,GAAG,CAAC,CAAC,CACX,YAAY,KAAK;AAExB;AAEA,SAASC,EAAmB,EAC1B,mBAGC;CACD,IAAMC,IAAQC,EAAa,MAAM,GAAG,CAAC,GAC/BC,IAAWD,EAAa,SAASD,EAAM;CAC7C,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACGA,EAAM,KAAK,MACV,kBAAC,QAAD;GAEE,OAAOG,EAAE;GACT,WAAU;GAET,UAAAN,EAAWM,EAAE,MAAM;EAChB,GALCA,EAAE,EAKH,CACP,GACAD,IAAW,KACV,kBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CAA0J,KACtJA,CACE;EAEL,CAAA,CAAA;;AAET;AAEA,SAASE,EAAW,EAAE,aAAiD;CACrE,IAAMC,IAAQC,KAAU;CACxB,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACG;GAAC;GAAG;GAAG;GAAG;GAAG;EAAC,CAAC,CAAC,KAAK,MACpB,kBAACC,GAAD,EAEE,WAAWC,EACT,eACAC,KAA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ACT,YAAYa;IACZ,OAAO,EAAQC;IACf,UAAUW;GACX,CAAA;GAGH,kBAACyB,IAAD;IACE,MAAM,EAAQhD;IACd,eAAeC,EAAY,IAAI;IAC/B,OAAM;IACN,aAAY;IACZ,MAAK;IACL,QACE,kBAAA/B,GAAA,EAAA,UAAA,CACE,kBAAC,UAAD;KACE,eAAe+B,EAAY,IAAI;KAC/B,WAAU;KACX,UAAA;IAEO,CAAA,GACR,kBAAC,UAAD;KACE,SAASuB;KACT,UAAUT;KACV,WAAU;KAET,UAAAA,IAAkB,gBAAgB;IAC7B,CAAA,CACR,EAAA,CAAA;IAGJ,UAAA,kBAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MAA2C;MACT;MAChC,kBAAC,QAAD;OAAM,WAAU;OACb,UAAAf,GAAU;MACP,CAAA;MAAC;KAEN;;GACE,CAAA;EACG;;AAEhB"}
|
|
1
|
+
{"version":3,"file":"MeetingsPage.js","names":["_Fragment","PAGE_SIZE","MEETING_TYPE_LABELS","MeetingType","meetingTypeLabel","type","idMonogram","id","ParticipantAvatars","shown","participants","overflow","p","StarRating","value","rating","Star","cn","v","MeetingsPage","useTimeCampus","navigate","useTimeCampusNavigate","limit","setLimit","useState","createOpen","setCreateOpen","editing","setEditing","deleting","setDeleting","useListMeetingsQuery","workspaceId","createMeeting","creating","createError","useCreateMeetingMutation","analytics","useTimeCampusAnalytics","updateMeeting","updating","updateError","useUpdateMeetingMutation","deleteMeeting","deletingLoading","useDeleteMeetingMutation","meetings","data","hasMore","handleCreate","created","refetch","handleUpdate","handleDelete","handleLoadMore","nextLimit","fetchMore","addButton","Plus","loading","PageLayout","LoadingSkeleton","error","EmptyState","Fragment","GlassCard","meeting","e","CalendarDays","Video","formatDate","formatTime","StatusBadge","formatCurrency","Pencil","Trash2","MeetingFormModal","Modal"],"sources":["../../../../src/timecampus/pages/meetings/MeetingsPage.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { CalendarDays, Plus, Video, Pencil, Trash2, Star } from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { PageLayout } from \"../../components/PageLayout\";\nimport { StatusBadge } from \"../../components/StatusBadge\";\nimport { EmptyState } from \"../../components/EmptyState\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport { Modal } from \"../../components/Modal\";\nimport {\n cn,\n formatCurrency,\n formatDate,\n formatTime,\n} from \"../../utils/helpers\";\nimport {\n useTimeCampus,\n useTimeCampusNavigate,\n} from \"../../providers/TimeCampusProvider\";\nimport {\n useListMeetingsQuery,\n useCreateMeetingMutation,\n useUpdateMeetingMutation,\n useDeleteMeetingMutation,\n type MeetingFieldsFragment,\n} from \"@/generated/wspace-operations\";\nimport { useTimeCampusAnalytics } from \"../../analytics\";\nimport {\n MeetingType,\n type CreateMeetingInput,\n type UpdateMeetingInput,\n} from \"@/generated/wspace-types\";\nimport { MeetingFormModal } from \"./MeetingFormModal\";\n\nconst PAGE_SIZE = 25;\n\nconst MEETING_TYPE_LABELS: Record<MeetingType, string> = {\n [MeetingType.Standup]: \"Standup\",\n [MeetingType.OneOnOne]: \"1-on-1\",\n [MeetingType.Team]: \"Team\",\n [MeetingType.Review]: \"Review\",\n [MeetingType.Planning]: \"Planning\",\n [MeetingType.Retrospective]: \"Retro\",\n [MeetingType.External]: \"External\",\n};\n\nfunction meetingTypeLabel(type: MeetingType): string {\n return MEETING_TYPE_LABELS[type] ?? type;\n}\n\n/** Deterministic 2-char monogram from an opaque participant id. */\nfunction idMonogram(id: string): string {\n return (\n id\n .replace(/[^a-zA-Z0-9]/g, \"\")\n .slice(0, 2)\n .toUpperCase() || \"?\"\n );\n}\n\nfunction ParticipantAvatars({\n participants,\n}: {\n participants: MeetingFieldsFragment[\"participants\"];\n}) {\n const shown = participants.slice(0, 4);\n const overflow = participants.length - shown.length;\n return (\n <div className=\"flex items-center -space-x-2\">\n {shown.map((p) => (\n <span\n key={p.id}\n title={p.userId}\n className=\"flex h-8 w-8 items-center justify-center rounded-full bg-action-primary-bg/10 text-[11px] font-semibold text-primary ring-2 ring-bg-surface\"\n >\n {idMonogram(p.userId)}\n </span>\n ))}\n {overflow > 0 && (\n <span className=\"flex h-8 w-8 items-center justify-center rounded-full bg-bg-sunken text-[11px] font-semibold text-text-secondary ring-2 ring-bg-surface\">\n +{overflow}\n </span>\n )}\n </div>\n );\n}\n\nfunction StarRating({ rating }: { rating: number | null | undefined }) {\n const value = rating ?? 0;\n return (\n <div className=\"flex items-center gap-0.5\">\n {[1, 2, 3, 4, 5].map((v) => (\n <Star\n key={v}\n className={cn(\n \"h-3.5 w-3.5\",\n v <= value\n ? \"fill-status-warning-text text-status-warning-text\"\n : \"text-border-seam\",\n )}\n />\n ))}\n <span className=\"ms-1 text-xs font-medium tabular-nums text-text-secondary\">\n {rating != null ? rating.toFixed(1) : \"—\"}\n </span>\n </div>\n );\n}\n\nexport function MeetingsPage() {\n const { workspaceId = \"\" } = useTimeCampus();\n const navigate = useTimeCampusNavigate();\n\n const [limit, setLimit] = useState(PAGE_SIZE);\n const [createOpen, setCreateOpen] = useState(false);\n const [editing, setEditing] = useState<MeetingFieldsFragment | null>(null);\n const [deleting, setDeleting] = useState<MeetingFieldsFragment | null>(null);\n\n const { data, loading, error, refetch, fetchMore } = useListMeetingsQuery({\n variables: { workspaceId, pagination: { limit, offset: 0 } },\n skip: !workspaceId,\n notifyOnNetworkStatusChange: true,\n });\n\n const [createMeeting, { loading: creating, error: createError }] =\n useCreateMeetingMutation();\n const analytics = useTimeCampusAnalytics();\n const [updateMeeting, { loading: updating, error: updateError }] =\n useUpdateMeetingMutation();\n const [deleteMeeting, { loading: deletingLoading }] =\n useDeleteMeetingMutation();\n\n const meetings = data?.meetings ?? [];\n const hasMore = meetings.length >= limit;\n\n const handleCreate = async (input: CreateMeetingInput) => {\n const result = await createMeeting({ variables: { input } });\n const created = result.data?.createMeeting;\n // Keep the dialog open on failure so the error banner stays visible.\n if (!created) return;\n analytics.meetingCreated({\n meetingId: created.id,\n surface: \"meetings_page\",\n });\n await refetch();\n setCreateOpen(false);\n };\n\n const handleUpdate = async (input: UpdateMeetingInput) => {\n if (!editing) return;\n await updateMeeting({\n variables: { id: editing.id, workspaceId, input },\n });\n await refetch();\n setEditing(null);\n };\n\n const handleDelete = async () => {\n if (!deleting) return;\n await deleteMeeting({\n variables: { id: deleting.id, workspaceId },\n });\n setDeleting(null);\n await refetch();\n };\n\n const handleLoadMore = async () => {\n const nextLimit = limit + PAGE_SIZE;\n setLimit(nextLimit);\n await fetchMore({\n variables: { pagination: { limit: nextLimit, offset: 0 } },\n });\n };\n\n const addButton = (\n <button\n onClick={() => setCreateOpen(true)}\n className=\"inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90\"\n >\n <Plus className=\"h-4 w-4\" />\n Schedule Meeting\n </button>\n );\n\n if (loading && meetings.length === 0) {\n return (\n <PageLayout\n title=\"Meetings\"\n description=\"Schedule and track meetings\"\n actions={addButton}\n >\n <LoadingSkeleton variant=\"list\" count={5} />\n </PageLayout>\n );\n }\n\n if (error) {\n return (\n <PageLayout title=\"Meetings\" description=\"Schedule and track meetings\">\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 meetings. Please try again later.\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title=\"Meetings\"\n description=\"Schedule and track meetings\"\n purpose=\"Keep every meeting and its recording in one place and see how much of your week goes to them — so you can protect focus time, trim low-value calls, and account for meeting hours in your tracking.\"\n actions={addButton}\n >\n {meetings.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n title=\"No meetings found\"\n description=\"Schedule your first meeting to start tracking calls and their time impact.\"\n action={addButton}\n />\n ) : (\n <>\n <div className=\"space-y-3\">\n {meetings.map((meeting: MeetingFieldsFragment) => (\n <GlassCard\n key={meeting.id}\n treatment=\"glass\"\n role=\"button\"\n tabIndex={0}\n onClick={() => navigate(`/meetings/${meeting.id}`)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n navigate(`/meetings/${meeting.id}`);\n }\n }}\n className=\"cursor-pointer p-4 transition-colors hover:bg-bg-sunken/30 sm:p-5\"\n >\n <div className=\"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between\">\n {/* Title + meta */}\n <div className=\"flex min-w-0 items-start gap-3\">\n <div className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary\">\n <CalendarDays className=\"h-5 w-5\" />\n </div>\n <div className=\"min-w-0\">\n <div className=\"flex items-center gap-2\">\n <p className=\"truncate text-sm font-semibold text-text-primary\">\n {meeting.title}\n </p>\n {meeting.recordingUrl && (\n <Video\n className=\"h-3.5 w-3.5 shrink-0 text-primary\"\n aria-label=\"Has recording\"\n />\n )}\n </div>\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n {formatDate(meeting.startTime)} ·{\" \"}\n {formatTime(meeting.startTime)}\n {meeting.endTime\n ? `–${formatTime(meeting.endTime)}`\n : \"\"}{\" \"}\n · {meeting.duration ?? 0} min\n </p>\n <div className=\"mt-2 flex flex-wrap items-center gap-1.5\">\n <StatusBadge\n label={meetingTypeLabel(meeting.meetingType)}\n variant=\"default\"\n />\n <StatusBadge\n label={meeting.endTime ? \"Completed\" : \"Scheduled\"}\n variant={meeting.endTime ? \"success\" : \"info\"}\n dot\n />\n </div>\n </div>\n </div>\n\n {/* Metrics + actions */}\n <div className=\"flex flex-wrap items-center gap-x-6 gap-y-3 lg:shrink-0 lg:justify-end\">\n <div>\n <p className=\"text-[11px] font-medium uppercase tracking-wide text-text-muted\">\n Est. cost\n </p>\n <p className=\"text-sm font-semibold tabular-nums text-primary\">\n {meeting.cost != null\n ? formatCurrency(meeting.cost)\n : \"—\"}\n </p>\n </div>\n <div>\n <p className=\"text-[11px] font-medium uppercase tracking-wide text-text-muted\">\n Rating\n </p>\n <StarRating rating={meeting.rating} />\n </div>\n <div>\n <p className=\"text-[11px] font-medium uppercase tracking-wide text-text-muted\">\n {meeting.participants.length}{\" \"}\n {meeting.participants.length === 1\n ? \"participant\"\n : \"participants\"}\n </p>\n {meeting.participants.length > 0 ? (\n <div className=\"mt-0.5\">\n <ParticipantAvatars\n participants={meeting.participants}\n />\n </div>\n ) : (\n <p className=\"mt-0.5 text-xs text-text-secondary\">\n None yet\n </p>\n )}\n </div>\n <div className=\"flex items-center gap-1\">\n <button\n onClick={(e) => {\n e.stopPropagation();\n setEditing(meeting);\n }}\n className=\"rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary\"\n aria-label=\"Edit meeting\"\n >\n <Pencil className=\"h-4 w-4\" />\n </button>\n <button\n onClick={(e) => {\n e.stopPropagation();\n setDeleting(meeting);\n }}\n className=\"rounded-md p-1.5 text-text-secondary hover:bg-status-error-bg hover:text-status-error-text\"\n aria-label=\"Delete meeting\"\n >\n <Trash2 className=\"h-4 w-4\" />\n </button>\n </div>\n </div>\n </div>\n </GlassCard>\n ))}\n </div>\n {hasMore && (\n <div className=\"mt-4 flex justify-center\">\n <button\n onClick={handleLoadMore}\n disabled={loading}\n className=\"rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50\"\n >\n {loading ? \"Loading...\" : \"Load more\"}\n </button>\n </div>\n )}\n </>\n )}\n\n {createOpen && (\n <MeetingFormModal\n open\n onClose={() => setCreateOpen(false)}\n workspaceId={workspaceId}\n submitting={creating}\n error={Boolean(createError)}\n onCreate={handleCreate}\n />\n )}\n\n {editing && (\n <MeetingFormModal\n open\n onClose={() => setEditing(null)}\n workspaceId={workspaceId}\n meeting={editing}\n submitting={updating}\n error={Boolean(updateError)}\n onUpdate={handleUpdate}\n />\n )}\n\n <Modal\n open={Boolean(deleting)}\n onClose={() => setDeleting(null)}\n title=\"Delete meeting\"\n description=\"This permanently removes the meeting and its analytics.\"\n size=\"sm\"\n footer={\n <>\n <button\n onClick={() => setDeleting(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={handleDelete}\n disabled={deletingLoading}\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 {deletingLoading ? \"Deleting...\" : \"Delete\"}\n </button>\n </>\n }\n >\n <p className=\"text-sm text-text-secondary\">\n Are you sure you want to delete{\" \"}\n <span className=\"font-medium text-text-primary\">\n {deleting?.title}\n </span>\n ? This action cannot be undone.\n </p>\n </Modal>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCA,IAAMC,IAAY,IAEZC,IAAmD;EACtDC,EAAY,UAAU;EACtBA,EAAY,WAAW;EACvBA,EAAY,OAAO;EACnBA,EAAY,SAAS;EACrBA,EAAY,WAAW;EACvBA,EAAY,gBAAgB;EAC5BA,EAAY,WAAW;AAC1B;AAEA,SAASC,EAAiB,GAA2B;CACnD,OAAOF,EAAoBG,MAASA;AACtC;AAGA,SAASC,EAAW,GAAoB;CACtC,OACEC,EACG,QAAQ,iBAAiB,EAAE,CAAC,CAC5B,MAAM,GAAG,CAAC,CAAC,CACX,YAAY,KAAK;AAExB;AAEA,SAASC,EAAmB,EAC1B,mBAGC;CACD,IAAMC,IAAQC,EAAa,MAAM,GAAG,CAAC,GAC/BC,IAAWD,EAAa,SAASD,EAAM;CAC7C,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACGA,EAAM,KAAK,MACV,kBAAC,QAAD;GAEE,OAAOG,EAAE;GACT,WAAU;GAET,UAAAN,EAAWM,EAAE,MAAM;EAChB,GALCA,EAAE,EAKH,CACP,GACAD,IAAW,KACV,kBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CAA0J,KACtJA,CACE;EAEL,CAAA,CAAA;;AAET;AAEA,SAASE,EAAW,EAAE,aA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D,GAAD;IACE,MAAA;IACA,eAAelD,EAAc,EAAK;IACrB;IACb,YAAYQ;IACZ,OAAO,EAAQC;IACf,UAAUc;GACX,CAAA;GAGFtB,KACC,kBAACiD,GAAD;IACE,MAAA;IACA,eAAehD,EAAW,IAAI;IACjB;IACb,SAASD;IACT,YAAYa;IACZ,OAAO,EAAQC;IACf,UAAUW;GACX,CAAA;GAGH,kBAACyB,IAAD;IACE,MAAM,EAAQhD;IACd,eAAeC,EAAY,IAAI;IAC/B,OAAM;IACN,aAAY;IACZ,MAAK;IACL,QACE,kBAAA/B,GAAA,EAAA,UAAA,CACE,kBAAC,UAAD;KACE,eAAe+B,EAAY,IAAI;KAC/B,WAAU;KACX,UAAA;IAEO,CAAA,GACR,kBAAC,UAAD;KACE,SAASuB;KACT,UAAUT;KACV,WAAU;KAET,UAAAA,IAAkB,gBAAgB;IAC7B,CAAA,CACR,EAAA,CAAA;IAGJ,UAAA,kBAAC,KAAD;KAAG,WAAU;KAAb,UAAA;MAA2C;MACT;MAChC,kBAAC,QAAD;OAAM,WAAU;OACb,UAAAf,GAAU;MACP,CAAA;MAAC;KAEN;;GACE,CAAA;EACG;;AAEhB"}
|
|
@@ -41,7 +41,7 @@ function d({ active: r, title: a, fullViewPath: o, trailing: d, children: f }) {
|
|
|
41
41
|
/* @__PURE__ */ l("button", {
|
|
42
42
|
type: "button",
|
|
43
43
|
onClick: () => p(o),
|
|
44
|
-
className: "-
|
|
44
|
+
className: "-ms-2 inline-flex min-h-11 items-center gap-1 rounded-lg px-2 text-sm text-text-secondary hover:text-text-primary",
|
|
45
45
|
"aria-label": m("timecampus.mobile.fullViewAria", "Open the full page"),
|
|
46
46
|
children: [/* @__PURE__ */ c(i, { className: "h-5 w-5" }), m("timecampus.mobile.fullView", "Full view")]
|
|
47
47
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileScreen.js","names":["SCREENS","CalendarDays","Timer","PieChart","MobileScreen","navigate","useTimeCampusNavigate","t","useTr","nativeChrome","useMobileTabBarVisible","active","fullViewPath","ChevronLeft","title","trailing","Icon","screen","isActive","cn","children","PhoneViewLink","path"],"sources":["../../../../src/timecampus/pages/mobile/MobileScreen.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { CalendarDays, ChevronLeft, PieChart, Timer } from \"lucide-react\";\nimport { useMobileTabBarVisible } from \"@burdenoff/fe-libs/chrome/mobileTabBar/useMobileTabBarVisible\";\nimport { useTimeCampusNavigate } from \"../../providers/TimeCampusProvider\";\nimport { useTr } from \"../../hooks\";\nimport { cn } from \"../../utils/helpers\";\n\nexport type MobileScreenId = \"timer\" | \"timeline\" | \"life-balance\";\n\ninterface MobileScreenProps {\n /** Which phone screen is showing (drives the switcher highlight). */\n active: MobileScreenId;\n title: string;\n /** Route of the full (desktop) page this screen is the phone view of. */\n fullViewPath: string;\n /** Optional control on the right of the title bar. */\n trailing?: ReactNode;\n children: ReactNode;\n}\n\nconst SCREENS: {\n id: MobileScreenId;\n path: string;\n icon: typeof Timer;\n labelKey: string;\n label: string;\n}[] = [\n {\n id: \"timeline\",\n path: \"/mobile/timeline\",\n icon: CalendarDays,\n labelKey: \"timecampus.mobile.nav.timeline\",\n label: \"Timeline\",\n },\n {\n id: \"timer\",\n path: \"/mobile/timer\",\n icon: Timer,\n labelKey: \"timecampus.mobile.nav.timer\",\n label: \"Timer\",\n },\n {\n id: \"life-balance\",\n path: \"/mobile/life-balance\",\n icon: PieChart,\n labelKey: \"timecampus.mobile.nav.balance\",\n label: \"Balance\",\n },\n];\n\n/**\n * Frame for the phone-optimised screens: a compact title bar, a one-handed\n * switcher between the three phone screens and safe-area padding so content\n * clears the notch and home indicator.\n *\n * Inside the installed app the shell's bottom tab bar already carries these\n * three screens (they register with a `mobilePriority`), so the in-page\n * switcher is only shown in a mobile browser, where the shell keeps its\n * desktop chrome.\n */\nexport function MobileScreen({\n active,\n title,\n fullViewPath,\n trailing,\n children,\n}: MobileScreenProps) {\n const navigate = useTimeCampusNavigate();\n const t = useTr();\n const nativeChrome = useMobileTabBarVisible();\n\n return (\n <div\n className=\"mx-auto flex w-full max-w-md flex-col gap-4 px-4 pb-[calc(env(safe-area-inset-bottom)+1.5rem)] pt-3\"\n data-testid={`mobile-screen-${active}`}\n >\n <header className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => navigate(fullViewPath)}\n className=\"-
|
|
1
|
+
{"version":3,"file":"MobileScreen.js","names":["SCREENS","CalendarDays","Timer","PieChart","MobileScreen","navigate","useTimeCampusNavigate","t","useTr","nativeChrome","useMobileTabBarVisible","active","fullViewPath","ChevronLeft","title","trailing","Icon","screen","isActive","cn","children","PhoneViewLink","path"],"sources":["../../../../src/timecampus/pages/mobile/MobileScreen.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { CalendarDays, ChevronLeft, PieChart, Timer } from \"lucide-react\";\nimport { useMobileTabBarVisible } from \"@burdenoff/fe-libs/chrome/mobileTabBar/useMobileTabBarVisible\";\nimport { useTimeCampusNavigate } from \"../../providers/TimeCampusProvider\";\nimport { useTr } from \"../../hooks\";\nimport { cn } from \"../../utils/helpers\";\n\nexport type MobileScreenId = \"timer\" | \"timeline\" | \"life-balance\";\n\ninterface MobileScreenProps {\n /** Which phone screen is showing (drives the switcher highlight). */\n active: MobileScreenId;\n title: string;\n /** Route of the full (desktop) page this screen is the phone view of. */\n fullViewPath: string;\n /** Optional control on the right of the title bar. */\n trailing?: ReactNode;\n children: ReactNode;\n}\n\nconst SCREENS: {\n id: MobileScreenId;\n path: string;\n icon: typeof Timer;\n labelKey: string;\n label: string;\n}[] = [\n {\n id: \"timeline\",\n path: \"/mobile/timeline\",\n icon: CalendarDays,\n labelKey: \"timecampus.mobile.nav.timeline\",\n label: \"Timeline\",\n },\n {\n id: \"timer\",\n path: \"/mobile/timer\",\n icon: Timer,\n labelKey: \"timecampus.mobile.nav.timer\",\n label: \"Timer\",\n },\n {\n id: \"life-balance\",\n path: \"/mobile/life-balance\",\n icon: PieChart,\n labelKey: \"timecampus.mobile.nav.balance\",\n label: \"Balance\",\n },\n];\n\n/**\n * Frame for the phone-optimised screens: a compact title bar, a one-handed\n * switcher between the three phone screens and safe-area padding so content\n * clears the notch and home indicator.\n *\n * Inside the installed app the shell's bottom tab bar already carries these\n * three screens (they register with a `mobilePriority`), so the in-page\n * switcher is only shown in a mobile browser, where the shell keeps its\n * desktop chrome.\n */\nexport function MobileScreen({\n active,\n title,\n fullViewPath,\n trailing,\n children,\n}: MobileScreenProps) {\n const navigate = useTimeCampusNavigate();\n const t = useTr();\n const nativeChrome = useMobileTabBarVisible();\n\n return (\n <div\n className=\"mx-auto flex w-full max-w-md flex-col gap-4 px-4 pb-[calc(env(safe-area-inset-bottom)+1.5rem)] pt-3\"\n data-testid={`mobile-screen-${active}`}\n >\n <header className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => navigate(fullViewPath)}\n className=\"-ms-2 inline-flex min-h-11 items-center gap-1 rounded-lg px-2 text-sm text-text-secondary hover:text-text-primary\"\n aria-label={t(\"timecampus.mobile.fullViewAria\", \"Open the full page\")}\n >\n <ChevronLeft className=\"h-5 w-5\" />\n {t(\"timecampus.mobile.fullView\", \"Full view\")}\n </button>\n <h1 className=\"flex-1 truncate text-center text-lg font-semibold text-text-primary\">\n {title}\n </h1>\n <div className=\"flex min-w-[5.5rem] justify-end\">{trailing}</div>\n </header>\n\n {!nativeChrome && (\n <nav\n aria-label={t(\"timecampus.mobile.nav.aria\", \"Phone screens\")}\n className=\"grid grid-cols-3 gap-1 rounded-2xl border border-border-subtle bg-bg-sunken/50 p-1\"\n >\n {SCREENS.map((screen) => {\n const Icon = screen.icon;\n const isActive = screen.id === active;\n return (\n <button\n key={screen.id}\n type=\"button\"\n onClick={() => navigate(screen.path)}\n aria-current={isActive ? \"page\" : undefined}\n className={cn(\n \"flex min-h-11 items-center justify-center gap-1.5 rounded-xl text-sm font-medium transition-colors\",\n isActive\n ? \"bg-bg-surface text-text-primary shadow-sm\"\n : \"text-text-secondary hover:text-text-primary\",\n )}\n >\n <Icon className=\"h-4 w-4\" />\n {t(screen.labelKey, screen.label)}\n </button>\n );\n })}\n </nav>\n )}\n\n {children}\n </div>\n );\n}\n\n/**\n * A small \"Phone view\" link that the desktop pages show only below the `md`\n * breakpoint, so a mobile-browser user can jump to the phone-optimised screen.\n */\nexport function PhoneViewLink({ path }: { path: string }) {\n const navigate = useTimeCampusNavigate();\n const t = useTr();\n return (\n <button\n type=\"button\"\n onClick={() => navigate(path)}\n className=\"mb-4 inline-flex min-h-11 w-full items-center justify-center gap-2 rounded-xl border border-border-subtle bg-bg-surface px-4 text-sm font-medium text-text-primary md:hidden\"\n data-testid=\"phone-view-link\"\n >\n {t(\"timecampus.mobile.openPhoneView\", \"Open the phone view\")}\n </button>\n );\n}\n"],"mappings":";;;;;;;;AAoBA,IAAMA,IAMA;CACJ;EACE,IAAI;EACJ,MAAM;EACN,MAAMC;EACN,UAAU;EACV,OAAO;CACT;CACA;EACE,IAAI;EACJ,MAAM;EACN,MAAMC;EACN,UAAU;EACV,OAAO;CACT;CACA;EACE,IAAI;EACJ,MAAM;EACN,MAAMC;EACN,UAAU;EACV,OAAO;CACT;AACF;AAYA,SAAgBC,EAAa,EAC3B,WACA,UACA,iBACA,aACA,eACoB;CACpB,IAAMC,IAAWC,EAAsB,GACjCC,IAAIC,EAAM,GACVC,IAAeC,EAAuB;CAE5C,OACE,kBAAC,OAAD;EACE,WAAU;EACV,eAAa,iBAAiBC;EAFhC,UAAA;GAIE,kBAAC,UAAD;IAAQ,WAAU;IAAlB,UAAA;KACE,kBAAC,UAAD;MACE,MAAK;MACL,eAAeN,EAASO,CAAY;MACpC,WAAU;MACV,cAAYL,EAAE,kCAAkC,oBAAoB;MAJtE,UAAA,CAME,kBAACM,GAAD,EAAa,WAAU,UAAW,CAAA,GACjCN,EAAE,8BAA8B,WAAW,CACtC;;KACR,kBAAC,MAAD;MAAI,WAAU;MACX,UAAAO;KACC,CAAA;KACJ,kBAAC,OAAD;MAAK,WAAU;MAAmC,UAAAC;KAAc,CAAA;IAC1D;;GAEP,CAACN,KACA,kBAAC,OAAD;IACE,cAAYF,EAAE,8BAA8B,eAAe;IAC3D,WAAU;IAET,UAAAP,EAAQ,KAAK,MAAW;KACvB,IAAMgB,IAAOC,EAAO,MACdC,IAAWD,EAAO,OAAON;KAC/B,OACE,kBAAC,UAAD;MAEE,MAAK;MACL,eAAeN,EAASY,EAAO,IAAI;MACnC,gBAAcC,IAAW,SAAS,KAAA;MAClC,WAAWC,EACT,sGACAD,IACI,8CACA,6CACN;MAVF,UAAA,CAYE,kBAACF,GAAD,EAAM,WAAU,UAAW,CAAA,GAC1BT,EAAEU,EAAO,UAAUA,EAAO,KAAK,CAC1B;KAbD,GAAAA,EAAO,EAaN;IAEZ,CAAC;GACE,CAAA;GAGNG;EACE;;AAET;AAMA,SAAgBC,EAAc,EAAE,WAA0B;CACxD,IAAMhB,IAAWC,EAAsB,GACjCC,IAAIC,EAAM;CAChB,OACE,kBAAC,UAAD;EACE,MAAK;EACL,eAAeH,EAASiB,CAAI;EAC5B,WAAU;EACV,eAAY;EAEX,UAAAf,EAAE,mCAAmC,qBAAqB;CACrD,CAAA;AAEZ"}
|
|
@@ -89,13 +89,13 @@ function R() {
|
|
|
89
89
|
className: "sr-only",
|
|
90
90
|
children: w("timecampus.mobile.timeline.searchLabel", "Search this day")
|
|
91
91
|
}),
|
|
92
|
-
/* @__PURE__ */ k(E, { className: "pointer-events-none absolute
|
|
92
|
+
/* @__PURE__ */ k(E, { className: "pointer-events-none absolute start-3 top-1/2 h-5 w-5 -translate-y-1/2 text-text-secondary" }),
|
|
93
93
|
/* @__PURE__ */ k("input", {
|
|
94
94
|
type: "search",
|
|
95
95
|
value: B,
|
|
96
96
|
onChange: (e) => V(e.target.value),
|
|
97
97
|
placeholder: w("timecampus.mobile.timeline.searchPlaceholder", "Search events, apps, projects…"),
|
|
98
|
-
className: "min-h-12 w-full rounded-2xl border border-border-subtle bg-bg-surface
|
|
98
|
+
className: "min-h-12 w-full rounded-2xl border border-border-subtle bg-bg-surface ps-10 pe-3 text-base text-text-primary placeholder:text-text-secondary",
|
|
99
99
|
"data-testid": "mobile-timeline-search"
|
|
100
100
|
})
|
|
101
101
|
]
|
|
@@ -177,22 +177,22 @@ function R() {
|
|
|
177
177
|
title: B ? w("timecampus.mobile.timeline.noMatches", "Nothing matches that search") : w("timecampus.mobile.timeline.emptyTitle", "Nothing tracked this day"),
|
|
178
178
|
description: B ? w("timecampus.mobile.timeline.noMatchesHint", "Try a different word, or clear the search.") : w("timecampus.mobile.timeline.emptyHint", "Start the timer or connect a capture channel and your day fills in here.")
|
|
179
179
|
}) : /* @__PURE__ */ k("ol", {
|
|
180
|
-
className: "relative
|
|
180
|
+
className: "relative ms-14 border-s border-border-seam",
|
|
181
181
|
"data-testid": "mobile-timeline-list",
|
|
182
182
|
children: $.map((e) => {
|
|
183
183
|
let t = P(e.category), n = e.isPlanned ? x : t.icon, r = e.projectId ? X.get(e.projectId) : void 0;
|
|
184
184
|
return /* @__PURE__ */ A("li", {
|
|
185
|
-
className: "relative pb-3
|
|
185
|
+
className: "relative pb-3 ps-3",
|
|
186
186
|
children: [
|
|
187
187
|
/* @__PURE__ */ k("span", {
|
|
188
|
-
className: "absolute -
|
|
188
|
+
className: "absolute -start-14 top-3 w-12 text-end text-xs tabular-nums text-text-secondary",
|
|
189
189
|
children: a(e.startTime)
|
|
190
190
|
}),
|
|
191
|
-
/* @__PURE__ */ k("span", { className: "absolute -
|
|
191
|
+
/* @__PURE__ */ k("span", { className: "absolute -start-[5px] top-4 h-2.5 w-2.5 rounded-full border border-border-seam bg-bg-surface" }),
|
|
192
192
|
/* @__PURE__ */ A("button", {
|
|
193
193
|
type: "button",
|
|
194
194
|
onClick: () => U(e),
|
|
195
|
-
className: i("w-full rounded-2xl border p-3 text-
|
|
195
|
+
className: i("w-full rounded-2xl border p-3 text-start", t.card, e.isPlanned && "border-dashed bg-transparent"),
|
|
196
196
|
"data-testid": "mobile-timeline-segment",
|
|
197
197
|
children: [
|
|
198
198
|
/* @__PURE__ */ A("div", {
|
|
@@ -265,7 +265,7 @@ function z({ segment: e, project: t, onClose: n, onOpenFull: r }) {
|
|
|
265
265
|
}), /* @__PURE__ */ k("button", {
|
|
266
266
|
type: "button",
|
|
267
267
|
onClick: n,
|
|
268
|
-
className: "-
|
|
268
|
+
className: "-me-2 inline-flex h-11 w-11 items-center justify-center rounded-full text-text-secondary",
|
|
269
269
|
"aria-label": i("timecampus.mobile.timeline.closeSheet", "Close details"),
|
|
270
270
|
children: /* @__PURE__ */ k(O, { className: "h-5 w-5" })
|
|
271
271
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileTimelinePage.js","names":["OTHER_CATEGORY","Activity","CATEGORY","Brain","Users","MessageSquare","Coffee","categoryMeta","category","categoryLabel","segmentTitle","segment","timeWindow","start","formatTime","MobileTimelinePage","useTimeCampus","navigate","useTimeCampusNavigate","t","useTr","searchParams","setSearchParams","useSearchParams","todayKey","toLocalDateKey","linked","dateKey","parseLocalDateKey","setDateKey","next","key","query","setQuery","useState","selected","setSelected","useMemo","localDayBounds","useGetTimeCampusTimelineQuery","workspaceId","projectsData","useListProjectsQuery","projectNameById","map","project","timeline","data","summary","focusSummary","segments","filterSegments","sortByStart","MobileScreen","Search","GlassCard","compactDuration","shiftDateKey","ChevronLeft","dayHeading","longDayLabel","ChevronRight","error","loading","LoadingSkeleton","EmptyState","meta","Icon","CalendarClock","cn","SegmentSheet","useEffect","onKey","event","onClose","X","onOpenFull"],"sources":["../../../../src/timecampus/pages/mobile/MobileTimelinePage.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { useSearchParams } from \"react-router\";\nimport {\n Activity,\n Brain,\n CalendarClock,\n ChevronLeft,\n ChevronRight,\n Coffee,\n MessageSquare,\n Search,\n Users,\n X,\n} from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { EmptyState } from \"../../components/EmptyState\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport {\n useTimeCampus,\n useTimeCampusNavigate,\n} from \"../../providers/TimeCampusProvider\";\nimport { useTr } from \"../../hooks\";\nimport { cn, formatTime } from \"../../utils/helpers\";\nimport {\n useGetTimeCampusTimelineQuery,\n useListProjectsQuery,\n type TimelineSegmentFieldsFragment,\n} from \"@/generated/wspace-operations\";\nimport { MobileScreen } from \"./MobileScreen\";\nimport {\n compactDuration,\n dayHeading,\n filterSegments,\n focusSummary,\n localDayBounds,\n longDayLabel,\n parseLocalDateKey,\n shiftDateKey,\n sortByStart,\n toLocalDateKey,\n} from \"./mobileModel\";\n\ntype Segment = TimelineSegmentFieldsFragment;\n\ninterface CategoryMeta {\n label: string;\n icon: typeof Brain;\n card: string;\n accent: string;\n}\n\nconst OTHER_CATEGORY: CategoryMeta = {\n label: \"Other\",\n icon: Activity,\n card: \"border-border-subtle bg-bg-surface\",\n accent: \"text-text-secondary\",\n};\n\nconst CATEGORY: Record<string, CategoryMeta> = {\n DEEP_WORK: {\n label: \"Deep work\",\n icon: Brain,\n card: \"border-status-success-text/40 bg-status-success-bg\",\n accent: \"text-status-success-text\",\n },\n MEETING: {\n label: \"Meeting\",\n icon: Users,\n card: \"border-status-info-text/40 bg-status-info-bg\",\n accent: \"text-status-info-text\",\n },\n COMMUNICATION: {\n label: \"Communication\",\n icon: MessageSquare,\n card: \"border-status-warning-text/40 bg-status-warning-bg\",\n accent: \"text-status-warning-text\",\n },\n BREAK: {\n label: \"Break\",\n icon: Coffee,\n card: \"border-border-subtle bg-bg-sunken\",\n accent: \"text-text-secondary\",\n },\n OTHER: OTHER_CATEGORY,\n};\n\nconst categoryMeta = (category: string): CategoryMeta =>\n CATEGORY[category] ?? OTHER_CATEGORY;\nconst categoryLabel = (category: string) => categoryMeta(category).label;\n\nfunction segmentTitle(segment: Segment): string {\n if (segment.title) return segment.title;\n if (segment.app) return segment.app;\n return segment.isPlanned\n ? \"Planned focus block\"\n : categoryLabel(segment.category);\n}\n\nfunction timeWindow(segment: Segment): string {\n const start = formatTime(segment.startTime);\n return segment.endTime ? `${start} – ${formatTime(segment.endTime)}` : start;\n}\n\n/**\n * Phone timeline: the day as a vertical stack of thumb-sized cards on a time\n * rail, a focus summary on top, search, day paging, and a bottom sheet with a\n * segment's details. Editing (recategorise, assign project, drag) stays on the\n * full timeline, which the sheet links to.\n */\nexport function MobileTimelinePage() {\n const { workspaceId = \"\" } = useTimeCampus();\n const navigate = useTimeCampusNavigate();\n const t = useTr();\n const [searchParams, setSearchParams] = useSearchParams();\n\n const todayKey = toLocalDateKey(new Date());\n const linked = searchParams.get(\"date\");\n const dateKey =\n parseLocalDateKey(linked) && (linked as string) <= todayKey\n ? (linked as string)\n : todayKey;\n const setDateKey = (key: string) => {\n const next = new URLSearchParams(searchParams);\n if (key === todayKey) next.delete(\"date\");\n else next.set(\"date\", key);\n setSearchParams(next, { replace: true });\n };\n\n const [query, setQuery] = useState(\"\");\n const [selected, setSelected] = useState<Segment | null>(null);\n useEffect(() => setSelected(null), [dateKey]);\n\n const { from, to } = useMemo(() => localDayBounds(dateKey), [dateKey]);\n const { data, loading, error } = useGetTimeCampusTimelineQuery({\n variables: { from, to },\n skip: !workspaceId,\n fetchPolicy: \"cache-and-network\",\n });\n const { data: projectsData } = useListProjectsQuery({\n variables: { pagination: { limit: 200 } },\n skip: !workspaceId,\n });\n\n const projectNameById = useMemo(() => {\n const map = new Map<string, string>();\n for (const project of projectsData?.projects?.items ?? []) {\n map.set(project.id, project.name);\n }\n return map;\n }, [projectsData?.projects?.items]);\n\n const timeline = data?.timeCampusTimeline;\n const summary = focusSummary(timeline?.summary);\n const segments = useMemo(\n () =>\n filterSegments<Segment>(\n sortByStart<Segment>(timeline?.segments ?? []),\n query,\n projectNameById,\n categoryLabel,\n ),\n [timeline?.segments, query, projectNameById],\n );\n\n return (\n <MobileScreen\n active=\"timeline\"\n title={t(\"timecampus.mobile.timeline.title\", \"Timeline\")}\n fullViewPath={\n dateKey === todayKey ? \"/timeline\" : `/timeline?date=${dateKey}`\n }\n >\n <label className=\"relative block\">\n <span className=\"sr-only\">\n {t(\"timecampus.mobile.timeline.searchLabel\", \"Search this day\")}\n </span>\n <Search className=\"pointer-events-none absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-text-secondary\" />\n <input\n type=\"search\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder={t(\n \"timecampus.mobile.timeline.searchPlaceholder\",\n \"Search events, apps, projects…\",\n )}\n className=\"min-h-12 w-full rounded-2xl border border-border-subtle bg-bg-surface pl-10 pr-3 text-base text-text-primary placeholder:text-text-secondary\"\n data-testid=\"mobile-timeline-search\"\n />\n </label>\n\n <GlassCard\n treatment=\"glass\"\n glow\n className=\"p-4\"\n data-testid=\"mobile-timeline-summary\"\n >\n <p className=\"text-sm font-semibold text-text-primary\">\n {t(\"timecampus.mobile.timeline.focusSummary\", \"Focus summary\")}\n </p>\n <dl className=\"mt-2 grid grid-cols-3 gap-2\">\n <div>\n <dt className=\"text-xs text-text-secondary\">\n {t(\"timecampus.mobile.timeline.focusShare\", \"Focus share\")}\n </dt>\n <dd className=\"text-xl font-bold tabular-nums text-text-primary\">\n {summary.focusPercent === null ? \"—\" : `${summary.focusPercent}%`}\n </dd>\n </div>\n <div>\n <dt className=\"text-xs text-text-secondary\">\n {t(\"timecampus.mobile.timeline.deepWork\", \"Deep work\")}\n </dt>\n <dd className=\"text-xl font-bold tabular-nums text-text-primary\">\n {compactDuration(summary.deepWorkSeconds)}\n </dd>\n </div>\n <div>\n <dt className=\"text-xs text-text-secondary\">\n {t(\"timecampus.mobile.timeline.meetings\", \"Meetings\")}\n </dt>\n <dd className=\"text-xl font-bold tabular-nums text-text-primary\">\n {compactDuration(summary.meetingSeconds)}\n </dd>\n </div>\n </dl>\n </GlassCard>\n\n <div className=\"flex items-center justify-between gap-2\">\n <button\n type=\"button\"\n onClick={() => setDateKey(shiftDateKey(dateKey, -1))}\n className=\"inline-flex h-11 w-11 items-center justify-center rounded-full border border-border-subtle text-text-primary\"\n aria-label={t(\n \"timecampus.mobile.timeline.previousDay\",\n \"Previous day\",\n )}\n >\n <ChevronLeft className=\"h-5 w-5\" />\n </button>\n <div className=\"min-w-0 text-center\">\n <h2\n className=\"truncate text-lg font-bold text-text-primary\"\n data-testid=\"mobile-timeline-day\"\n >\n {dayHeading(dateKey)}\n </h2>\n <p className=\"truncate text-xs text-text-secondary\">\n {longDayLabel(dateKey)}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={() => setDateKey(shiftDateKey(dateKey, 1))}\n disabled={dateKey >= todayKey}\n className=\"inline-flex h-11 w-11 items-center justify-center rounded-full border border-border-subtle text-text-primary disabled:opacity-40\"\n aria-label={t(\"timecampus.mobile.timeline.nextDay\", \"Next day\")}\n >\n <ChevronRight className=\"h-5 w-5\" />\n </button>\n </div>\n\n {error ? (\n <p className=\"rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text\">\n {t(\n \"timecampus.mobile.timeline.error\",\n \"Couldn't load this day. Pull down or try again in a moment.\",\n )}\n </p>\n ) : loading && !timeline ? (\n <LoadingSkeleton variant=\"list\" count={4} />\n ) : segments.length === 0 ? (\n <EmptyState\n illustration=\"empty-sessions\"\n title={\n query\n ? t(\n \"timecampus.mobile.timeline.noMatches\",\n \"Nothing matches that search\",\n )\n : t(\n \"timecampus.mobile.timeline.emptyTitle\",\n \"Nothing tracked this day\",\n )\n }\n description={\n query\n ? t(\n \"timecampus.mobile.timeline.noMatchesHint\",\n \"Try a different word, or clear the search.\",\n )\n : t(\n \"timecampus.mobile.timeline.emptyHint\",\n \"Start the timer or connect a capture channel and your day fills in here.\",\n )\n }\n />\n ) : (\n <ol\n className=\"relative ml-14 border-l border-border-seam\"\n data-testid=\"mobile-timeline-list\"\n >\n {segments.map((segment) => {\n const meta = categoryMeta(segment.category);\n const Icon = segment.isPlanned ? CalendarClock : meta.icon;\n const project = segment.projectId\n ? projectNameById.get(segment.projectId)\n : undefined;\n return (\n <li key={segment.id} className=\"relative pb-3 pl-3\">\n <span className=\"absolute -left-14 top-3 w-12 text-right text-xs tabular-nums text-text-secondary\">\n {formatTime(segment.startTime)}\n </span>\n <span className=\"absolute -left-[5px] top-4 h-2.5 w-2.5 rounded-full border border-border-seam bg-bg-surface\" />\n <button\n type=\"button\"\n onClick={() => setSelected(segment)}\n className={cn(\n \"w-full rounded-2xl border p-3 text-left\",\n meta.card,\n segment.isPlanned && \"border-dashed bg-transparent\",\n )}\n data-testid=\"mobile-timeline-segment\"\n >\n <div className=\"flex items-start justify-between gap-2\">\n <p className=\"text-xs tabular-nums text-text-secondary\">\n {timeWindow(segment)}\n </p>\n <Icon className={cn(\"h-4 w-4 shrink-0\", meta.accent)} />\n </div>\n <p className=\"mt-1 truncate text-base font-semibold text-text-primary\">\n {segmentTitle(segment)}\n </p>\n {project && (\n <p className=\"truncate text-sm text-text-secondary\">\n {project}\n </p>\n )}\n <p className={cn(\"mt-1 text-sm\", meta.accent)}>\n {compactDuration(segment.durationSeconds)} · {meta.label}\n {segment.isPlanned\n ? ` · ${t(\"timecampus.mobile.timeline.planned\", \"Planned\")}`\n : \"\"}\n </p>\n </button>\n </li>\n );\n })}\n </ol>\n )}\n\n {selected && (\n <SegmentSheet\n segment={selected}\n project={\n selected.projectId\n ? projectNameById.get(selected.projectId)\n : undefined\n }\n onClose={() => setSelected(null)}\n onOpenFull={() =>\n navigate(\n dateKey === todayKey ? \"/timeline\" : `/timeline?date=${dateKey}`,\n )\n }\n />\n )}\n </MobileScreen>\n );\n}\n\nfunction SegmentSheet({\n segment,\n project,\n onClose,\n onOpenFull,\n}: {\n segment: Segment;\n project?: string;\n onClose: () => void;\n onOpenFull: () => void;\n}) {\n const t = useTr();\n const meta = categoryMeta(segment.category);\n\n useEffect(() => {\n const onKey = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") onClose();\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [onClose]);\n\n return (\n <div className=\"fixed inset-0 z-50 flex items-end justify-center\">\n <button\n type=\"button\"\n className=\"absolute inset-0 bg-overlay-scrim\"\n onClick={onClose}\n aria-label={t(\"timecampus.mobile.timeline.closeSheet\", \"Close details\")}\n />\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"mobile-segment-title\"\n className=\"relative w-full max-w-md rounded-t-3xl border border-border-subtle bg-bg-surface px-5 pb-[calc(env(safe-area-inset-bottom)+1.25rem)] pt-3 shadow-lg\"\n data-testid=\"mobile-timeline-sheet\"\n >\n <div className=\"mx-auto mb-3 h-1.5 w-10 rounded-full bg-bg-sunken\" />\n <div className=\"flex items-start justify-between gap-3\">\n <h3\n id=\"mobile-segment-title\"\n className=\"text-lg font-semibold text-text-primary\"\n >\n {segmentTitle(segment)}\n </h3>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"-mr-2 inline-flex h-11 w-11 items-center justify-center rounded-full text-text-secondary\"\n aria-label={t(\n \"timecampus.mobile.timeline.closeSheet\",\n \"Close details\",\n )}\n >\n <X className=\"h-5 w-5\" />\n </button>\n </div>\n <dl className=\"mt-2 space-y-2 text-sm\">\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.when\", \"When\")}\n </dt>\n <dd className=\"tabular-nums text-text-primary\">\n {timeWindow(segment)}\n </dd>\n </div>\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.duration\", \"Duration\")}\n </dt>\n <dd className=\"tabular-nums text-text-primary\">\n {compactDuration(segment.durationSeconds)}\n </dd>\n </div>\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.category\", \"Category\")}\n </dt>\n <dd className={meta.accent}>{meta.label}</dd>\n </div>\n {project && (\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.project\", \"Project\")}\n </dt>\n <dd className=\"truncate text-text-primary\">{project}</dd>\n </div>\n )}\n {segment.app && (\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.app\", \"App\")}\n </dt>\n <dd className=\"truncate text-text-primary\">{segment.app}</dd>\n </div>\n )}\n </dl>\n <button\n type=\"button\"\n onClick={onOpenFull}\n className=\"mt-5 min-h-12 w-full rounded-2xl bg-action-primary-bg text-base font-semibold text-action-primary-text\"\n >\n {segment.isRecategorizable\n ? t(\n \"timecampus.mobile.timeline.editInFull\",\n \"Edit on the full timeline\",\n )\n : t(\n \"timecampus.mobile.timeline.openFull\",\n \"Open the full timeline\",\n )}\n </button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmDA,IAAMA,IAA+B;CACnC,OAAO;CACP,MAAMC;CACN,MAAM;CACN,QAAQ;AACV,GAEMC,IAAyC;CAC7C,WAAW;EACT,OAAO;EACP,MAAMC;EACN,MAAM;EACN,QAAQ;CACV;CACA,SAAS;EACP,OAAO;EACP,MAAMC;EACN,MAAM;EACN,QAAQ;CACV;CACA,eAAe;EACb,OAAO;EACP,MAAMC;EACN,MAAM;EACN,QAAQ;CACV;CACA,OAAO;EACL,OAAO;EACP,MAAMC;EACN,MAAM;EACN,QAAQ;CACV;CACA,OAAON;AACT,GAEMO,KAAgB,MACpBL,EAASM,MAAaR,GAClBS,KAAiB,MAAqBF,EAAaC,CAAQ,CAAC,CAAC;AAEnE,SAASE,EAAa,GAA0B;CAG9C,OAFIC,EAAQ,QAAcA,EAAQ,QAC9BA,EAAQ,MAAYA,EAAQ,MACzBA,EAAQ,YACX,wBACAF,EAAcE,EAAQ,QAAQ;AACpC;AAEA,SAASC,EAAW,GAA0B;CAC5C,IAAMC,IAAQC,EAAWH,EAAQ,SAAS;CAC1C,OAAOA,EAAQ,UAAU,GAAGE,EAAM,KAAKC,EAAWH,EA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e;OACtC,CAAA,CACD;;MACL,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,MAAD;QAAI,WAAU;QACX,UAAAQ,EAAE,uCAAuC,UAAU;OAClD,CAAA,GACJ,kBAAC,MAAD;QAAI,WAAW+C,EAAK;QAAS,UAAAA,EAAK;OAAU,CAAA,CACzC;;MACJrB,KACC,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,MAAD;QAAI,WAAU;QACX,UAAA1B,EAAE,sCAAsC,SAAS;OAChD,CAAA,GACJ,kBAAC,MAAD;QAAI,WAAU;QAA8B,UAAA0B;OAAY,CAAA,CACrD;;MAENlC,EAAQ,OACP,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,MAAD;QAAI,WAAU;QACX,UAAAQ,EAAE,kCAAkC,KAAK;OACxC,CAAA,GACJ,kBAAC,MAAD;QAAI,WAAU;QAA8B,UAAAR,EAAQ;OAAQ,CAAA,CACzD;;KAEL;;IACJ,kBAAC,UAAD;KACE,MAAK;KACL,SAASiE;KACT,WAAU;KAET,UAAAjE,EAAQ,oBACLQ,EACE,yCACA,2BACF,IACAA,EACE,uCACA,wBACF;IACE,CAAA;GACL;EACF,CAAA,CAAA;;AAET"}
|
|
1
|
+
{"version":3,"file":"MobileTimelinePage.js","names":["OTHER_CATEGORY","Activity","CATEGORY","Brain","Users","MessageSquare","Coffee","categoryMeta","category","categoryLabel","segmentTitle","segment","timeWindow","start","formatTime","MobileTimelinePage","useTimeCampus","navigate","useTimeCampusNavigate","t","useTr","searchParams","setSearchParams","useSearchParams","todayKey","toLocalDateKey","linked","dateKey","parseLocalDateKey","setDateKey","next","key","query","setQuery","useState","selected","setSelected","useMemo","localDayBounds","useGetTimeCampusTimelineQuery","workspaceId","projectsData","useListProjectsQuery","projectNameById","map","project","timeline","data","summary","focusSummary","segments","filterSegments","sortByStart","MobileScreen","Search","GlassCard","compactDuration","shiftDateKey","ChevronLeft","dayHeading","longDayLabel","ChevronRight","error","loading","LoadingSkeleton","EmptyState","meta","Icon","CalendarClock","cn","SegmentSheet","useEffect","onKey","event","onClose","X","onOpenFull"],"sources":["../../../../src/timecampus/pages/mobile/MobileTimelinePage.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { useSearchParams } from \"react-router\";\nimport {\n Activity,\n Brain,\n CalendarClock,\n ChevronLeft,\n ChevronRight,\n Coffee,\n MessageSquare,\n Search,\n Users,\n X,\n} from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { EmptyState } from \"../../components/EmptyState\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport {\n useTimeCampus,\n useTimeCampusNavigate,\n} from \"../../providers/TimeCampusProvider\";\nimport { useTr } from \"../../hooks\";\nimport { cn, formatTime } from \"../../utils/helpers\";\nimport {\n useGetTimeCampusTimelineQuery,\n useListProjectsQuery,\n type TimelineSegmentFieldsFragment,\n} from \"@/generated/wspace-operations\";\nimport { MobileScreen } from \"./MobileScreen\";\nimport {\n compactDuration,\n dayHeading,\n filterSegments,\n focusSummary,\n localDayBounds,\n longDayLabel,\n parseLocalDateKey,\n shiftDateKey,\n sortByStart,\n toLocalDateKey,\n} from \"./mobileModel\";\n\ntype Segment = TimelineSegmentFieldsFragment;\n\ninterface CategoryMeta {\n label: string;\n icon: typeof Brain;\n card: string;\n accent: string;\n}\n\nconst OTHER_CATEGORY: CategoryMeta = {\n label: \"Other\",\n icon: Activity,\n card: \"border-border-subtle bg-bg-surface\",\n accent: \"text-text-secondary\",\n};\n\nconst CATEGORY: Record<string, CategoryMeta> = {\n DEEP_WORK: {\n label: \"Deep work\",\n icon: Brain,\n card: \"border-status-success-text/40 bg-status-success-bg\",\n accent: \"text-status-success-text\",\n },\n MEETING: {\n label: \"Meeting\",\n icon: Users,\n card: \"border-status-info-text/40 bg-status-info-bg\",\n accent: \"text-status-info-text\",\n },\n COMMUNICATION: {\n label: \"Communication\",\n icon: MessageSquare,\n card: \"border-status-warning-text/40 bg-status-warning-bg\",\n accent: \"text-status-warning-text\",\n },\n BREAK: {\n label: \"Break\",\n icon: Coffee,\n card: \"border-border-subtle bg-bg-sunken\",\n accent: \"text-text-secondary\",\n },\n OTHER: OTHER_CATEGORY,\n};\n\nconst categoryMeta = (category: string): CategoryMeta =>\n CATEGORY[category] ?? OTHER_CATEGORY;\nconst categoryLabel = (category: string) => categoryMeta(category).label;\n\nfunction segmentTitle(segment: Segment): string {\n if (segment.title) return segment.title;\n if (segment.app) return segment.app;\n return segment.isPlanned\n ? \"Planned focus block\"\n : categoryLabel(segment.category);\n}\n\nfunction timeWindow(segment: Segment): string {\n const start = formatTime(segment.startTime);\n return segment.endTime ? `${start} – ${formatTime(segment.endTime)}` : start;\n}\n\n/**\n * Phone timeline: the day as a vertical stack of thumb-sized cards on a time\n * rail, a focus summary on top, search, day paging, and a bottom sheet with a\n * segment's details. Editing (recategorise, assign project, drag) stays on the\n * full timeline, which the sheet links to.\n */\nexport function MobileTimelinePage() {\n const { workspaceId = \"\" } = useTimeCampus();\n const navigate = useTimeCampusNavigate();\n const t = useTr();\n const [searchParams, setSearchParams] = useSearchParams();\n\n const todayKey = toLocalDateKey(new Date());\n const linked = searchParams.get(\"date\");\n const dateKey =\n parseLocalDateKey(linked) && (linked as string) <= todayKey\n ? (linked as string)\n : todayKey;\n const setDateKey = (key: string) => {\n const next = new URLSearchParams(searchParams);\n if (key === todayKey) next.delete(\"date\");\n else next.set(\"date\", key);\n setSearchParams(next, { replace: true });\n };\n\n const [query, setQuery] = useState(\"\");\n const [selected, setSelected] = useState<Segment | null>(null);\n useEffect(() => setSelected(null), [dateKey]);\n\n const { from, to } = useMemo(() => localDayBounds(dateKey), [dateKey]);\n const { data, loading, error } = useGetTimeCampusTimelineQuery({\n variables: { from, to },\n skip: !workspaceId,\n fetchPolicy: \"cache-and-network\",\n });\n const { data: projectsData } = useListProjectsQuery({\n variables: { pagination: { limit: 200 } },\n skip: !workspaceId,\n });\n\n const projectNameById = useMemo(() => {\n const map = new Map<string, string>();\n for (const project of projectsData?.projects?.items ?? []) {\n map.set(project.id, project.name);\n }\n return map;\n }, [projectsData?.projects?.items]);\n\n const timeline = data?.timeCampusTimeline;\n const summary = focusSummary(timeline?.summary);\n const segments = useMemo(\n () =>\n filterSegments<Segment>(\n sortByStart<Segment>(timeline?.segments ?? []),\n query,\n projectNameById,\n categoryLabel,\n ),\n [timeline?.segments, query, projectNameById],\n );\n\n return (\n <MobileScreen\n active=\"timeline\"\n title={t(\"timecampus.mobile.timeline.title\", \"Timeline\")}\n fullViewPath={\n dateKey === todayKey ? \"/timeline\" : `/timeline?date=${dateKey}`\n }\n >\n <label className=\"relative block\">\n <span className=\"sr-only\">\n {t(\"timecampus.mobile.timeline.searchLabel\", \"Search this day\")}\n </span>\n <Search className=\"pointer-events-none absolute start-3 top-1/2 h-5 w-5 -translate-y-1/2 text-text-secondary\" />\n <input\n type=\"search\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n placeholder={t(\n \"timecampus.mobile.timeline.searchPlaceholder\",\n \"Search events, apps, projects…\",\n )}\n className=\"min-h-12 w-full rounded-2xl border border-border-subtle bg-bg-surface ps-10 pe-3 text-base text-text-primary placeholder:text-text-secondary\"\n data-testid=\"mobile-timeline-search\"\n />\n </label>\n\n <GlassCard\n treatment=\"glass\"\n glow\n className=\"p-4\"\n data-testid=\"mobile-timeline-summary\"\n >\n <p className=\"text-sm font-semibold text-text-primary\">\n {t(\"timecampus.mobile.timeline.focusSummary\", \"Focus summary\")}\n </p>\n <dl className=\"mt-2 grid grid-cols-3 gap-2\">\n <div>\n <dt className=\"text-xs text-text-secondary\">\n {t(\"timecampus.mobile.timeline.focusShare\", \"Focus share\")}\n </dt>\n <dd className=\"text-xl font-bold tabular-nums text-text-primary\">\n {summary.focusPercent === null ? \"—\" : `${summary.focusPercent}%`}\n </dd>\n </div>\n <div>\n <dt className=\"text-xs text-text-secondary\">\n {t(\"timecampus.mobile.timeline.deepWork\", \"Deep work\")}\n </dt>\n <dd className=\"text-xl font-bold tabular-nums text-text-primary\">\n {compactDuration(summary.deepWorkSeconds)}\n </dd>\n </div>\n <div>\n <dt className=\"text-xs text-text-secondary\">\n {t(\"timecampus.mobile.timeline.meetings\", \"Meetings\")}\n </dt>\n <dd className=\"text-xl font-bold tabular-nums text-text-primary\">\n {compactDuration(summary.meetingSeconds)}\n </dd>\n </div>\n </dl>\n </GlassCard>\n\n <div className=\"flex items-center justify-between gap-2\">\n <button\n type=\"button\"\n onClick={() => setDateKey(shiftDateKey(dateKey, -1))}\n className=\"inline-flex h-11 w-11 items-center justify-center rounded-full border border-border-subtle text-text-primary\"\n aria-label={t(\n \"timecampus.mobile.timeline.previousDay\",\n \"Previous day\",\n )}\n >\n <ChevronLeft className=\"h-5 w-5\" />\n </button>\n <div className=\"min-w-0 text-center\">\n <h2\n className=\"truncate text-lg font-bold text-text-primary\"\n data-testid=\"mobile-timeline-day\"\n >\n {dayHeading(dateKey)}\n </h2>\n <p className=\"truncate text-xs text-text-secondary\">\n {longDayLabel(dateKey)}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={() => setDateKey(shiftDateKey(dateKey, 1))}\n disabled={dateKey >= todayKey}\n className=\"inline-flex h-11 w-11 items-center justify-center rounded-full border border-border-subtle text-text-primary disabled:opacity-40\"\n aria-label={t(\"timecampus.mobile.timeline.nextDay\", \"Next day\")}\n >\n <ChevronRight className=\"h-5 w-5\" />\n </button>\n </div>\n\n {error ? (\n <p className=\"rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text\">\n {t(\n \"timecampus.mobile.timeline.error\",\n \"Couldn't load this day. Pull down or try again in a moment.\",\n )}\n </p>\n ) : loading && !timeline ? (\n <LoadingSkeleton variant=\"list\" count={4} />\n ) : segments.length === 0 ? (\n <EmptyState\n illustration=\"empty-sessions\"\n title={\n query\n ? t(\n \"timecampus.mobile.timeline.noMatches\",\n \"Nothing matches that search\",\n )\n : t(\n \"timecampus.mobile.timeline.emptyTitle\",\n \"Nothing tracked this day\",\n )\n }\n description={\n query\n ? t(\n \"timecampus.mobile.timeline.noMatchesHint\",\n \"Try a different word, or clear the search.\",\n )\n : t(\n \"timecampus.mobile.timeline.emptyHint\",\n \"Start the timer or connect a capture channel and your day fills in here.\",\n )\n }\n />\n ) : (\n <ol\n className=\"relative ms-14 border-s border-border-seam\"\n data-testid=\"mobile-timeline-list\"\n >\n {segments.map((segment) => {\n const meta = categoryMeta(segment.category);\n const Icon = segment.isPlanned ? CalendarClock : meta.icon;\n const project = segment.projectId\n ? projectNameById.get(segment.projectId)\n : undefined;\n return (\n <li key={segment.id} className=\"relative pb-3 ps-3\">\n <span className=\"absolute -start-14 top-3 w-12 text-end text-xs tabular-nums text-text-secondary\">\n {formatTime(segment.startTime)}\n </span>\n <span className=\"absolute -start-[5px] top-4 h-2.5 w-2.5 rounded-full border border-border-seam bg-bg-surface\" />\n <button\n type=\"button\"\n onClick={() => setSelected(segment)}\n className={cn(\n \"w-full rounded-2xl border p-3 text-start\",\n meta.card,\n segment.isPlanned && \"border-dashed bg-transparent\",\n )}\n data-testid=\"mobile-timeline-segment\"\n >\n <div className=\"flex items-start justify-between gap-2\">\n <p className=\"text-xs tabular-nums text-text-secondary\">\n {timeWindow(segment)}\n </p>\n <Icon className={cn(\"h-4 w-4 shrink-0\", meta.accent)} />\n </div>\n <p className=\"mt-1 truncate text-base font-semibold text-text-primary\">\n {segmentTitle(segment)}\n </p>\n {project && (\n <p className=\"truncate text-sm text-text-secondary\">\n {project}\n </p>\n )}\n <p className={cn(\"mt-1 text-sm\", meta.accent)}>\n {compactDuration(segment.durationSeconds)} · {meta.label}\n {segment.isPlanned\n ? ` · ${t(\"timecampus.mobile.timeline.planned\", \"Planned\")}`\n : \"\"}\n </p>\n </button>\n </li>\n );\n })}\n </ol>\n )}\n\n {selected && (\n <SegmentSheet\n segment={selected}\n project={\n selected.projectId\n ? projectNameById.get(selected.projectId)\n : undefined\n }\n onClose={() => setSelected(null)}\n onOpenFull={() =>\n navigate(\n dateKey === todayKey ? \"/timeline\" : `/timeline?date=${dateKey}`,\n )\n }\n />\n )}\n </MobileScreen>\n );\n}\n\nfunction SegmentSheet({\n segment,\n project,\n onClose,\n onOpenFull,\n}: {\n segment: Segment;\n project?: string;\n onClose: () => void;\n onOpenFull: () => void;\n}) {\n const t = useTr();\n const meta = categoryMeta(segment.category);\n\n useEffect(() => {\n const onKey = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") onClose();\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [onClose]);\n\n return (\n <div className=\"fixed inset-0 z-50 flex items-end justify-center\">\n <button\n type=\"button\"\n className=\"absolute inset-0 bg-overlay-scrim\"\n onClick={onClose}\n aria-label={t(\"timecampus.mobile.timeline.closeSheet\", \"Close details\")}\n />\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"mobile-segment-title\"\n className=\"relative w-full max-w-md rounded-t-3xl border border-border-subtle bg-bg-surface px-5 pb-[calc(env(safe-area-inset-bottom)+1.25rem)] pt-3 shadow-lg\"\n data-testid=\"mobile-timeline-sheet\"\n >\n <div className=\"mx-auto mb-3 h-1.5 w-10 rounded-full bg-bg-sunken\" />\n <div className=\"flex items-start justify-between gap-3\">\n <h3\n id=\"mobile-segment-title\"\n className=\"text-lg font-semibold text-text-primary\"\n >\n {segmentTitle(segment)}\n </h3>\n <button\n type=\"button\"\n onClick={onClose}\n className=\"-me-2 inline-flex h-11 w-11 items-center justify-center rounded-full text-text-secondary\"\n aria-label={t(\n \"timecampus.mobile.timeline.closeSheet\",\n \"Close details\",\n )}\n >\n <X className=\"h-5 w-5\" />\n </button>\n </div>\n <dl className=\"mt-2 space-y-2 text-sm\">\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.when\", \"When\")}\n </dt>\n <dd className=\"tabular-nums text-text-primary\">\n {timeWindow(segment)}\n </dd>\n </div>\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.duration\", \"Duration\")}\n </dt>\n <dd className=\"tabular-nums text-text-primary\">\n {compactDuration(segment.durationSeconds)}\n </dd>\n </div>\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.category\", \"Category\")}\n </dt>\n <dd className={meta.accent}>{meta.label}</dd>\n </div>\n {project && (\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.project\", \"Project\")}\n </dt>\n <dd className=\"truncate text-text-primary\">{project}</dd>\n </div>\n )}\n {segment.app && (\n <div className=\"flex justify-between gap-3\">\n <dt className=\"text-text-secondary\">\n {t(\"timecampus.mobile.timeline.app\", \"App\")}\n </dt>\n <dd className=\"truncate text-text-primary\">{segment.app}</dd>\n </div>\n )}\n </dl>\n <button\n type=\"button\"\n onClick={onOpenFull}\n className=\"mt-5 min-h-12 w-full rounded-2xl bg-action-primary-bg text-base font-semibold text-action-primary-text\"\n >\n {segment.isRecategorizable\n ? t(\n \"timecampus.mobile.timeline.editInFull\",\n \"Edit on the full timeline\",\n )\n : t(\n \"timecampus.mobile.timeline.openFull\",\n \"Open the full timeline\",\n )}\n </button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmDA,IAAMA,IAA+B;CACnC,OAAO;CACP,MAAMC;CACN,MAAM;CACN,QAAQ;AACV,GAEMC,IAAyC;CAC7C,WAAW;EACT,OAAO;EACP,MAAMC;EACN,MAAM;EACN,QAAQ;CACV;CACA,SAAS;EACP,OAAO;EACP,MAAMC;EACN,MAAM;EACN,QAAQ;CACV;CACA,eAAe;EACb,OAAO;EACP,MAAMC;EACN,MAAM;EACN,QAAQ;CACV;CACA,OAAO;EACL,OAAO;EACP,MAAMC;EACN,MAAM;EACN,QAAQ;CACV;CACA,OAAON;AACT,GAEMO,KA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ums text-text-primary",
|
|
163
163
|
children: [j?.streakDays ?? 0, /* @__PURE__ */ v("span", {
|
|
164
|
-
className: "
|
|
164
|
+
className: "ms-1 text-lg font-medium text-text-secondary",
|
|
165
165
|
children: "days"
|
|
166
166
|
})]
|
|
167
167
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PomodoroAnalyticsPage.js","names":["formatMinutes","total","min","h","m","shortDay","ts","shortTime","d","iso","isBreak","t","PomodoroSessionType","PomodoroAnalyticsPage","useTimeCampus","statsData","statsLoading","statsError","useGetPomodoroStatsQuery","workspaceId","sessionsData","sessionsLoading","useListPomodoroSessionsQuery","stats","sessions","PageLayout","LoadingSkeleton","totalFocusH","totalFocusM","avgSessions","dailyMap","s","day","key","entry","dailyData","a","b","focusSeconds","breakSeconds","focusCount","breakCount","dur","useDuration","focusValue","breakValue","donutSlices","donutFormat","formatNumber","recentSessions","completionRate","completedSessions","totalSessions","StatCard","Timer","BarChart3","Target","ChartCard","BarsChart","GlassCard","Flame","ProgressMeter","v","DonutChart","sessionIsBreak","durationLabel","jsx","Coffee","StatusBadge"],"sources":["../../../../src/timecampus/pages/pomodoro/PomodoroAnalyticsPage.tsx"],"sourcesContent":["import { BarChart3, Target, Flame, Timer, Coffee } from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport {\n PageLayout,\n StatCard,\n ChartCard,\n BarsChart,\n DonutChart,\n ProgressMeter,\n StatusBadge,\n LoadingSkeleton,\n formatNumber,\n type DonutSlice,\n} from \"../../components\";\nimport { useTimeCampus } from \"../../providers/TimeCampusProvider\";\nimport {\n useGetPomodoroStatsQuery,\n useListPomodoroSessionsQuery,\n type PomodoroSessionFieldsFragment,\n} from \"@/generated/wspace-operations\";\nimport { PomodoroSessionType } from \"@/generated/wspace-types\";\n\nfunction formatMinutes(min: number): string {\n const total = Math.max(0, Math.round(min));\n const h = Math.floor(total / 60);\n const m = total % 60;\n return h > 0 ? `${h}h ${m}m` : `${m}m`;\n}\n\nfunction shortDay(ts: number): string {\n return new Date(ts).toLocaleDateString(undefined, {\n month: \"short\",\n day: \"numeric\",\n });\n}\n\nfunction shortTime(iso: string): string {\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return \"\";\n return d.toLocaleTimeString(undefined, {\n hour: \"2-digit\",\n minute: \"2-digit\",\n });\n}\n\nconst isBreak = (t: PomodoroSessionType): boolean =>\n t === PomodoroSessionType.ShortBreak || t === PomodoroSessionType.LongBreak;\n\nexport function PomodoroAnalyticsPage() {\n const { workspaceId = \"\" } = useTimeCampus();\n\n const {\n data: statsData,\n loading: statsLoading,\n error: statsError,\n } = useGetPomodoroStatsQuery({\n variables: { workspaceId },\n skip: !workspaceId,\n });\n\n const { data: sessionsData, loading: sessionsLoading } =\n useListPomodoroSessionsQuery({\n variables: { workspaceId, pagination: { limit: 50 } },\n skip: !workspaceId,\n });\n\n const stats = statsData?.pomodoroStats;\n const sessions = sessionsData?.pomodoroSessions ?? [];\n\n if (statsLoading || sessionsLoading) {\n return (\n <PageLayout\n title=\"Pomodoro Analytics\"\n description=\"Track your focus sessions and productivity\"\n >\n <LoadingSkeleton variant=\"card\" count={4} />\n </PageLayout>\n );\n }\n\n if (statsError) {\n return (\n <PageLayout\n title=\"Pomodoro Analytics\"\n description=\"Track your focus sessions and productivity\"\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 analytics. 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 avgSessions = stats?.totalSessions\n ? (stats.totalSessions / 30).toFixed(1)\n : \"0\";\n\n // ---- Daily completed focus sessions (BarsChart) --------------------------\n const dailyMap = new Map<\n string,\n { ts: number; label: string; completed: number }\n >();\n for (const s of sessions) {\n if (s.type !== PomodoroSessionType.Focus) continue;\n const d = new Date(s.startTime);\n if (Number.isNaN(d.getTime())) continue;\n const day = new Date(d.getFullYear(), d.getMonth(), d.getDate());\n const key = String(day.getTime());\n const entry = dailyMap.get(key) ?? {\n ts: day.getTime(),\n label: shortDay(day.getTime()),\n completed: 0,\n };\n if (s.completed) entry.completed += 1;\n dailyMap.set(key, entry);\n }\n const dailyData = [...dailyMap.values()]\n .sort((a, b) => a.ts - b.ts)\n .slice(-14)\n .map((e) => ({ day: e.label, completed: e.completed }));\n\n // ---- Focus vs break split (DonutChart) -----------------------------------\n let focusSeconds = 0;\n let breakSeconds = 0;\n let focusCount = 0;\n let breakCount = 0;\n for (const s of sessions) {\n const dur =\n typeof s.duration === \"number\" && Number.isFinite(s.duration)\n ? s.duration\n : 0;\n if (isBreak(s.type)) {\n breakSeconds += dur;\n breakCount += 1;\n } else {\n focusSeconds += dur;\n focusCount += 1;\n }\n }\n const useDuration = focusSeconds + breakSeconds > 0;\n const focusValue = useDuration ? Math.round(focusSeconds / 60) : focusCount;\n const breakValue = useDuration ? Math.round(breakSeconds / 60) : breakCount;\n const donutSlices: DonutSlice[] = [\n { name: \"Focus\", value: focusValue },\n { name: \"Break\", value: breakValue },\n ];\n const donutFormat = useDuration ? formatMinutes : formatNumber;\n\n // ---- Recent sessions -----------------------------------------------------\n const recentSessions = [...sessions]\n .sort(\n (a, b) =>\n new Date(b.startTime).getTime() - new Date(a.startTime).getTime(),\n )\n .slice(0, 6);\n\n const completionRate = stats?.completionRate ?? 0;\n const completedSessions = stats?.completedSessions ?? 0;\n const totalSessions = stats?.totalSessions ?? 0;\n\n return (\n <PageLayout\n title=\"Pomodoro Analytics\"\n description=\"Track your focus sessions and productivity\"\n purpose=\"See whether your focus habit is sticking — completion rate, streaks and focus minutes over time — so you can tell good-focus days from distracted ones and keep your momentum going.\"\n >\n <div className=\"space-y-6\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatCard\n featured\n title=\"Total Sessions\"\n value={String(stats?.totalSessions ?? 0)}\n trend={{\n value: stats?.completionRate ?? 0,\n label: \"completion rate\",\n }}\n />\n <StatCard\n title=\"Total Focus Time\"\n value={`${totalFocusH}h ${totalFocusM}m`}\n icon={<Timer className=\"h-5 w-5\" />}\n trend={{\n value: stats?.averageSessionMinutes ?? 0,\n label: \"avg min/session\",\n }}\n />\n <StatCard\n title=\"Avg. Sessions/Day\"\n value={avgSessions}\n icon={<BarChart3 className=\"h-5 w-5\" />}\n description={`Target: ${stats?.totalSessions ?? 0} total`}\n />\n <StatCard\n title=\"Completion Rate\"\n value={`${stats?.completionRate ?? 0}%`}\n icon={<Target className=\"h-5 w-5\" />}\n trend={{ value: stats?.streakDays ?? 0, label: \"day streak\" }}\n />\n </div>\n\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n <ChartCard\n className=\"lg:col-span-2\"\n title=\"Daily Completed Focus Sessions\"\n description=\"Pomodoros you finished, by day\"\n >\n <BarsChart\n data={dailyData}\n xKey=\"day\"\n series={[{ key: \"completed\", label: \"Completed\" }]}\n height={260}\n emptyLabel=\"No completed focus sessions yet.\"\n ariaLabel=\"Completed focus sessions by day\"\n />\n </ChartCard>\n\n <GlassCard treatment=\"glass\" glow className=\"p-5 sm:p-6\">\n <div className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <Flame className=\"h-4 w-4 text-primary\" />\n Current Focus Streak\n </div>\n <p className=\"mt-2 text-4xl font-bold tabular-nums text-text-primary\">\n {stats?.streakDays ?? 0}\n <span className=\"ml-1 text-lg font-medium text-text-secondary\">\n days\n </span>\n </p>\n <div className=\"mt-6 space-y-5\">\n <ProgressMeter\n value={completionRate}\n max={100}\n higherIsWorse={false}\n label=\"Completion rate\"\n format={(v) => `${Math.round(v)}%`}\n />\n <ProgressMeter\n value={completedSessions}\n max={totalSessions > 0 ? totalSessions : 1}\n higherIsWorse={false}\n label=\"Sessions completed\"\n />\n </div>\n </GlassCard>\n </div>\n\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-2\">\n <ChartCard\n title=\"Focus vs Break\"\n description={\n useDuration\n ? \"Share of tracked time spent focusing vs. on breaks\"\n : \"Share of sessions by type\"\n }\n >\n <DonutChart\n data={donutSlices}\n centerLabel={useDuration ? \"total tracked\" : \"sessions\"}\n valueFormat={donutFormat}\n height={260}\n emptyLabel=\"No sessions recorded yet.\"\n ariaLabel=\"Focus versus break split\"\n />\n </ChartCard>\n\n <GlassCard treatment=\"glass\" className=\"p-5 sm:p-6\">\n <h3 className=\"mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <Timer className=\"h-4 w-4 text-primary\" />\n Recent Sessions\n </h3>\n {recentSessions.length === 0 ? (\n <p className=\"py-6 text-center text-sm text-text-secondary\">\n No focus sessions yet. Start a pomodoro to see it here.\n </p>\n ) : (\n <div className=\"space-y-2.5\">\n {recentSessions.map((s: PomodoroSessionFieldsFragment) => {\n const sessionIsBreak = isBreak(s.type);\n const durationLabel =\n typeof s.duration === \"number\" &&\n Number.isFinite(s.duration)\n ? `${Math.round(s.duration / 60)}m`\n : \"--\";\n return (\n <div\n key={s.id}\n className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface/40 p-3\"\n >\n <div\n className={`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg ${\n sessionIsBreak\n ? \"bg-status-info-bg text-status-info-text\"\n : \"bg-action-primary-bg/10 text-primary\"\n }`}\n >\n {sessionIsBreak ? (\n <Coffee className=\"h-4 w-4\" />\n ) : (\n <Timer className=\"h-4 w-4\" />\n )}\n </div>\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {s.notes?.trim()\n ? s.notes\n : sessionIsBreak\n ? \"Break\"\n : \"Focus session\"}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {durationLabel} · {shortTime(s.startTime)}\n </p>\n </div>\n <StatusBadge\n variant={\n s.completed\n ? \"success\"\n : s.interrupted\n ? \"warning\"\n : \"muted\"\n }\n label={\n s.completed\n ? \"Completed\"\n : s.interrupted\n ? \"Interrupted\"\n : \"In progress\"\n }\n />\n </div>\n );\n })}\n </div>\n )}\n </GlassCard>\n </div>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,SAASA,EAAc,GAAqB;CAC1C,IAAMC,IAAQ,KAAK,IAAI,GAAG,KAAK,MAAMC,CAAG,CAAC,GACnCC,IAAI,KAAK,MAAMF,IAAQ,EAAE,GACzBG,IAAIH,IAAQ;CAClB,OAAOE,IAAI,IAAI,GAAGA,EAAE,IAAIC,EAAE,KAAK,GAAGA,EAAE;AACtC;AAEA,SAASC,EAAS,GAAoB;CACpC,OAAO,IAAI,KAAKC,CAAE,CAAC,CAAC,mBAAmB,KAAA,GAAW;EAChD,OAAO;EACP,KAAK;CACP,CAAC;AACH;AAEA,SAASC,EAAU,GAAqB;CACtC,IAAMC,IAAI,IAAI,KAAKC,CAAG;CAEtB,OADI,OAAO,MAAMD,EAAE,QAAQ,CAAC,IAAU,KAC/BA,EAAE,mBAAmB,KAAA,GAAW;EACrC,MAAM;EACN,QAAQ;CACV,CAAC;AACH;AAEA,IAAME,KAAW,MACfC,MAAMC,EAAoB,cAAcD,MAAMC,EAAoB;AAEpE,SAAgBC,IAAwB;CACtC,IAAM,EAAE,iBAAc,OAAOC,EAAc,GAErC,EACJ,MAAMC,GACN,SAASC,GACT,OAAOC,MACLC,EAAyB;EAC3B,WAAW,EAAE,eAAY;EACzB,MAAM,CAACC;CACT,CAAC,GAEK,EAAE,MAAMC,GAAc,SAASC,MACnCC,EAA6B;EAC3B,WAAW;GAAE;GAAa,YAAY,EAAE,OAAO,GAAG;EAAE;EACpD,MAAM,CAACH;CACT,CAAC,GAEGI,IAAQR,GAAW,eACnBS,IAAWJ,GAAc,oBAAoB,CAAC;CAEpD,IAAIJ,KAAgBK,GAClB,OACE,kBAACI,GAAD;EACE,OAAM;EACN,aAAY;EAEZ,UAAA,kBAACC,GAAD;GAAiB,SAAQ;GAAO,O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EhB"}
|
|
1
|
+
{"version":3,"file":"PomodoroAnalyticsPage.js","names":["formatMinutes","total","min","h","m","shortDay","ts","shortTime","d","iso","isBreak","t","PomodoroSessionType","PomodoroAnalyticsPage","useTimeCampus","statsData","statsLoading","statsError","useGetPomodoroStatsQuery","workspaceId","sessionsData","sessionsLoading","useListPomodoroSessionsQuery","stats","sessions","PageLayout","LoadingSkeleton","totalFocusH","totalFocusM","avgSessions","dailyMap","s","day","key","entry","dailyData","a","b","focusSeconds","breakSeconds","focusCount","breakCount","dur","useDuration","focusValue","breakValue","donutSlices","donutFormat","formatNumber","recentSessions","completionRate","completedSessions","totalSessions","StatCard","Timer","BarChart3","Target","ChartCard","BarsChart","GlassCard","Flame","ProgressMeter","v","DonutChart","sessionIsBreak","durationLabel","jsx","Coffee","StatusBadge"],"sources":["../../../../src/timecampus/pages/pomodoro/PomodoroAnalyticsPage.tsx"],"sourcesContent":["import { BarChart3, Target, Flame, Timer, Coffee } from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport {\n PageLayout,\n StatCard,\n ChartCard,\n BarsChart,\n DonutChart,\n ProgressMeter,\n StatusBadge,\n LoadingSkeleton,\n formatNumber,\n type DonutSlice,\n} from \"../../components\";\nimport { useTimeCampus } from \"../../providers/TimeCampusProvider\";\nimport {\n useGetPomodoroStatsQuery,\n useListPomodoroSessionsQuery,\n type PomodoroSessionFieldsFragment,\n} from \"@/generated/wspace-operations\";\nimport { PomodoroSessionType } from \"@/generated/wspace-types\";\n\nfunction formatMinutes(min: number): string {\n const total = Math.max(0, Math.round(min));\n const h = Math.floor(total / 60);\n const m = total % 60;\n return h > 0 ? `${h}h ${m}m` : `${m}m`;\n}\n\nfunction shortDay(ts: number): string {\n return new Date(ts).toLocaleDateString(undefined, {\n month: \"short\",\n day: \"numeric\",\n });\n}\n\nfunction shortTime(iso: string): string {\n const d = new Date(iso);\n if (Number.isNaN(d.getTime())) return \"\";\n return d.toLocaleTimeString(undefined, {\n hour: \"2-digit\",\n minute: \"2-digit\",\n });\n}\n\nconst isBreak = (t: PomodoroSessionType): boolean =>\n t === PomodoroSessionType.ShortBreak || t === PomodoroSessionType.LongBreak;\n\nexport function PomodoroAnalyticsPage() {\n const { workspaceId = \"\" } = useTimeCampus();\n\n const {\n data: statsData,\n loading: statsLoading,\n error: statsError,\n } = useGetPomodoroStatsQuery({\n variables: { workspaceId },\n skip: !workspaceId,\n });\n\n const { data: sessionsData, loading: sessionsLoading } =\n useListPomodoroSessionsQuery({\n variables: { workspaceId, pagination: { limit: 50 } },\n skip: !workspaceId,\n });\n\n const stats = statsData?.pomodoroStats;\n const sessions = sessionsData?.pomodoroSessions ?? [];\n\n if (statsLoading || sessionsLoading) {\n return (\n <PageLayout\n title=\"Pomodoro Analytics\"\n description=\"Track your focus sessions and productivity\"\n >\n <LoadingSkeleton variant=\"card\" count={4} />\n </PageLayout>\n );\n }\n\n if (statsError) {\n return (\n <PageLayout\n title=\"Pomodoro Analytics\"\n description=\"Track your focus sessions and productivity\"\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 analytics. 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 avgSessions = stats?.totalSessions\n ? (stats.totalSessions / 30).toFixed(1)\n : \"0\";\n\n // ---- Daily completed focus sessions (BarsChart) --------------------------\n const dailyMap = new Map<\n string,\n { ts: number; label: string; completed: number }\n >();\n for (const s of sessions) {\n if (s.type !== PomodoroSessionType.Focus) continue;\n const d = new Date(s.startTime);\n if (Number.isNaN(d.getTime())) continue;\n const day = new Date(d.getFullYear(), d.getMonth(), d.getDate());\n const key = String(day.getTime());\n const entry = dailyMap.get(key) ?? {\n ts: day.getTime(),\n label: shortDay(day.getTime()),\n completed: 0,\n };\n if (s.completed) entry.completed += 1;\n dailyMap.set(key, entry);\n }\n const dailyData = [...dailyMap.values()]\n .sort((a, b) => a.ts - b.ts)\n .slice(-14)\n .map((e) => ({ day: e.label, completed: e.completed }));\n\n // ---- Focus vs break split (DonutChart) -----------------------------------\n let focusSeconds = 0;\n let breakSeconds = 0;\n let focusCount = 0;\n let breakCount = 0;\n for (const s of sessions) {\n const dur =\n typeof s.duration === \"number\" && Number.isFinite(s.duration)\n ? s.duration\n : 0;\n if (isBreak(s.type)) {\n breakSeconds += dur;\n breakCount += 1;\n } else {\n focusSeconds += dur;\n focusCount += 1;\n }\n }\n const useDuration = focusSeconds + breakSeconds > 0;\n const focusValue = useDuration ? Math.round(focusSeconds / 60) : focusCount;\n const breakValue = useDuration ? Math.round(breakSeconds / 60) : breakCount;\n const donutSlices: DonutSlice[] = [\n { name: \"Focus\", value: focusValue },\n { name: \"Break\", value: breakValue },\n ];\n const donutFormat = useDuration ? formatMinutes : formatNumber;\n\n // ---- Recent sessions -----------------------------------------------------\n const recentSessions = [...sessions]\n .sort(\n (a, b) =>\n new Date(b.startTime).getTime() - new Date(a.startTime).getTime(),\n )\n .slice(0, 6);\n\n const completionRate = stats?.completionRate ?? 0;\n const completedSessions = stats?.completedSessions ?? 0;\n const totalSessions = stats?.totalSessions ?? 0;\n\n return (\n <PageLayout\n title=\"Pomodoro Analytics\"\n description=\"Track your focus sessions and productivity\"\n purpose=\"See whether your focus habit is sticking — completion rate, streaks and focus minutes over time — so you can tell good-focus days from distracted ones and keep your momentum going.\"\n >\n <div className=\"space-y-6\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatCard\n featured\n title=\"Total Sessions\"\n value={String(stats?.totalSessions ?? 0)}\n trend={{\n value: stats?.completionRate ?? 0,\n label: \"completion rate\",\n }}\n />\n <StatCard\n title=\"Total Focus Time\"\n value={`${totalFocusH}h ${totalFocusM}m`}\n icon={<Timer className=\"h-5 w-5\" />}\n trend={{\n value: stats?.averageSessionMinutes ?? 0,\n label: \"avg min/session\",\n }}\n />\n <StatCard\n title=\"Avg. Sessions/Day\"\n value={avgSessions}\n icon={<BarChart3 className=\"h-5 w-5\" />}\n description={`Target: ${stats?.totalSessions ?? 0} total`}\n />\n <StatCard\n title=\"Completion Rate\"\n value={`${stats?.completionRate ?? 0}%`}\n icon={<Target className=\"h-5 w-5\" />}\n trend={{ value: stats?.streakDays ?? 0, label: \"day streak\" }}\n />\n </div>\n\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n <ChartCard\n className=\"lg:col-span-2\"\n title=\"Daily Completed Focus Sessions\"\n description=\"Pomodoros you finished, by day\"\n >\n <BarsChart\n data={dailyData}\n xKey=\"day\"\n series={[{ key: \"completed\", label: \"Completed\" }]}\n height={260}\n emptyLabel=\"No completed focus sessions yet.\"\n ariaLabel=\"Completed focus sessions by day\"\n />\n </ChartCard>\n\n <GlassCard treatment=\"glass\" glow className=\"p-5 sm:p-6\">\n <div className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <Flame className=\"h-4 w-4 text-primary\" />\n Current Focus Streak\n </div>\n <p className=\"mt-2 text-4xl font-bold tabular-nums text-text-primary\">\n {stats?.streakDays ?? 0}\n <span className=\"ms-1 text-lg font-medium text-text-secondary\">\n days\n </span>\n </p>\n <div className=\"mt-6 space-y-5\">\n <ProgressMeter\n value={completionRate}\n max={100}\n higherIsWorse={false}\n label=\"Completion rate\"\n format={(v) => `${Math.round(v)}%`}\n />\n <ProgressMeter\n value={completedSessions}\n max={totalSessions > 0 ? totalSessions : 1}\n higherIsWorse={false}\n label=\"Sessions completed\"\n />\n </div>\n </GlassCard>\n </div>\n\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-2\">\n <ChartCard\n title=\"Focus vs Break\"\n description={\n useDuration\n ? \"Share of tracked time spent focusing vs. on breaks\"\n : \"Share of sessions by type\"\n }\n >\n <DonutChart\n data={donutSlices}\n centerLabel={useDuration ? \"total tracked\" : \"sessions\"}\n valueFormat={donutFormat}\n height={260}\n emptyLabel=\"No sessions recorded yet.\"\n ariaLabel=\"Focus versus break split\"\n />\n </ChartCard>\n\n <GlassCard treatment=\"glass\" className=\"p-5 sm:p-6\">\n <h3 className=\"mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <Timer className=\"h-4 w-4 text-primary\" />\n Recent Sessions\n </h3>\n {recentSessions.length === 0 ? (\n <p className=\"py-6 text-center text-sm text-text-secondary\">\n No focus sessions yet. Start a pomodoro to see it here.\n </p>\n ) : (\n <div className=\"space-y-2.5\">\n {recentSessions.map((s: PomodoroSessionFieldsFragment) => {\n const sessionIsBreak = isBreak(s.type);\n const durationLabel =\n typeof s.duration === \"number\" &&\n Number.isFinite(s.duration)\n ? `${Math.round(s.duration / 60)}m`\n : \"--\";\n return (\n <div\n key={s.id}\n className=\"flex items-center gap-3 rounded-lg border border-border-subtle bg-bg-surface/40 p-3\"\n >\n <div\n className={`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg ${\n sessionIsBreak\n ? \"bg-status-info-bg text-status-info-text\"\n : \"bg-action-primary-bg/10 text-primary\"\n }`}\n >\n {sessionIsBreak ? (\n <Coffee className=\"h-4 w-4\" />\n ) : (\n <Timer className=\"h-4 w-4\" />\n )}\n </div>\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-text-primary\">\n {s.notes?.trim()\n ? s.notes\n : sessionIsBreak\n ? \"Break\"\n : \"Focus session\"}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {durationLabel} · {shortTime(s.startTime)}\n </p>\n </div>\n <StatusBadge\n variant={\n s.completed\n ? \"success\"\n : s.interrupted\n ? \"warning\"\n : \"muted\"\n }\n label={\n s.completed\n ? \"Completed\"\n : s.interrupted\n ? \"Interrupted\"\n : \"In progress\"\n }\n />\n </div>\n );\n })}\n </div>\n )}\n </GlassCard>\n </div>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,SAASA,EAAc,GAAqB;CAC1C,IA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MAAD;OAAI,WAAU;OAAd,UAAA,CACE,kBAACL,GAAD,EAAO,WAAU,uBAAwB,CAAA,GAAC,iBAExC;MACH,CAAA,GAAAL,EAAe,WAAW,IACzB,kBAAC,KAAD;OAAG,WAAU;OAA+C,UAAA;MAEzD,CAAA,IAEH,kBAAC,OAAD;OAAK,WAAU;OACZ,UAAAA,EAAe,KAAK,MAAqC;QACxD,IAAMe,IAAiBtD,EAAQqB,EAAE,IAAI,GAC/BkC,IACJ,OAAOlC,EAAE,YAAa,YACtB,OAAO,SAASA,EAAE,QAAQ,IACtB,GAAG,KAAK,MAAMA,EAAE,WAAW,EAAE,EAAE,KAC/B;QACN,OACE,kBAAC,OAAD;SAEE,WAAU;SAFZ,UAAA;UAIE,kBAAC,OAAD;WACE,WAAW,gEACTiC,IACI,4CACA;WAGL,UACCE,EADDF,IACEG,IAEAb,GAFD,EAAQ,WAAU,UAAW,CAED;UAE3B,CAAA;UACL,kBAAC,OAAD;WAAK,WAAU;WAAf,UAAA,CACE,kBAAC,KAAD;YAAG,WAAU;YACV,UAAAvB,EAAE,OAAO,KAAK,IACXA,EAAE,QACFiC,IACE,UACA;WACL,CAAA,GACH,kBAAC,KAAD;YAAG,WAAU;YAAb,UAAA;aACGC;aAAc;aAAI1D,EAAUwB,EAAE,SAAS;YACvC;WACA,CAAA,CAAA;;UACL,kBAACqC,GAAD;WACE,SACErC,EAAE,YACE,YACAA,EAAE,cACA,YACA;WAER,OACEA,EAAE,YACE,cACAA,EAAE,cACA,gBACA;UAET,CAAA;SACE;QA5CE,GAAAA,EAAE,EA4CJ;OAET,CAAC;MACE,CAAA,CAEE;KACR,CAAA,CAAA;;GACF;;CACK,CAAA;AAEhB"}
|
|
@@ -80,7 +80,7 @@ function m() {
|
|
|
80
80
|
min: "1",
|
|
81
81
|
value: x,
|
|
82
82
|
onChange: (e) => S(Number(e.target.value)),
|
|
83
|
-
className: "w-20 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary text-
|
|
83
|
+
className: "w-20 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary text-end"
|
|
84
84
|
})]
|
|
85
85
|
}),
|
|
86
86
|
/* @__PURE__ */ f("div", {
|
|
@@ -96,7 +96,7 @@ function m() {
|
|
|
96
96
|
min: "1",
|
|
97
97
|
value: C,
|
|
98
98
|
onChange: (e) => w(Number(e.target.value)),
|
|
99
|
-
className: "w-20 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary text-
|
|
99
|
+
className: "w-20 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary text-end"
|
|
100
100
|
})]
|
|
101
101
|
}),
|
|
102
102
|
/* @__PURE__ */ f("div", {
|
|
@@ -112,7 +112,7 @@ function m() {
|
|
|
112
112
|
min: "1",
|
|
113
113
|
value: T,
|
|
114
114
|
onChange: (e) => E(Number(e.target.value)),
|
|
115
|
-
className: "w-20 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary text-
|
|
115
|
+
className: "w-20 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary text-end"
|
|
116
116
|
})]
|
|
117
117
|
})
|
|
118
118
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PomodoroSettingsPage.js","names":["PomodoroSettingsPage","useTimeCampus","useGetPomodoroSettingsQuery","workspaceId","updateSettings","saving","useUpdatePomodoroSettingsMutation","settings","data","focusDuration","setFocusDuration","useState","shortBreak","setShortBreak","longBreak","setLongBreak","soundEnabled","setSoundEnabled","notificationsEnabled","setNotificationsEnabled","autoStartBreaks","setAutoStartBreaks","secondsToMinutes","handleSave","useCallback","minutesToSeconds","loading","PageLayout","LoadingSkeleton","error","GlassCard","Settings"],"sources":["../../../../src/timecampus/pages/pomodoro/PomodoroSettingsPage.tsx"],"sourcesContent":["import { useState, useEffect, useCallback } from \"react\";\nimport { Settings } from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { PageLayout } from \"../../components/PageLayout\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport { useTimeCampus } from \"../../providers/TimeCampusProvider\";\nimport {\n useGetPomodoroSettingsQuery,\n useUpdatePomodoroSettingsMutation,\n} from \"@/generated/wspace-operations\";\nimport { minutesToSeconds, secondsToMinutes } from \"./pomodoroDuration\";\n\nexport function PomodoroSettingsPage() {\n const { workspaceId = \"\" } = useTimeCampus();\n\n const { data, loading, error } = useGetPomodoroSettingsQuery({\n variables: { workspaceId },\n skip: !workspaceId,\n });\n\n const [updateSettings, { loading: saving }] =\n useUpdatePomodoroSettingsMutation();\n\n const settings = data?.pomodoroSettings;\n\n const [focusDuration, setFocusDuration] = useState(25);\n const [shortBreak, setShortBreak] = useState(5);\n const [longBreak, setLongBreak] = useState(15);\n const [soundEnabled, setSoundEnabled] = useState(true);\n const [notificationsEnabled, setNotificationsEnabled] = useState(true);\n const [autoStartBreaks, setAutoStartBreaks] = useState(false);\n\n useEffect(() => {\n if (settings) {\n setFocusDuration(secondsToMinutes(settings.focusDuration));\n setShortBreak(secondsToMinutes(settings.shortBreakDuration));\n setLongBreak(secondsToMinutes(settings.longBreakDuration));\n setSoundEnabled(settings.soundEnabled);\n setNotificationsEnabled(settings.notificationsEnabled);\n setAutoStartBreaks(settings.autoStartBreaks);\n }\n }, [settings]);\n\n const handleSave = useCallback(async () => {\n if (!workspaceId) return;\n await updateSettings({\n variables: {\n input: {\n workspaceId,\n focusDuration: minutesToSeconds(focusDuration),\n shortBreakDuration: minutesToSeconds(shortBreak),\n longBreakDuration: minutesToSeconds(longBreak),\n soundEnabled,\n notificationsEnabled,\n autoStartBreaks,\n },\n },\n refetchQueries: [\"GetPomodoroSettings\"],\n });\n }, [\n workspaceId,\n focusDuration,\n shortBreak,\n longBreak,\n soundEnabled,\n notificationsEnabled,\n autoStartBreaks,\n updateSettings,\n ]);\n\n if (loading) {\n return (\n <PageLayout\n title=\"Pomodoro Settings\"\n description=\"Configure your Pomodoro timer preferences\"\n >\n <LoadingSkeleton variant=\"detail\" />\n </PageLayout>\n );\n }\n\n if (error) {\n return (\n <PageLayout\n title=\"Pomodoro Settings\"\n description=\"Configure your Pomodoro timer preferences\"\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 settings. Please try again later.\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title=\"Pomodoro Settings\"\n description=\"Configure your Pomodoro timer preferences\"\n purpose=\"Shape the Pomodoro technique around how you actually work — set focus and break lengths and decide how you're nudged — so the timer fits your rhythm instead of fighting it.\"\n >\n <div className=\"mx-auto max-w-2xl space-y-6\">\n <GlassCard treatment=\"glass\" glow className=\"p-6\">\n <h3 className=\"mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <Settings className=\"h-4 w-4\" />\n Timer Durations\n </h3>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n Focus Duration\n </p>\n <p className=\"text-xs text-text-secondary\">\n Length of each focus session\n </p>\n </div>\n <input\n type=\"number\"\n min=\"1\"\n value={focusDuration}\n onChange={(e) => setFocusDuration(Number(e.target.value))}\n className=\"w-20 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary text-right\"\n />\n </div>\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n Short Break\n </p>\n <p className=\"text-xs text-text-secondary\">\n Break between focus sessions\n </p>\n </div>\n <input\n type=\"number\"\n min=\"1\"\n value={shortBreak}\n onChange={(e) => setShortBreak(Number(e.target.value))}\n className=\"w-20 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary text-right\"\n />\n </div>\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n Long Break\n </p>\n <p className=\"text-xs text-text-secondary\">\n After every 4 focus sessions\n </p>\n </div>\n <input\n type=\"number\"\n min=\"1\"\n value={longBreak}\n onChange={(e) => setLongBreak(Number(e.target.value))}\n className=\"w-20 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary text-right\"\n />\n </div>\n </div>\n </GlassCard>\n\n <div className=\"rounded-xl border border-border-seam bg-bg-surface shadow-elevation-1 p-6\">\n <h3 className=\"mb-4 text-sm font-semibold text-text-primary\">\n Notifications\n </h3>\n <div className=\"space-y-3\">\n <label className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-primary\">Sound alerts</span>\n <input\n type=\"checkbox\"\n checked={soundEnabled}\n onChange={(e) => setSoundEnabled(e.target.checked)}\n className=\"h-4 w-4 rounded border-border-subtle\"\n />\n </label>\n <label className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-primary\">\n Desktop notifications\n </span>\n <input\n type=\"checkbox\"\n checked={notificationsEnabled}\n onChange={(e) => setNotificationsEnabled(e.target.checked)}\n className=\"h-4 w-4 rounded border-border-subtle\"\n />\n </label>\n <label className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-primary\">\n Auto-start breaks\n </span>\n <input\n type=\"checkbox\"\n checked={autoStartBreaks}\n onChange={(e) => setAutoStartBreaks(e.target.checked)}\n className=\"h-4 w-4 rounded border-border-subtle\"\n />\n </label>\n </div>\n </div>\n\n <div className=\"flex justify-end\">\n <button\n onClick={handleSave}\n disabled={saving}\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 {saving ? \"Saving...\" : \"Save Settings\"}\n </button>\n </div>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;AAYA,SAAgBA,IAAuB;CACrC,IAAM,EAAE,iBAAc,OAAOC,EAAc,GAErC,EAAE,SAAM,YAAS,aAAUC,EAA4B;EAC3D,WAAW,EAAE,eAAY;EACzB,MAAM,CAACC;CACT,CAAC,GAEK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ACpD,WAAU;QACX,CAAA,CACE;;MACF;KACI,CAAA,CAAA;;IAEX,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,kBAAC,MAAD;MAAI,WAAU;MAA+C,UAAA;KAEzD,CAAA,GACJ,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA;OACE,kBAAC,SAAD;QAAO,WAAU;QAAjB,UAAA,CACE,kBAAC,QAAD;SAAM,WAAU;SAA4B,UAAA;QAAkB,CAAA,GAC9D,kBAAC,SAAD;SACE,MAAK;SACL,SAASC;SACT,WAAW,MAAMC,EAAgB,EAAE,OAAO,OAAO;SACjD,WAAU;QACX,CAAA,CACI;;OACP,kBAAC,SAAD;QAAO,WAAU;QAAjB,UAAA,CACE,kBAAC,QAAD;SAAM,WAAU;SAA4B,UAAA;QAEtC,CAAA,GACN,kBAAC,SAAD;SACE,MAAK;SACL,SAASC;SACT,WAAW,MAAMC,EAAwB,EAAE,OAAO,OAAO;SACzD,WAAU;QACX,CAAA,CACI;;OACP,kBAAC,SAAD;QAAO,WAAU;QAAjB,UAAA,CACE,kBAAC,QAAD;SAAM,WAAU;SAA4B,UAAA;QAEtC,CAAA,GACN,kBAAC,SAAD;SACE,MAAK;SACL,SAASC;SACT,WAAW,MAAMC,EAAmB,EAAE,OAAO,OAAO;SACpD,WAAU;QACX,CAAA,CACI;;MACJ;KACF,CAAA,CAAA;;IAEL,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAAC,UAAD;MACE,SAASE;MACT,UAAUlB;MACV,WAAU;MAET,UAAAA,IAAS,cAAc;KAClB,CAAA;IACL,CAAA;GACF;;CACK,CAAA;AAEhB"}
|
|
1
|
+
{"version":3,"file":"PomodoroSettingsPage.js","names":["PomodoroSettingsPage","useTimeCampus","useGetPomodoroSettingsQuery","workspaceId","updateSettings","saving","useUpdatePomodoroSettingsMutation","settings","data","focusDuration","setFocusDuration","useState","shortBreak","setShortBreak","longBreak","setLongBreak","soundEnabled","setSoundEnabled","notificationsEnabled","setNotificationsEnabled","autoStartBreaks","setAutoStartBreaks","secondsToMinutes","handleSave","useCallback","minutesToSeconds","loading","PageLayout","LoadingSkeleton","error","GlassCard","Settings"],"sources":["../../../../src/timecampus/pages/pomodoro/PomodoroSettingsPage.tsx"],"sourcesContent":["import { useState, useEffect, useCallback } from \"react\";\nimport { Settings } from \"lucide-react\";\nimport { GlassCard } from \"@burdenoff/fe-libs/ui\";\nimport { PageLayout } from \"../../components/PageLayout\";\nimport { LoadingSkeleton } from \"../../components/LoadingSkeleton\";\nimport { useTimeCampus } from \"../../providers/TimeCampusProvider\";\nimport {\n useGetPomodoroSettingsQuery,\n useUpdatePomodoroSettingsMutation,\n} from \"@/generated/wspace-operations\";\nimport { minutesToSeconds, secondsToMinutes } from \"./pomodoroDuration\";\n\nexport function PomodoroSettingsPage() {\n const { workspaceId = \"\" } = useTimeCampus();\n\n const { data, loading, error } = useGetPomodoroSettingsQuery({\n variables: { workspaceId },\n skip: !workspaceId,\n });\n\n const [updateSettings, { loading: saving }] =\n useUpdatePomodoroSettingsMutation();\n\n const settings = data?.pomodoroSettings;\n\n const [focusDuration, setFocusDuration] = useState(25);\n const [shortBreak, setShortBreak] = useState(5);\n const [longBreak, setLongBreak] = useState(15);\n const [soundEnabled, setSoundEnabled] = useState(true);\n const [notificationsEnabled, setNotificationsEnabled] = useState(true);\n const [autoStartBreaks, setAutoStartBreaks] = useState(false);\n\n useEffect(() => {\n if (settings) {\n setFocusDuration(secondsToMinutes(settings.focusDuration));\n setShortBreak(secondsToMinutes(settings.shortBreakDuration));\n setLongBreak(secondsToMinutes(settings.longBreakDuration));\n setSoundEnabled(settings.soundEnabled);\n setNotificationsEnabled(settings.notificationsEnabled);\n setAutoStartBreaks(settings.autoStartBreaks);\n }\n }, [settings]);\n\n const handleSave = useCallback(async () => {\n if (!workspaceId) return;\n await updateSettings({\n variables: {\n input: {\n workspaceId,\n focusDuration: minutesToSeconds(focusDuration),\n shortBreakDuration: minutesToSeconds(shortBreak),\n longBreakDuration: minutesToSeconds(longBreak),\n soundEnabled,\n notificationsEnabled,\n autoStartBreaks,\n },\n },\n refetchQueries: [\"GetPomodoroSettings\"],\n });\n }, [\n workspaceId,\n focusDuration,\n shortBreak,\n longBreak,\n soundEnabled,\n notificationsEnabled,\n autoStartBreaks,\n updateSettings,\n ]);\n\n if (loading) {\n return (\n <PageLayout\n title=\"Pomodoro Settings\"\n description=\"Configure your Pomodoro timer preferences\"\n >\n <LoadingSkeleton variant=\"detail\" />\n </PageLayout>\n );\n }\n\n if (error) {\n return (\n <PageLayout\n title=\"Pomodoro Settings\"\n description=\"Configure your Pomodoro timer preferences\"\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 settings. Please try again later.\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title=\"Pomodoro Settings\"\n description=\"Configure your Pomodoro timer preferences\"\n purpose=\"Shape the Pomodoro technique around how you actually work — set focus and break lengths and decide how you're nudged — so the timer fits your rhythm instead of fighting it.\"\n >\n <div className=\"mx-auto max-w-2xl space-y-6\">\n <GlassCard treatment=\"glass\" glow className=\"p-6\">\n <h3 className=\"mb-4 flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <Settings className=\"h-4 w-4\" />\n Timer Durations\n </h3>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n Focus Duration\n </p>\n <p className=\"text-xs text-text-secondary\">\n Length of each focus session\n </p>\n </div>\n <input\n type=\"number\"\n min=\"1\"\n value={focusDuration}\n onChange={(e) => setFocusDuration(Number(e.target.value))}\n className=\"w-20 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary text-end\"\n />\n </div>\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n Short Break\n </p>\n <p className=\"text-xs text-text-secondary\">\n Break between focus sessions\n </p>\n </div>\n <input\n type=\"number\"\n min=\"1\"\n value={shortBreak}\n onChange={(e) => setShortBreak(Number(e.target.value))}\n className=\"w-20 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary text-end\"\n />\n </div>\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n Long Break\n </p>\n <p className=\"text-xs text-text-secondary\">\n After every 4 focus sessions\n </p>\n </div>\n <input\n type=\"number\"\n min=\"1\"\n value={longBreak}\n onChange={(e) => setLongBreak(Number(e.target.value))}\n className=\"w-20 rounded-md border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm text-text-primary text-end\"\n />\n </div>\n </div>\n </GlassCard>\n\n <div className=\"rounded-xl border border-border-seam bg-bg-surface shadow-elevation-1 p-6\">\n <h3 className=\"mb-4 text-sm font-semibold text-text-primary\">\n Notifications\n </h3>\n <div className=\"space-y-3\">\n <label className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-primary\">Sound alerts</span>\n <input\n type=\"checkbox\"\n checked={soundEnabled}\n onChange={(e) => setSoundEnabled(e.target.checked)}\n className=\"h-4 w-4 rounded border-border-subtle\"\n />\n </label>\n <label className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-primary\">\n Desktop notifications\n </span>\n <input\n type=\"checkbox\"\n checked={notificationsEnabled}\n onChange={(e) => setNotificationsEnabled(e.target.checked)}\n className=\"h-4 w-4 rounded border-border-subtle\"\n />\n </label>\n <label className=\"flex items-center justify-between\">\n <span className=\"text-sm text-text-primary\">\n Auto-start breaks\n </span>\n <input\n type=\"checkbox\"\n checked={autoStartBreaks}\n onChange={(e) => setAutoStartBreaks(e.target.checked)}\n className=\"h-4 w-4 rounded border-border-subtle\"\n />\n </label>\n </div>\n </div>\n\n <div className=\"flex justify-end\">\n <button\n onClick={handleSave}\n disabled={saving}\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 {saving ? \"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