Skip to content

[DEV-607] Create Notification Panel#93

Open
mar-crespo wants to merge 7 commits intopreviewfrom
notification-panel
Open

[DEV-607] Create Notification Panel#93
mar-crespo wants to merge 7 commits intopreviewfrom
notification-panel

Conversation

@mar-crespo
Copy link
Copy Markdown

References

  • Linear: [DEV-607]

Proposed Changes

  • Created a new NotificationPanel component that displays up to 4 recent notifications with support for answers to questions and responses to answers
  • Implemented time formatting that shows readable timestamps (e.g., "just now", "5 mins ago", "2 hrs ago", "3 days ago") to make notifications more user-friendly
  • Added comprehensive styling with a CSS module and
  • Udated TypeScript types to support the Notification data structure
  • Created testing page. Results of test page:
Screenshot 2026-02-26 at 10 07 32 AM Screenshot 2026-02-26 at 10 07 39 AM

@linear
Copy link
Copy Markdown

linear bot commented Feb 26, 2026

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
help Ready Ready Preview, Comment Apr 4, 2026 6:12pm

Request Review

Copy link
Copy Markdown
Contributor

@issacli-0821 issacli-0821 left a comment

Choose a reason for hiding this comment

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

Can you merge from preview? And use the timeFormat function available in utils.ts. We might also want to modify the logic so the display changes depending on whether the notification has been read or not (field on notification object)

email?: string;
};

export type Notification = Answer | Comment;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually, it might be a better idea to use the Notification type as we have it under the models. Sorry for the confusion!

Comment on lines +50 to +57
<Pane className={styles.notificationIcon}>
{isAnswer(notification) ? (
<MdQuestionAnswer className={styles.notificationIconSVG} />
) : (
<MdOutlineQuestionAnswer
className={styles.notificationIconSVG}
/>
)}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we put the conditional rendering out of the return? Maybe conditional rendering at the top where the consts are, and use that variable here

<Pane className={styles.notificationContent}>
<Text className={styles.notificationText}>
{isAnswer(notification) ? (
<>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment as above^

export type Notification = {
id: number;
user: HoagieUser;
question: number;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's make the question, answer, and comment actually of type Question, Answer, and Comment. With this change, we don't need to query the backend when rendering the notifs

Icon: IconType;
title: string;
} {
const iconMap: Record<NotificationType, IconType> = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe pull these maps out as constants

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.

2 participants