Skip to content

Implement all remaining TODO items: search, tags, follow, subscriptions, lazy loading, image preview, notifications, and tests - #1

Merged
easonzhou1031-eng merged 5 commits into
mainfrom
copilot/complete-todo-list
Mar 25, 2026
Merged

Implement all remaining TODO items: search, tags, follow, subscriptions, lazy loading, image preview, notifications, and tests#1
easonzhou1031-eng merged 5 commits into
mainfrom
copilot/complete-todo-list

Conversation

Copilot AI commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Implements all pending items from todo.md across backend and frontend.

Backend

  • SearchGET /api/posts/search?q= and GET /api/sections/search?q= with regex-escaped input (ReDoS-safe)
  • Tagstags: [String] on Post model; GET /api/posts/tag/:tag filter endpoint
  • Followfollowing/followers arrays on User; POST /api/auth/follow/:id, POST /api/auth/unfollow/:id, GET /api/auth/profile/:id
  • SubscriptionssubscribedSections array on User; subscribe/unsubscribe routes on sections
  • Notifications — New Notification model (like_post, like_comment, comment, follow); CRUD routes at /api/notifications; notifications emitted from posts, comments, and follow routes
  • Tests — 17 Jest model schema tests in server/tests/

Frontend

  • Search bar in Home.js filtering sections in real-time
  • Tag input (comma-separated) in post creation; tag pills in Section.js and Post.js
  • UserProfile.js — public user profile page with follow/unfollow; author names in Post.js link to /user/:userId
  • "我的订阅" tab in Home.js showing subscribed sections
  • Lazy loading — all page components wrapped in React.lazy + Suspense in App.js
  • Image lightbox — full-screen overlay on image click in Post.js
  • Notifications.js — dropdown component; bell icon with unread badge in Navbar.js
  • E2E testApp.test.js render smoke test; fixed Jest module resolution for react-router-dom v7 + axios ESM

Security note

Search regex input is escaped via .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') before constructing RegExp.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI and others added 4 commits March 25, 2026 01:51
…azy loading, lightbox, and tests

- Content Search: POST /api/posts/search and /api/sections/search endpoints; search bar in Home.js
- Content Tags: tags field on Post model; tag input in Section.js; tag pills in Section.js and Post.js
- User Follow: following/followers on User model; follow/unfollow/profile routes in auth.js; UserProfile.js page
- Section Subscription: subscribedSections on User model; subscribe/unsubscribe routes; 'My Subscriptions' tab in Home.js
- Frontend Performance: React.lazy + Suspense for all page components in App.js
- Image Lightbox: full-screen overlay on image click in Post.js
- Notifications: Notification model + routes; Notifications dropdown in Navbar; notifications on like/comment/follow
- Unit Tests: server/tests/models.test.js with 17 tests using jest
- E2E Test: updated App.test.js
- Mark all implemented items as done in todo.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…loading, lightbox, notifications, tests

- Add content search: GET /api/posts/search and /api/sections/search with regex
- Add tag system: tags field on Post model, /api/posts/tag/:tag endpoint, tag pills in UI
- Add user follow: following/followers on User, follow/unfollow/profile endpoints, UserProfile.js page
- Add section subscriptions: subscribedSections on User, subscribe/unsubscribe/subscribed endpoints, subscription UI
- Add React.lazy + Suspense for all page components in App.js
- Add image lightbox in Post.js with full-screen modal overlay
- Add notification system: Notification model, notifications routes, bell icon in Navbar with unread badge
- Add unit tests: server/tests/models.test.js with 17 passing tests (jest + supertest)
- Update App.test.js with basic render test
- Update todo.md marking all items done

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI changed the title [WIP] Finish everything in the todo list Implement all remaining TODO items: search, tags, follow, subscriptions, lazy loading, image preview, notifications, and tests Mar 25, 2026
Copilot AI requested a review from UnoxyRich March 25, 2026 02:07
@UnoxyRich

Copy link
Copy Markdown
Member

copilot nb

@UnoxyRich
UnoxyRich marked this pull request as ready for review March 25, 2026 02:10
@easonzhou1031-eng
easonzhou1031-eng merged commit 35b66d7 into main Mar 25, 2026
3 checks passed
@easonzhou1031-eng

Copy link
Copy Markdown
Collaborator

rich nb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants