@checkstack/maintenance-frontend 0.6.1 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,133 @@
1
1
  # @checkstack/maintenance-frontend
2
2
 
3
+ ## 0.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [9016526]
8
+ - @checkstack/common@0.10.0
9
+ - @checkstack/catalog-common@2.2.0
10
+ - @checkstack/maintenance-common@1.2.0
11
+ - @checkstack/notification-common@1.1.0
12
+ - @checkstack/auth-frontend@0.6.1
13
+ - @checkstack/dashboard-frontend@0.7.1
14
+ - @checkstack/frontend-api@0.5.1
15
+ - @checkstack/notification-frontend@0.4.1
16
+ - @checkstack/tips-frontend@0.2.1
17
+ - @checkstack/ui@1.8.1
18
+ - @checkstack/signal-frontend@0.1.3
19
+
20
+ ## 0.7.0
21
+
22
+ ### Minor Changes
23
+
24
+ - 1ef2e79: feat: hotlinks on incidents/maintenances and additional links on systems
25
+
26
+ Users with `manage` access on an incident, maintenance, or system can now
27
+ attach free-form URL "hotlinks" — Jira tickets, runbooks, dashboards, ticket
28
+ tools, etc. — alongside the existing fields.
29
+
30
+ - **Incidents** & **maintenances**: links live on the entity itself and are
31
+ surfaced both in the editor dialog and on the public detail page. Two new
32
+ RPC procedures per plugin (`addLink`, `removeLink`) gated behind the
33
+ existing `manage` access rule. Links are returned as part of
34
+ `getIncident` / `getMaintenance` and cache-invalidated on every link
35
+ mutation.
36
+ - **Systems**: a parallel `system_links` table with `getSystemLinks`,
37
+ `addSystemLink`, `removeSystemLink` procedures. Surfaced inside the
38
+ system editor (next to contacts) and on the read-only system detail
39
+ sidebar. Cache-scoped per-system so list endpoints remain hot.
40
+ - **Shared UI**: a `LinksEditor` component in `@checkstack/ui` does the
41
+ presentation; the three plugins each own their own RPC wiring.
42
+
43
+ Database changes ship as additive migrations (new `incident_links`,
44
+ `maintenance_links`, `system_links` tables, all FK-cascaded on parent
45
+ delete). No existing columns or rows are touched.
46
+
47
+ The system incident and maintenance history pages now sort by relevance:
48
+ active entries (non-`resolved` incidents, `scheduled` or `in_progress`
49
+ maintenances) appear at the top, with creation date descending as the
50
+ tiebreaker.
51
+
52
+ - 3547670: Wire the new tips infrastructure across the frontends:
53
+
54
+ **Empty-state coaching.** Replace generic "no items" copy with onboarding
55
+ guidance — short description, three numbered steps and a primary CTA — on
56
+ every EmptyState that has a meaningful next action. Affects: catalog
57
+ (systems + groups), dashboard, health-check page, integrations (subscriptions
58
+
59
+ - provider connections), GitOps providers + secrets, GitOps provenance,
60
+ SLO config + overview, maintenance config, satellites, plugin manager,
61
+ incident config, announcements. Read-only EmptyStates (incident history,
62
+ maintenance history, plugin events) get clearer descriptions explaining
63
+ what would populate them.
64
+
65
+ **First-run anchored tips.** Add `<Tip>` popovers to the most important
66
+ "Create" affordances so first-time users see a one-line explanation of
67
+ what they're about to make and why it matters: catalog “Add System” /
68
+ “Add Group”, healthcheck “Create Check”, integrations “New Subscription”,
69
+ GitOps “Add Provider”, SLO “Create SLO”, maintenance “Create Maintenance”,
70
+ satellite “Create Satellite”, plugin-manager “Install plugin”, incident
71
+ “Report Incident”, announcement “New Announcement”. Each tip is dismissed
72
+ per user (server-backed when signed in, localStorage otherwise) and
73
+ namespaced through `qualifyTipId(plugin, …)` so it cannot escape the
74
+ plugin's own namespace.
75
+
76
+ **Welcome banner on the dashboard.** A `<TipBanner>` at the top of the
77
+ dashboard introduces Checkstack's main flow ("add a system, then a health
78
+ check") with a one-click jump into the catalog.
79
+
80
+ ### Patch Changes
81
+
82
+ - 950d6ec: Fix mobile UserMenu items rendering at zero height, group menu items by
83
+ section, and unstack cramped card headers on small viewports.
84
+
85
+ - **UserMenu mobile bug**: On mobile, the user-menu Sheet rendered every
86
+ menu item as a grid row, which combined with `flex-shrink: 1` on each
87
+ item collapsed the buttons whose internal layout uses `display: flex`
88
+ (the items registered with `useNavigate` rather than `<Link>`) to zero
89
+ content height. Switched the mobile container to a flex column with
90
+ `[&>*]:shrink-0` and added `min-h-0` so the sheet scrolls correctly
91
+ when the list overflows.
92
+
93
+ - **UserMenu grouping**: Slot extensions now accept an optional `group`
94
+ field. The user menu buckets `UserMenuItemsSlot` extensions by `group`
95
+ and renders each group under a labeled header (`Workspace`,
96
+ `Reliability`, `Configuration`, `Documentation`, `Account`). Existing
97
+ core plugins are tagged with the appropriate group; third-party plugins
98
+ can pick any of these or supply their own label. Untagged extensions
99
+ render last with no header. `UserMenuItemsBottomSlot` is unaffected.
100
+
101
+ - **Card header responsiveness**: `CardHeaderRow` (the primitive shared by
102
+ Incident, Maintenance, Auth, Catalog, GitOps and other config cards) now
103
+ stacks vertically on narrow viewports and only switches to a single row
104
+ at the `sm` breakpoint, so titles and adjacent filter controls (e.g.
105
+ status `Select`, "Show resolved" checkbox) no longer cram together on
106
+ mobile. Refactored the Incident and Maintenance config pages to use the
107
+ primitive instead of a hand-rolled `flex items-center justify-between`
108
+ row, and made their `Select` triggers full-width on mobile.
109
+
110
+ - Updated dependencies [42abfff]
111
+ - Updated dependencies [3547670]
112
+ - Updated dependencies [1ef2e79]
113
+ - Updated dependencies [aa89bc5]
114
+ - Updated dependencies [3547670]
115
+ - Updated dependencies [3547670]
116
+ - Updated dependencies [950d6ec]
117
+ - Updated dependencies [3547670]
118
+ - Updated dependencies [3547670]
119
+ - @checkstack/common@0.9.0
120
+ - @checkstack/ui@1.8.0
121
+ - @checkstack/maintenance-common@1.1.0
122
+ - @checkstack/catalog-common@2.1.0
123
+ - @checkstack/frontend-api@0.5.0
124
+ - @checkstack/notification-frontend@0.4.0
125
+ - @checkstack/tips-frontend@0.2.0
126
+ - @checkstack/auth-frontend@0.6.0
127
+ - @checkstack/dashboard-frontend@0.7.0
128
+ - @checkstack/notification-common@1.0.2
129
+ - @checkstack/signal-frontend@0.1.2
130
+
3
131
  ## 0.6.1
4
132
 
5
133
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/maintenance-frontend",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "main": "src/index.tsx",
@@ -13,16 +13,17 @@
13
13
  "lint:code": "eslint . --max-warnings 0"
14
14
  },
15
15
  "dependencies": {
16
- "@checkstack/auth-frontend": "0.5.32",
17
- "@checkstack/catalog-common": "2.0.0",
18
- "@checkstack/common": "0.7.0",
19
- "@checkstack/dashboard-frontend": "0.6.0",
20
- "@checkstack/frontend-api": "0.4.1",
21
- "@checkstack/maintenance-common": "1.0.0",
22
- "@checkstack/notification-common": "1.0.0",
23
- "@checkstack/notification-frontend": "0.3.0",
24
- "@checkstack/signal-frontend": "0.1.0",
25
- "@checkstack/ui": "1.7.0",
16
+ "@checkstack/auth-frontend": "0.6.0",
17
+ "@checkstack/catalog-common": "2.1.0",
18
+ "@checkstack/common": "0.9.0",
19
+ "@checkstack/dashboard-frontend": "0.7.0",
20
+ "@checkstack/frontend-api": "0.5.0",
21
+ "@checkstack/maintenance-common": "1.1.0",
22
+ "@checkstack/notification-common": "1.0.2",
23
+ "@checkstack/notification-frontend": "0.4.0",
24
+ "@checkstack/signal-frontend": "0.1.2",
25
+ "@checkstack/tips-frontend": "0.2.0",
26
+ "@checkstack/ui": "1.8.0",
26
27
  "date-fns": "^4.1.0",
27
28
  "lucide-react": "^0.344.0",
28
29
  "react": "^18.2.0",
@@ -31,7 +32,7 @@
31
32
  "devDependencies": {
32
33
  "typescript": "^5.0.0",
33
34
  "@types/react": "^18.2.0",
34
- "@checkstack/tsconfig": "0.0.6",
35
- "@checkstack/scripts": "0.1.2"
35
+ "@checkstack/tsconfig": "0.0.7",
36
+ "@checkstack/scripts": "0.3.1"
36
37
  }
37
38
  }
@@ -21,6 +21,7 @@ import {
21
21
  useToast,
22
22
  DateTimePicker,
23
23
  StatusUpdateTimeline,
24
+ LinksEditor,
24
25
  } from "@checkstack/ui";
25
26
  import { Plus, MessageSquare, Loader2, AlertCircle } from "lucide-react";
26
27
  import { MaintenanceUpdateForm } from "./MaintenanceUpdateForm";
@@ -88,6 +89,24 @@ export const MaintenanceEditor: React.FC<Props> = ({
88
89
  },
89
90
  });
90
91
 
92
+ const addLinkMutation = maintenanceClient.addLink.useMutation({
93
+ onSuccess: () => {
94
+ void refetchDetail();
95
+ },
96
+ onError: (error) => {
97
+ toast.error(extractErrorMessage(error, "Failed to add link"));
98
+ },
99
+ });
100
+
101
+ const removeLinkMutation = maintenanceClient.removeLink.useMutation({
102
+ onSuccess: () => {
103
+ void refetchDetail();
104
+ },
105
+ onError: (error) => {
106
+ toast.error(extractErrorMessage(error, "Failed to remove link"));
107
+ },
108
+ });
109
+
91
110
  // Sync updates from query
92
111
  useEffect(() => {
93
112
  if (maintenanceDetail) {
@@ -351,6 +370,30 @@ export const MaintenanceEditor: React.FC<Props> = ({
351
370
  </div>
352
371
  )}
353
372
 
373
+ {/* Hotlinks (change tickets, runbooks, ...) — editing only */}
374
+ {maintenance && (
375
+ <div className="border-t pt-4">
376
+ <LinksEditor
377
+ title="Hotlinks"
378
+ description="Attach change tickets, runbooks, dashboards, or any URL relevant to this maintenance."
379
+ links={maintenanceDetail?.links ?? []}
380
+ busy={
381
+ addLinkMutation.isPending || removeLinkMutation.isPending
382
+ }
383
+ onAdd={async ({ label, url }) => {
384
+ await addLinkMutation.mutateAsync({
385
+ maintenanceId: maintenance.id,
386
+ label,
387
+ url,
388
+ });
389
+ }}
390
+ onRemove={async (link) => {
391
+ await removeLinkMutation.mutateAsync({ id: link.id });
392
+ }}
393
+ />
394
+ </div>
395
+ )}
396
+
354
397
  {/* Team Access Editor - only shown when editing existing maintenance */}
355
398
  {maintenance?.id && (
356
399
  <TeamAccessEditor
package/src/index.tsx CHANGED
@@ -45,6 +45,7 @@ export default createFrontendPlugin({
45
45
  createSlotExtension(UserMenuItemsSlot, {
46
46
  id: "maintenance.user-menu.items",
47
47
  component: MaintenanceMenuItems,
48
+ metadata: { group: "Reliability" },
48
49
  }),
49
50
  createSlotExtension(SystemStateBadgesSlot, {
50
51
  id: "maintenance.system-maintenance-badge",
@@ -11,11 +11,16 @@ import type {
11
11
  MaintenanceWithSystems,
12
12
  MaintenanceStatus,
13
13
  } from "@checkstack/maintenance-common";
14
- import { maintenanceAccess } from "@checkstack/maintenance-common";
14
+ import {
15
+ maintenanceAccess,
16
+ pluginMetadata as maintenancePluginMetadata,
17
+ } from "@checkstack/maintenance-common";
18
+ import { Tip } from "@checkstack/tips-frontend";
15
19
  import { CatalogApi } from "@checkstack/catalog-common";
16
20
  import {
17
21
  Card,
18
22
  CardHeader,
23
+ CardHeaderRow,
19
24
  CardTitle,
20
25
  CardContent,
21
26
  Button,
@@ -176,15 +181,24 @@ const MaintenanceConfigPageContent: React.FC = () => {
176
181
  loading={accessLoading}
177
182
  allowed={canManage}
178
183
  actions={
179
- <Button onClick={handleCreate}>
180
- <Plus className="h-4 w-4 mr-2" />
181
- Create Maintenance
182
- </Button>
184
+ <Tip
185
+ plugin={maintenancePluginMetadata}
186
+ id="windows.create"
187
+ title="Tell Checkstack about expected downtime"
188
+ description="Maintenance windows mark a period where you expect a system to be partially or fully unavailable. Checkstack uses them to suppress incidents, mark systems as “under maintenance” on the public status page, and (optionally) exclude the window from SLO error budgets."
189
+ side="bottom"
190
+ align="end"
191
+ >
192
+ <Button onClick={handleCreate}>
193
+ <Plus className="h-4 w-4 mr-2" />
194
+ Create Maintenance
195
+ </Button>
196
+ </Tip>
183
197
  }
184
198
  >
185
199
  <Card>
186
200
  <CardHeader className="border-b border-border">
187
- <div className="flex items-center justify-between">
201
+ <CardHeaderRow>
188
202
  <div className="flex items-center gap-2">
189
203
  <Wrench className="h-5 w-5 text-muted-foreground" />
190
204
  <CardTitle>Maintenances</CardTitle>
@@ -195,7 +209,7 @@ const MaintenanceConfigPageContent: React.FC = () => {
195
209
  setStatusFilter(v as MaintenanceStatus | "all")
196
210
  }
197
211
  >
198
- <SelectTrigger className="w-40">
212
+ <SelectTrigger className="w-full sm:w-40">
199
213
  <SelectValue placeholder="Filter by status" />
200
214
  </SelectTrigger>
201
215
  <SelectContent>
@@ -206,7 +220,7 @@ const MaintenanceConfigPageContent: React.FC = () => {
206
220
  <SelectItem value="cancelled">Cancelled</SelectItem>
207
221
  </SelectContent>
208
222
  </Select>
209
- </div>
223
+ </CardHeaderRow>
210
224
  </CardHeader>
211
225
  <CardContent className="p-0">
212
226
  {loading ? (
@@ -215,8 +229,22 @@ const MaintenanceConfigPageContent: React.FC = () => {
215
229
  </div>
216
230
  ) : maintenances.length === 0 ? (
217
231
  <EmptyState
218
- title="No maintenances found"
219
- description="Create your first planned maintenance to get started."
232
+ icon={<Wrench className="size-10" />}
233
+ title="No planned maintenances"
234
+ description="A maintenance window tells Checkstack “this system is expected to be down or degraded” for a defined period. Failed health checks during the window are still recorded but are treated as expected — the system is flagged as “in maintenance” on the public status page, and notifications about it are suppressed."
235
+ steps={[
236
+ "Click “Create Maintenance” and pick the systems that will be affected.",
237
+ "Set a start time, end time, and a short summary your users will see.",
238
+ "Subscribers (groups, status page subscribers, integrations) are notified automatically when the window starts and ends.",
239
+ ]}
240
+ actions={
241
+ canManage ? (
242
+ <Button onClick={handleCreate}>
243
+ <Plus className="h-4 w-4 mr-2" />
244
+ Schedule maintenance
245
+ </Button>
246
+ ) : undefined
247
+ }
220
248
  />
221
249
  ) : (
222
250
  <Table>
@@ -41,6 +41,7 @@ import {
41
41
  Plus,
42
42
  MessageSquare,
43
43
  CheckCircle2,
44
+ ExternalLink,
44
45
  } from "lucide-react";
45
46
  import { format } from "date-fns";
46
47
  import { MaintenanceUpdateForm } from "../components/MaintenanceUpdateForm";
@@ -240,6 +241,28 @@ const MaintenanceDetailPageContent: React.FC = () => {
240
241
  ))}
241
242
  </div>
242
243
  </div>
244
+
245
+ {maintenance.links.length > 0 && (
246
+ <div>
247
+ <h4 className="text-sm font-medium text-muted-foreground mb-2">
248
+ Hotlinks
249
+ </h4>
250
+ <div className="flex flex-wrap gap-2">
251
+ {maintenance.links.map((link) => (
252
+ <a
253
+ key={link.id}
254
+ href={link.url}
255
+ target="_blank"
256
+ rel="noopener noreferrer"
257
+ className="inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs text-primary hover:bg-muted"
258
+ >
259
+ <ExternalLink className="h-3 w-3" />
260
+ <span>{link.label ?? link.url}</span>
261
+ </a>
262
+ ))}
263
+ </div>
264
+ </div>
265
+ )}
243
266
  </CardContent>
244
267
  </Card>
245
268
 
@@ -43,7 +43,18 @@ const SystemMaintenanceHistoryPageContent: React.FC = () => {
43
43
  const { data: systemsData, isLoading: systemsLoading } =
44
44
  catalogClient.getSystems.useQuery({});
45
45
 
46
- const maintenances = maintenancesData?.maintenances ?? [];
46
+ // Sort: active maintenances (scheduled / in_progress) first, then by
47
+ // creation date desc.
48
+ const maintenances = (maintenancesData?.maintenances ?? []).toSorted(
49
+ (a, b) => {
50
+ const aActive =
51
+ a.status === "scheduled" || a.status === "in_progress" ? 0 : 1;
52
+ const bActive =
53
+ b.status === "scheduled" || b.status === "in_progress" ? 0 : 1;
54
+ if (aActive !== bActive) return aActive - bActive;
55
+ return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
56
+ },
57
+ );
47
58
  const systems = systemsData?.systems ?? [];
48
59
  const system = systems.find((s) => s.id === systemId);
49
60
  const systemName = system?.name ?? "Unknown System";
@@ -111,8 +122,8 @@ const SystemMaintenanceHistoryPageContent: React.FC = () => {
111
122
  </div>
112
123
  ) : maintenances.length === 0 ? (
113
124
  <EmptyState
114
- title="No maintenances found"
115
- description="There are no recorded maintenances for this system."
125
+ title="No maintenance history"
126
+ description="This system has never had a planned maintenance window. When one is scheduled (or completes), it will appear here so you can see how often this system is taken offline and for how long."
116
127
  />
117
128
  ) : (
118
129
  <Table>
package/tsconfig.json CHANGED
@@ -31,6 +31,9 @@
31
31
  {
32
32
  "path": "../signal-frontend"
33
33
  },
34
+ {
35
+ "path": "../tips-frontend"
36
+ },
34
37
  {
35
38
  "path": "../ui"
36
39
  }