@checkstack/notification-frontend 0.2.22 → 0.2.24
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,50 @@
|
|
|
1
1
|
# @checkstack/notification-frontend
|
|
2
2
|
|
|
3
|
+
## 0.2.24
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [26d8bae]
|
|
8
|
+
- @checkstack/ui@1.3.0
|
|
9
|
+
- @checkstack/auth-frontend@0.5.19
|
|
10
|
+
|
|
11
|
+
## 0.2.23
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- d1a2796: Enforce stricter code quality standards and eliminate AI slop anti-patterns.
|
|
16
|
+
|
|
17
|
+
**New utility**
|
|
18
|
+
|
|
19
|
+
- `extractErrorMessage(error, fallback?)` in `@checkstack/common` for consistent error extraction
|
|
20
|
+
|
|
21
|
+
**ESLint rules**
|
|
22
|
+
|
|
23
|
+
- `react-hooks/rules-of-hooks` and `exhaustive-deps` for hook correctness
|
|
24
|
+
- `no-console` in frontend packages — forces `toast` over silent `console.error`
|
|
25
|
+
- `no-restricted-syntax` banning `instanceof Error` — forces `extractErrorMessage`
|
|
26
|
+
- Custom `no-eslint-disable-any` rule preventing `@typescript-eslint/no-explicit-any` circumvention
|
|
27
|
+
|
|
28
|
+
**Refactoring**
|
|
29
|
+
|
|
30
|
+
- Replace 141 `instanceof Error` boilerplate patterns across the codebase
|
|
31
|
+
- Replace swallowed `console.error` with user-visible `toast.error()` feedback
|
|
32
|
+
- Remove 15 redundant `as` type casts in IntegrationsPage and ProviderConnectionsPage
|
|
33
|
+
- Consolidate 3 identical callback handlers into `handleDialogClose`
|
|
34
|
+
- Fix conditional React hook call in `FormField.tsx`
|
|
35
|
+
- Fix unstable useMemo deps in `Dashboard.tsx`
|
|
36
|
+
- Replace `useEffect`→`setState` with derived `useMemo` in `RegisterPage.tsx`
|
|
37
|
+
- Rewrite `keystore.test.ts` with typed `DrizzleMockChain` (eliminating 7 `any` suppressions)
|
|
38
|
+
- Delete obvious comments in `encryption.ts` and Teams `provider.ts`
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [d1a2796]
|
|
41
|
+
- @checkstack/common@0.6.5
|
|
42
|
+
- @checkstack/ui@1.2.1
|
|
43
|
+
- @checkstack/auth-frontend@0.5.18
|
|
44
|
+
- @checkstack/frontend-api@0.3.9
|
|
45
|
+
- @checkstack/notification-common@0.2.8
|
|
46
|
+
- @checkstack/signal-frontend@0.0.15
|
|
47
|
+
|
|
3
48
|
## 0.2.22
|
|
4
49
|
|
|
5
50
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/notification-frontend",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.tsx",
|
|
6
6
|
"checkstack": {
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"lint:code": "eslint . --max-warnings 0"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@checkstack/notification-common": "0.2.
|
|
16
|
-
"@checkstack/frontend-api": "0.3.
|
|
17
|
-
"@checkstack/auth-frontend": "0.5.
|
|
18
|
-
"@checkstack/signal-frontend": "0.0.
|
|
19
|
-
"@checkstack/common": "0.6.
|
|
20
|
-
"@checkstack/ui": "1.1
|
|
15
|
+
"@checkstack/notification-common": "0.2.8",
|
|
16
|
+
"@checkstack/frontend-api": "0.3.9",
|
|
17
|
+
"@checkstack/auth-frontend": "0.5.18",
|
|
18
|
+
"@checkstack/signal-frontend": "0.0.15",
|
|
19
|
+
"@checkstack/common": "0.6.5",
|
|
20
|
+
"@checkstack/ui": "1.2.1",
|
|
21
21
|
"react": "^18.2.0",
|
|
22
22
|
"react-router-dom": "^6.22.0",
|
|
23
23
|
"lucide-react": "^0.344.0"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"typescript": "^5.0.0",
|
|
27
27
|
"@types/react": "^18.2.0",
|
|
28
|
-
"@checkstack/tsconfig": "0.0.
|
|
28
|
+
"@checkstack/tsconfig": "0.0.5",
|
|
29
29
|
"@checkstack/scripts": "0.1.2"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
DropdownMenuSeparator,
|
|
11
11
|
Button,
|
|
12
12
|
stripMarkdown,
|
|
13
|
+
useToast,
|
|
13
14
|
} from "@checkstack/ui";
|
|
14
15
|
import { useApi, usePluginClient } from "@checkstack/frontend-api";
|
|
15
16
|
import { useSignal } from "@checkstack/signal-frontend";
|
|
@@ -28,6 +29,7 @@ export const NotificationBell = () => {
|
|
|
28
29
|
const authApi = useApi(authApiRef);
|
|
29
30
|
const { data: session, isPending: isAuthLoading } = authApi.useSession();
|
|
30
31
|
const notificationClient = usePluginClient(NotificationApi);
|
|
32
|
+
const toast = useToast();
|
|
31
33
|
|
|
32
34
|
const [isOpen, setIsOpen] = useState(false);
|
|
33
35
|
|
|
@@ -130,8 +132,8 @@ export const NotificationBell = () => {
|
|
|
130
132
|
await markAsReadMutation.mutateAsync({});
|
|
131
133
|
setSignalUnreadCount(0);
|
|
132
134
|
setSignalNotifications([]);
|
|
133
|
-
} catch
|
|
134
|
-
|
|
135
|
+
} catch {
|
|
136
|
+
toast.error("Failed to mark all as read");
|
|
135
137
|
}
|
|
136
138
|
};
|
|
137
139
|
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
UserChannelCard,
|
|
27
27
|
type UserDeliveryChannel,
|
|
28
28
|
} from "../components/UserChannelCard";
|
|
29
|
+
import { extractErrorMessage } from "@checkstack/common";
|
|
29
30
|
|
|
30
31
|
export const NotificationSettingsPage = () => {
|
|
31
32
|
const notificationClient = usePluginClient(NotificationApi);
|
|
@@ -97,7 +98,7 @@ export const NotificationSettingsPage = () => {
|
|
|
97
98
|
},
|
|
98
99
|
onError: (error) => {
|
|
99
100
|
toast.error(
|
|
100
|
-
error
|
|
101
|
+
extractErrorMessage(error, "Failed to save settings"),
|
|
101
102
|
);
|
|
102
103
|
},
|
|
103
104
|
});
|
|
@@ -109,7 +110,7 @@ export const NotificationSettingsPage = () => {
|
|
|
109
110
|
},
|
|
110
111
|
onError: (error) => {
|
|
111
112
|
toast.error(
|
|
112
|
-
error
|
|
113
|
+
extractErrorMessage(error, "Failed to unsubscribe"),
|
|
113
114
|
);
|
|
114
115
|
},
|
|
115
116
|
});
|
|
@@ -123,7 +124,7 @@ export const NotificationSettingsPage = () => {
|
|
|
123
124
|
},
|
|
124
125
|
onError: (error) => {
|
|
125
126
|
toast.error(
|
|
126
|
-
error
|
|
127
|
+
extractErrorMessage(error, "Failed to update channel"),
|
|
127
128
|
);
|
|
128
129
|
setStrategySaving(undefined);
|
|
129
130
|
},
|
|
@@ -138,9 +139,7 @@ export const NotificationSettingsPage = () => {
|
|
|
138
139
|
},
|
|
139
140
|
onError: (error) => {
|
|
140
141
|
toast.error(
|
|
141
|
-
error
|
|
142
|
-
? error.message
|
|
143
|
-
: "Failed to update preference",
|
|
142
|
+
extractErrorMessage(error, "Failed to update preference"),
|
|
144
143
|
);
|
|
145
144
|
setChannelSaving(undefined);
|
|
146
145
|
},
|
|
@@ -155,7 +154,7 @@ export const NotificationSettingsPage = () => {
|
|
|
155
154
|
},
|
|
156
155
|
onError: (error) => {
|
|
157
156
|
toast.error(
|
|
158
|
-
error
|
|
157
|
+
extractErrorMessage(error, "Failed to disconnect"),
|
|
159
158
|
);
|
|
160
159
|
setChannelSaving(undefined);
|
|
161
160
|
},
|
|
@@ -168,7 +167,7 @@ export const NotificationSettingsPage = () => {
|
|
|
168
167
|
},
|
|
169
168
|
onError: (error) => {
|
|
170
169
|
toast.error(
|
|
171
|
-
error
|
|
170
|
+
extractErrorMessage(error, "Failed to start OAuth flow"),
|
|
172
171
|
);
|
|
173
172
|
setChannelConnecting(undefined);
|
|
174
173
|
},
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import { usePluginClient } from "@checkstack/frontend-api";
|
|
17
17
|
import type { Notification } from "@checkstack/notification-common";
|
|
18
18
|
import { NotificationApi } from "@checkstack/notification-common";
|
|
19
|
+
import { extractErrorMessage } from "@checkstack/common";
|
|
19
20
|
|
|
20
21
|
export const NotificationsPage = () => {
|
|
21
22
|
const notificationClient = usePluginClient(NotificationApi);
|
|
@@ -48,7 +49,7 @@ export const NotificationsPage = () => {
|
|
|
48
49
|
},
|
|
49
50
|
onError: (error) => {
|
|
50
51
|
toast.error(
|
|
51
|
-
error
|
|
52
|
+
extractErrorMessage(error, "Failed to mark as read"),
|
|
52
53
|
);
|
|
53
54
|
},
|
|
54
55
|
});
|
|
@@ -61,9 +62,7 @@ export const NotificationsPage = () => {
|
|
|
61
62
|
},
|
|
62
63
|
onError: (error) => {
|
|
63
64
|
toast.error(
|
|
64
|
-
error
|
|
65
|
-
? error.message
|
|
66
|
-
: "Failed to delete notification",
|
|
65
|
+
extractErrorMessage(error, "Failed to delete notification"),
|
|
67
66
|
);
|
|
68
67
|
},
|
|
69
68
|
});
|
|
@@ -76,7 +75,7 @@ export const NotificationsPage = () => {
|
|
|
76
75
|
},
|
|
77
76
|
onError: (error) => {
|
|
78
77
|
toast.error(
|
|
79
|
-
error
|
|
78
|
+
extractErrorMessage(error, "Failed to mark all as read"),
|
|
80
79
|
);
|
|
81
80
|
},
|
|
82
81
|
});
|