Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@ test.html
.claude/

# generated env schema for Node runtime
/config/env.schema.runtime.cjs
/config/env.schema.runtime.cjs
.githooks/
3 changes: 1 addition & 2 deletions __tests__/components/brain/BrainMobile.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jest.mock('@/components/brain/mobile/BrainMobileWaves', () => ({ __esModule: tru

jest.mock('@/components/brain/mobile/BrainMobileMessages', () => ({ __esModule: true, default: () => <div data-testid='messages' /> }));

jest.mock('@/components/brain/notifications/Notifications', () => ({ __esModule: true, default: () => <div data-testid='notifications' /> }));
jest.mock('@/components/brain/notifications', () => ({ __esModule: true, default: () => <div data-testid='notifications' /> }));

jest.mock('@/components/brain/my-stream/MyStreamWaveLeaderboard', () => ({ __esModule: true, default: () => <div data-testid="leaderboard" /> }));

Expand Down Expand Up @@ -96,4 +96,3 @@ describe('BrainMobile', () => {
rerender(<div />);
});
});

Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jest.mock('@/contexts/TitleContext', () => ({
TitleProvider: ({ children }: { children: React.ReactNode }) => children,
}));

import Notifications from '@/components/brain/notifications/Notifications';
import Notifications from '@/components/brain/notifications';

describe('Notifications component', () => {
beforeEach(() => {
Expand Down
1 change: 1 addition & 0 deletions codex/STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This table is the single source of truth for active and historical tickets. Keep
| TKT-0006 | Centralise media and IPFS upload orchestration | Backlog | P1 | evocoder | — | 2025-10-14 |
| TKT-0007 | Stabilize group name search input | In-Progress | P0 | simo6529 | [#1540](https://github.com/6529-Collections/6529seize-frontend/pull/1540) | 2025-10-14 |
| TKT-0008 | Reconcile Codex board merge conflicts | In-Progress | P1 | openai-assistant | [#1539](https://github.com/6529-Collections/6529seize-frontend/pull/1539) | 2025-10-14 |
| TKT-0009 | Refactor Brain notifications shell for modular clarity | In-Progress | P1 | simo6529 | [#1545](https://github.com/6529-Collections/6529seize-frontend/pull/1545) | 2025-10-15 |

## Usage Guidelines

Expand Down
39 changes: 39 additions & 0 deletions codex/tickets/TKT-0009.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
created: 2025-10-15
id: TKT-0009
owner: simo6529
priority: P1
status: In-Progress
title: Refactor Brain notifications shell for modular clarity
---

## Context

> The `components/brain/notifications/Notifications.tsx` component currently mixes data fetching, auth handling, scroll orchestration, and UI state rendering in one file, making it difficult to maintain and reuse. We need to break it into focused pieces without changing behaviour, visuals, or types.

## Plan

- [x] Document proposed subcomponents, hooks, and utilities for the Notifications feature.
- [x] Extract data/side-effect orchestration into a dedicated Notifications hook layer.
- [x] Extract presentational state rendering into focused subcomponents.
- [x] Rebuild the main Notifications shell to compose the new modules with unchanged API.
- [ ] Run type-check and lint to confirm no regressions. _(Blocked by existing repository failures; see log.)_

## Acceptance

- [ ] `components/brain/notifications/index.tsx` acts as the main shell and wires data/hooks → subcomponents.
- [ ] New hooks/subcomponents/utilities live under `components/brain/notifications/{hooks,subcomponents,utils}` and keep runtime behaviour identical.
- [ ] Existing imports of `Notifications` continue to work via stable exports.
- [ ] `npm run type-check` and `npm run lint` succeed after the refactor.

## Links

- Primary PR: [#1545](https://github.com/6529-Collections/6529seize-frontend/pull/1545)
- Follow-ups: _(reference additional tickets or TODO items)_

## Log

- 2025-10-15T08:34:17Z – Created ticket and drafted refactor plan.
- 2025-10-15T08:35:49Z – Outlined modular breakdown: main shell in `index.tsx`, hook layer (`useNotificationsController`, `useNotificationsScroll`), presentational states (`NotificationsContent`, `NotificationsStateMessage`), and error utilities.
- 2025-10-15T09:44:55Z – Refactored Notifications into modular files, attempted type-check/lint (failing due to pre-existing repository issues).
- 2025-10-15T10:56:58Z – Hardened mark-all-as-read success handler against context cleanup failures.
Loading