@checkstack/incident-frontend 0.7.1 → 0.8.0

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,116 @@
1
1
  # @checkstack/incident-frontend
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1ef2e79: feat: hotlinks on incidents/maintenances and additional links on systems
8
+
9
+ Users with `manage` access on an incident, maintenance, or system can now
10
+ attach free-form URL "hotlinks" — Jira tickets, runbooks, dashboards, ticket
11
+ tools, etc. — alongside the existing fields.
12
+
13
+ - **Incidents** & **maintenances**: links live on the entity itself and are
14
+ surfaced both in the editor dialog and on the public detail page. Two new
15
+ RPC procedures per plugin (`addLink`, `removeLink`) gated behind the
16
+ existing `manage` access rule. Links are returned as part of
17
+ `getIncident` / `getMaintenance` and cache-invalidated on every link
18
+ mutation.
19
+ - **Systems**: a parallel `system_links` table with `getSystemLinks`,
20
+ `addSystemLink`, `removeSystemLink` procedures. Surfaced inside the
21
+ system editor (next to contacts) and on the read-only system detail
22
+ sidebar. Cache-scoped per-system so list endpoints remain hot.
23
+ - **Shared UI**: a `LinksEditor` component in `@checkstack/ui` does the
24
+ presentation; the three plugins each own their own RPC wiring.
25
+
26
+ Database changes ship as additive migrations (new `incident_links`,
27
+ `maintenance_links`, `system_links` tables, all FK-cascaded on parent
28
+ delete). No existing columns or rows are touched.
29
+
30
+ The system incident and maintenance history pages now sort by relevance:
31
+ active entries (non-`resolved` incidents, `scheduled` or `in_progress`
32
+ maintenances) appear at the top, with creation date descending as the
33
+ tiebreaker.
34
+
35
+ - 3547670: Wire the new tips infrastructure across the frontends:
36
+
37
+ **Empty-state coaching.** Replace generic "no items" copy with onboarding
38
+ guidance — short description, three numbered steps and a primary CTA — on
39
+ every EmptyState that has a meaningful next action. Affects: catalog
40
+ (systems + groups), dashboard, health-check page, integrations (subscriptions
41
+
42
+ - provider connections), GitOps providers + secrets, GitOps provenance,
43
+ SLO config + overview, maintenance config, satellites, plugin manager,
44
+ incident config, announcements. Read-only EmptyStates (incident history,
45
+ maintenance history, plugin events) get clearer descriptions explaining
46
+ what would populate them.
47
+
48
+ **First-run anchored tips.** Add `<Tip>` popovers to the most important
49
+ "Create" affordances so first-time users see a one-line explanation of
50
+ what they're about to make and why it matters: catalog “Add System” /
51
+ “Add Group”, healthcheck “Create Check”, integrations “New Subscription”,
52
+ GitOps “Add Provider”, SLO “Create SLO”, maintenance “Create Maintenance”,
53
+ satellite “Create Satellite”, plugin-manager “Install plugin”, incident
54
+ “Report Incident”, announcement “New Announcement”. Each tip is dismissed
55
+ per user (server-backed when signed in, localStorage otherwise) and
56
+ namespaced through `qualifyTipId(plugin, …)` so it cannot escape the
57
+ plugin's own namespace.
58
+
59
+ **Welcome banner on the dashboard.** A `<TipBanner>` at the top of the
60
+ dashboard introduces Checkstack's main flow ("add a system, then a health
61
+ check") with a one-click jump into the catalog.
62
+
63
+ ### Patch Changes
64
+
65
+ - 950d6ec: Fix mobile UserMenu items rendering at zero height, group menu items by
66
+ section, and unstack cramped card headers on small viewports.
67
+
68
+ - **UserMenu mobile bug**: On mobile, the user-menu Sheet rendered every
69
+ menu item as a grid row, which combined with `flex-shrink: 1` on each
70
+ item collapsed the buttons whose internal layout uses `display: flex`
71
+ (the items registered with `useNavigate` rather than `<Link>`) to zero
72
+ content height. Switched the mobile container to a flex column with
73
+ `[&>*]:shrink-0` and added `min-h-0` so the sheet scrolls correctly
74
+ when the list overflows.
75
+
76
+ - **UserMenu grouping**: Slot extensions now accept an optional `group`
77
+ field. The user menu buckets `UserMenuItemsSlot` extensions by `group`
78
+ and renders each group under a labeled header (`Workspace`,
79
+ `Reliability`, `Configuration`, `Documentation`, `Account`). Existing
80
+ core plugins are tagged with the appropriate group; third-party plugins
81
+ can pick any of these or supply their own label. Untagged extensions
82
+ render last with no header. `UserMenuItemsBottomSlot` is unaffected.
83
+
84
+ - **Card header responsiveness**: `CardHeaderRow` (the primitive shared by
85
+ Incident, Maintenance, Auth, Catalog, GitOps and other config cards) now
86
+ stacks vertically on narrow viewports and only switches to a single row
87
+ at the `sm` breakpoint, so titles and adjacent filter controls (e.g.
88
+ status `Select`, "Show resolved" checkbox) no longer cram together on
89
+ mobile. Refactored the Incident and Maintenance config pages to use the
90
+ primitive instead of a hand-rolled `flex items-center justify-between`
91
+ row, and made their `Select` triggers full-width on mobile.
92
+
93
+ - Updated dependencies [42abfff]
94
+ - Updated dependencies [3547670]
95
+ - Updated dependencies [1ef2e79]
96
+ - Updated dependencies [aa89bc5]
97
+ - Updated dependencies [3547670]
98
+ - Updated dependencies [3547670]
99
+ - Updated dependencies [950d6ec]
100
+ - Updated dependencies [3547670]
101
+ - Updated dependencies [3547670]
102
+ - @checkstack/common@0.9.0
103
+ - @checkstack/ui@1.8.0
104
+ - @checkstack/incident-common@1.1.0
105
+ - @checkstack/catalog-common@2.1.0
106
+ - @checkstack/frontend-api@0.5.0
107
+ - @checkstack/notification-frontend@0.4.0
108
+ - @checkstack/tips-frontend@0.2.0
109
+ - @checkstack/auth-frontend@0.6.0
110
+ - @checkstack/dashboard-frontend@0.7.0
111
+ - @checkstack/notification-common@1.0.2
112
+ - @checkstack/signal-frontend@0.1.2
113
+
3
114
  ## 0.7.1
4
115
 
5
116
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/incident-frontend",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
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/incident-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.5.33",
17
+ "@checkstack/catalog-common": "2.0.1",
18
+ "@checkstack/common": "0.8.0",
19
+ "@checkstack/dashboard-frontend": "0.6.1",
20
+ "@checkstack/frontend-api": "0.4.2",
21
+ "@checkstack/incident-common": "1.0.1",
22
+ "@checkstack/notification-common": "1.0.1",
23
+ "@checkstack/notification-frontend": "0.3.1",
24
+ "@checkstack/signal-frontend": "0.1.1",
25
+ "@checkstack/tips-frontend": "0.1.0",
26
+ "@checkstack/ui": "1.7.1",
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.0"
36
37
  }
37
38
  }
@@ -26,6 +26,7 @@ import {
26
26
  SelectContent,
27
27
  SelectItem,
28
28
  StatusUpdateTimeline,
29
+ LinksEditor,
29
30
  } from "@checkstack/ui";
30
31
  import { Plus, MessageSquare, Loader2, AlertCircle } from "lucide-react";
31
32
  import { IncidentUpdateForm } from "./IncidentUpdateForm";
@@ -86,6 +87,24 @@ export const IncidentEditor: React.FC<Props> = ({
86
87
  },
87
88
  });
88
89
 
90
+ const addLinkMutation = incidentClient.addLink.useMutation({
91
+ onSuccess: () => {
92
+ void refetchDetail();
93
+ },
94
+ onError: (error) => {
95
+ toast.error(extractErrorMessage(error, "Failed to add link"));
96
+ },
97
+ });
98
+
99
+ const removeLinkMutation = incidentClient.removeLink.useMutation({
100
+ onSuccess: () => {
101
+ void refetchDetail();
102
+ },
103
+ onError: (error) => {
104
+ toast.error(extractErrorMessage(error, "Failed to remove link"));
105
+ },
106
+ });
107
+
89
108
  // Query for incident details (only when editing)
90
109
  const { data: incidentDetail, refetch: refetchDetail } =
91
110
  incidentClient.getIncident.useQuery(
@@ -341,6 +360,30 @@ export const IncidentEditor: React.FC<Props> = ({
341
360
  </div>
342
361
  )}
343
362
 
363
+ {/* Hotlinks (Jira tickets, runbooks, ...) — editing only */}
364
+ {incident && (
365
+ <div className="border-t pt-4">
366
+ <LinksEditor
367
+ title="Hotlinks"
368
+ description="Attach Jira tickets, runbooks, dashboards, or any URL relevant to this incident."
369
+ links={incidentDetail?.links ?? []}
370
+ busy={
371
+ addLinkMutation.isPending || removeLinkMutation.isPending
372
+ }
373
+ onAdd={async ({ label, url }) => {
374
+ await addLinkMutation.mutateAsync({
375
+ incidentId: incident.id,
376
+ label,
377
+ url,
378
+ });
379
+ }}
380
+ onRemove={async (link) => {
381
+ await removeLinkMutation.mutateAsync({ id: link.id });
382
+ }}
383
+ />
384
+ </div>
385
+ )}
386
+
344
387
  {/* Team Access Editor - only shown when editing existing incident */}
345
388
  {incident?.id && (
346
389
  <TeamAccessEditor
package/src/index.tsx CHANGED
@@ -45,6 +45,7 @@ export default createFrontendPlugin({
45
45
  createSlotExtension(UserMenuItemsSlot, {
46
46
  id: "incident.user-menu.items",
47
47
  component: IncidentMenuItems,
48
+ metadata: { group: "Reliability" },
48
49
  }),
49
50
  createSlotExtension(SystemStateBadgesSlot, {
50
51
  id: "incident.system-incident-badge",
@@ -11,11 +11,16 @@ import type {
11
11
  IncidentWithSystems,
12
12
  IncidentStatus,
13
13
  } from "@checkstack/incident-common";
14
- import { incidentAccess } from "@checkstack/incident-common";
14
+ import {
15
+ incidentAccess,
16
+ pluginMetadata as incidentPluginMetadata,
17
+ } from "@checkstack/incident-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,
@@ -210,21 +215,30 @@ const IncidentConfigPageContent: React.FC = () => {
210
215
  loading={accessLoading}
211
216
  allowed={canManage}
212
217
  actions={
213
- <Button onClick={handleCreate}>
214
- <Plus className="h-4 w-4 mr-2" />
215
- Report Incident
216
- </Button>
218
+ <Tip
219
+ plugin={incidentPluginMetadata}
220
+ id="report"
221
+ title="Incidents are deliberate, not automatic"
222
+ description="Incidents in Checkstack are events you open by hand for real, user-visible problems — they're not auto-created from failing health checks. Use “Report Incident” to record an outage you've detected (your own monitoring, a customer ticket, a security event) so it shows up on the dashboard and the public status page, and so subscribers get notified."
223
+ side="bottom"
224
+ align="end"
225
+ >
226
+ <Button onClick={handleCreate}>
227
+ <Plus className="h-4 w-4 mr-2" />
228
+ Report Incident
229
+ </Button>
230
+ </Tip>
217
231
  }
218
232
  >
219
233
  <Card>
220
234
  <CardHeader className="border-b border-border">
221
- <div className="flex items-center justify-between">
235
+ <CardHeaderRow>
222
236
  <div className="flex items-center gap-2">
223
237
  <AlertTriangle className="h-5 w-5 text-muted-foreground" />
224
238
  <CardTitle>Incidents</CardTitle>
225
239
  </div>
226
- <div className="flex items-center gap-4">
227
- <label className="flex items-center gap-2 text-sm">
240
+ <div className="flex flex-wrap items-center gap-3 sm:gap-4">
241
+ <label className="flex items-center gap-2 text-sm whitespace-nowrap">
228
242
  <input
229
243
  type="checkbox"
230
244
  checked={showResolved}
@@ -239,7 +253,7 @@ const IncidentConfigPageContent: React.FC = () => {
239
253
  setStatusFilter(v as IncidentStatus | "all")
240
254
  }
241
255
  >
242
- <SelectTrigger className="w-40">
256
+ <SelectTrigger className="w-full sm:w-40">
243
257
  <SelectValue placeholder="Filter by status" />
244
258
  </SelectTrigger>
245
259
  <SelectContent>
@@ -252,7 +266,7 @@ const IncidentConfigPageContent: React.FC = () => {
252
266
  </SelectContent>
253
267
  </Select>
254
268
  </div>
255
- </div>
269
+ </CardHeaderRow>
256
270
  </CardHeader>
257
271
  <CardContent className="p-0">
258
272
  {loading ? (
@@ -261,8 +275,22 @@ const IncidentConfigPageContent: React.FC = () => {
261
275
  </div>
262
276
  ) : incidents.length === 0 ? (
263
277
  <EmptyState
278
+ icon={<AlertTriangle className="size-10" />}
264
279
  title="No incidents found"
265
- description="No incidents match your current filters."
280
+ description="Incidents capture real, user-visible problems with the systems you monitor. They're created intentionally — Checkstack does not auto-open them from failed health checks, because not every failed check is a real outage. Open one by hand whenever something's actually broken so it shows up on the dashboard, on the status page, and reaches subscribers."
281
+ steps={[
282
+ "Adjust the filters above if you're looking for resolved or older incidents.",
283
+ "Click “Report Incident” to record an outage you've detected.",
284
+ "Linked systems and severity drive who gets notified — set them deliberately.",
285
+ ]}
286
+ actions={
287
+ canManage ? (
288
+ <Button onClick={handleCreate}>
289
+ <Plus className="h-4 w-4 mr-2" />
290
+ Report incident manually
291
+ </Button>
292
+ ) : undefined
293
+ }
266
294
  />
267
295
  ) : (
268
296
  <Table>
@@ -32,6 +32,7 @@ import {
32
32
  CheckCircle2,
33
33
  Server,
34
34
  Plus,
35
+ ExternalLink,
35
36
  } from "lucide-react";
36
37
  import { format, formatDistanceToNow } from "date-fns";
37
38
  import { IncidentUpdateForm } from "../components/IncidentUpdateForm";
@@ -220,6 +221,28 @@ const IncidentDetailPageContent: React.FC = () => {
220
221
  ))}
221
222
  </div>
222
223
  </div>
224
+
225
+ {incident.links.length > 0 && (
226
+ <div>
227
+ <h4 className="text-sm font-medium text-muted-foreground mb-2">
228
+ Hotlinks
229
+ </h4>
230
+ <div className="flex flex-wrap gap-2">
231
+ {incident.links.map((link) => (
232
+ <a
233
+ key={link.id}
234
+ href={link.url}
235
+ target="_blank"
236
+ rel="noopener noreferrer"
237
+ className="inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs text-primary hover:bg-muted"
238
+ >
239
+ <ExternalLink className="h-3 w-3" />
240
+ <span>{link.label ?? link.url}</span>
241
+ </a>
242
+ ))}
243
+ </div>
244
+ </div>
245
+ )}
223
246
  </CardContent>
224
247
  </Card>
225
248
 
@@ -36,7 +36,13 @@ const SystemIncidentHistoryPageContent: React.FC = () => {
36
36
  const { data: systemsData, isLoading: systemsLoading } =
37
37
  catalogClient.getSystems.useQuery({});
38
38
 
39
- const incidents = incidentsData?.incidents ?? [];
39
+ // Sort: active incidents (non-resolved) first, then by creation date desc.
40
+ const incidents = (incidentsData?.incidents ?? []).toSorted((a, b) => {
41
+ const aActive = a.status === "resolved" ? 1 : 0;
42
+ const bActive = b.status === "resolved" ? 1 : 0;
43
+ if (aActive !== bActive) return aActive - bActive;
44
+ return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
45
+ });
40
46
  const systems = systemsData?.systems ?? [];
41
47
  const system = systems.find((s) => s.id === systemId);
42
48
  const loading = incidentsLoading || systemsLoading;
@@ -104,8 +110,8 @@ const SystemIncidentHistoryPageContent: React.FC = () => {
104
110
  <CardContent className="p-0">
105
111
  {incidents.length === 0 ? (
106
112
  <EmptyState
107
- title="No incidents"
108
- description="This system has no recorded incidents."
113
+ title="Clean record"
114
+ description="No incidents have been reported for this system. Incidents in Checkstack are created by hand when a real outage or user-visible issue happens — they aren't auto-generated from failing health checks. Anything reported against this system in the future will show up here."
109
115
  />
110
116
  ) : (
111
117
  <div className="divide-y divide-border">
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
  }