Skip to content

refactor: solid alerts (@miodec, @fehmer)#7567

Open
fehmer wants to merge 33 commits intomasterfrom
feature/solid-inbox
Open

refactor: solid alerts (@miodec, @fehmer)#7567
fehmer wants to merge 33 commits intomasterfrom
feature/solid-inbox

Conversation

@fehmer
Copy link
Member

@fehmer fehmer commented Mar 3, 2026

No description provided.

@monkeytypegeorge monkeytypegeorge added backend Server stuff frontend User interface or web stuff labels Mar 3, 2026
@fehmer fehmer changed the title chore: convert alerts to solidjs component (@fehmer) refactor: solid alerts (@fehmer, @miodec) Mar 5, 2026
@socket-security
Copy link

socket-security bot commented Mar 7, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​tanstack/​solid-db@​0.2.107710070100100
Added@​tanstack/​query-db-collection@​1.0.2710010073100100
Added@​tanstack/​pacer-lite@​0.2.17810010093100

View full report

@socket-security
Copy link

socket-security bot commented Mar 7, 2026

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.

View full report

@monkeytypegeorge monkeytypegeorge removed the backend Server stuff label Mar 7, 2026
@fehmer fehmer changed the title refactor: solid alerts (@fehmer, @miodec) refactor: solid alerts (@miodec, @fehmer) Mar 7, 2026
@fehmer fehmer marked this pull request as ready for review March 7, 2026 17:29
@github-actions github-actions bot added the waiting for review Pull requests that require a review before continuing label Mar 7, 2026
@monkeytypegeorge monkeytypegeorge added backend Server stuff docs Related to Markdown files and documentation packages Changes in local packages labels Mar 7, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 #alertsPopup DOM/SCSS + imperative JS with SolidJS AlertsPopup + section components.
  • Add inbox collection/query + debounced flush strategy (TanStack solid-db/query-db-collection) and wire unread count + reward claiming.
  • Add /dev/addDebugInboxItem contract + 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

Comment on lines +192 to +196
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];
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AsyncContent now supports collection/collections, but the AsyncContent test suite only covers query/queries. Add tests for collection loading/error/success to prevent regressions.

Copilot uses AI. Check for mistakes.
acc[key] = {
value: () => q(),
isLoading: () => q.isLoading,
isError: () => q.isError,
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
isError: () => q.isError,
isError: () => q.isError,
error: () => (q.isError ? new Error("Collection error") : undefined),

Copilot uses AI. Check for mistakes.
Comment on lines +75 to +79
const allRewards: AllRewards[] = changes.transaction.mutations.flatMap(
(it) => (it.original as InboxItem).rewards,
);
claimRewards(allRewards);
},
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Server stuff docs Related to Markdown files and documentation frontend User interface or web stuff packages Changes in local packages waiting for review Pull requests that require a review before continuing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants