Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
There was a problem hiding this comment.
Pull request overview
Refactors the legacy “alerts” dialog into SolidJS popups, introducing a Solid-based inbox (TanStack solid-db) + PSA + notification history UI, and adds a dev-only API for inserting debug inbox items.
Changes:
- Replace legacy
#alertsPopupDOM/SCSS + imperative JS with SolidJSAlertsPopup+ section components. - Add inbox collection/query + debounced flush strategy (TanStack solid-db/query-db-collection) and wire unread count + reward claiming.
- Add
/dev/addDebugInboxItemcontract + backend route/controller + frontend dev UI hook.
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Locks new TanStack DB-related deps and updated vitest peer graph. |
| packages/contracts/src/dev.ts | Adds addDebugInboxItem endpoint to dev contract. |
| frontend/src/ts/stores/psas.ts | New Solid store for PSA items. |
| frontend/src/ts/stores/notifications.ts | Adds useInnerHtml to notification history entries. |
| frontend/src/ts/stores/modals.ts | Adds modal IDs for Alerts + DevInboxPicker. |
| frontend/src/ts/elements/psa.tsx | Routes PSA additions into the new PSA store. |
| frontend/src/ts/elements/alerts.ts | Removes legacy alerts popup implementation. |
| frontend/src/ts/components/popups/alerts/Psas.tsx | New Solid UI for PSA list. |
| frontend/src/ts/components/popups/alerts/NotificationHistory.tsx | New Solid UI for notification history + copy-details action. |
| frontend/src/ts/components/popups/alerts/Inbox.tsx | New Solid UI for inbox + claiming/deleting via paced mutations. |
| frontend/src/ts/components/popups/alerts/AlertsSection.tsx | Shared section wrapper for alerts popup sections. |
| frontend/src/ts/components/popups/alerts/AlertsPopup.tsx | New Solid alerts popup modal composition + flush-on-close. |
| frontend/src/ts/components/popups/Popups.tsx | Adds Solid “Popups” mount (currently only Alerts). |
| frontend/src/ts/components/mount.tsx | Registers popups mount target. |
| frontend/src/ts/components/modals/DevOptionsModal.tsx | Adds dev UI flow to insert debug inbox items. |
| frontend/src/ts/components/layout/header/Nav.tsx | Opens new Alerts modal instead of legacy showAlerts(). |
| frontend/src/ts/components/common/Headers.tsx | Adjusts H2/H3 Tailwind sizing/gap/padding. |
| frontend/src/ts/components/common/AsyncContent.tsx | Adds collection/collections support (for solid-db live queries). |
| frontend/src/ts/components/common/AnimatedModal.tsx | Extends custom animation params with marginRight support. |
| frontend/src/ts/collections/utils/flushDebounceStrategy.ts | Adds reusable debounced flush strategy wrapper. |
| frontend/src/ts/collections/inbox.ts | Adds inbox collection + live query + server flush handler. |
| frontend/src/styles/popups.scss | Removes legacy #alertsPopup styling. |
| frontend/src/styles/media-queries-purple.scss | Removes legacy #alertsPopup max-width rule. |
| frontend/src/index.html | Adds Solid popups mount point. |
| frontend/src/html/popups.html | Removes legacy alerts dialog markup. |
| frontend/package.json | Adds TanStack DB-related dependencies. |
| frontend/tests/components/common/AsyncContent.spec.tsx | Refactors props passing style in tests (no new collection coverage). |
| backend/src/api/routes/dev.ts | Registers new dev route handler. |
| backend/src/api/controllers/dev.ts | Implements addDebugInboxItem controller. |
| CLAUDE.md | Updates plan-mode guidance text. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| function fromCollections<T extends Record<string, unknown>>(collections: { | ||
| [K in keyof T]: Collection<T[K]>; | ||
| }): AsyncMap<T> { | ||
| return typedKeys(collections).reduce((acc, key) => { | ||
| const q = collections[key]; |
There was a problem hiding this comment.
AsyncContent now supports collection/collections, but the AsyncContent test suite only covers query/queries. Add tests for collection loading/error/success to prevent regressions.
frontend/src/ts/components/popups/alerts/NotificationHistory.tsx
Outdated
Show resolved
Hide resolved
frontend/src/ts/components/popups/alerts/NotificationHistory.tsx
Outdated
Show resolved
Hide resolved
| acc[key] = { | ||
| value: () => q(), | ||
| isLoading: () => q.isLoading, | ||
| isError: () => q.isError, |
There was a problem hiding this comment.
Collection errors won’t surface: fromCollections sets isError but never sets error, so firstError() stays undefined and no error UI/notification is shown. Expose the underlying error (or at least a sentinel) via AsyncEntry.error.
| isError: () => q.isError, | |
| isError: () => q.isError, | |
| error: () => (q.isError ? new Error("Collection error") : undefined), |
| const allRewards: AllRewards[] = changes.transaction.mutations.flatMap( | ||
| (it) => (it.original as InboxItem).rewards, | ||
| ); | ||
| claimRewards(allRewards); | ||
| }, |
There was a problem hiding this comment.
Rewards are claimed client-side for every mutation batch. This is only safe if flushPendingChanges throws on any server failure; otherwise XP/badges can be granted locally even though the inbox update failed.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.