Skip to content

Add save notes functionality#132

Merged
ShriramJana merged 14 commits intodevelopfrom
save-notes
Mar 23, 2026
Merged

Add save notes functionality#132
ShriramJana merged 14 commits intodevelopfrom
save-notes

Conversation

@SinhSinhAn
Copy link
Contributor

Summary

  • Add userMetadataToNotes junction table with composite (userId, fileId) primary key and saved boolean
  • Add savedNote tRPC router with toggle, isSaved, and getSavedNotes endpoints
  • Add SaveButton component with optimistic updates and auth redirect on FileCard

Closes #116

Note: Since #98 is not yet done, a SavedNotes profile component should be added there when implemented.

Add ability for users to save/bookmark notes via a new
userMetadataToNotes table, savedNote tRPC router, and
SaveButton component on FileCard.
@vercel
Copy link

vercel bot commented Mar 15, 2026

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

Project Deployment Actions Updated (UTC)
utd-notebook Ready Ready Preview, Comment Mar 23, 2026 10:09pm

Request Review

Integrate SaveButton alongside NoteEditButton using
develop's updated card layout.
Copy link
Member

@TyHil TyHil left a comment

Choose a reason for hiding this comment

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

Bit of a nitpick but dyt we could just throw the saved notes trpc procedures in the notes router and throw the userMetadataToNotes schema in the users.ts schema file. Like in Clubs.

Otherwise looking good, just a few small things

Copy link
Member

@TyHil TyHil left a comment

Choose a reason for hiding this comment

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

I don't think we need any package lock changes in this PR if you wanna just do git checkout develop -- package-lock.json and commit the changes. Other than that, tested and looks good!

@ShriramJana on merge if you would make a comment on #98 to add a SavedNotes component to the profile page for that issue, that'd be great.

- models.ts: include all new types from develop (SelectFileWithAuthorPreview,
  SelectFileWithUserMetadata, SectionWithFilesWithUserMetadata) alongside
  savedNote types from save-notes
- FileCard.tsx: use SelectFileWithAuthorPreview type and authorDisplay logic
  from develop, keep SaveButton from save-notes
Catches up 5 files that were behind develop due to incomplete auto-merge:
- section.ts: add with: { author: true } to all file queries
- FilesGrid.tsx: use SectionWithFilesWithUserMetadata | SelectFileWithAuthorPreview[]
- CreatedNotes.tsx: use SelectFileWithAuthorPreview type
- SettingsForm.tsx: use SelectFileWithAuthorPreview type
- notes/[...slug]/page.tsx: use SectionWithFilesWithUserMetadata
@ShriramJana ShriramJana merged commit eafe69e into develop Mar 23, 2026
3 checks passed
@ShriramJana ShriramJana deleted the save-notes branch March 23, 2026 22:12
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.

Save notes

3 participants