mshumayl / ai-daleel

AI Daleel source code.
https://ai-daleel.vercel.app
1 stars 0 forks source link

Premium Feature - Notes #19

Closed mshumayl closed 1 year ago

mshumayl commented 1 year ago

PR to address #16

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ai-daleel ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 13, 2023 3:54pm
mshumayl commented 1 year ago

Adding a rich text editor might be overkill and introduce unnecessary bloat to the app. It is better to save notes in short "comments". Users can add and remove these comments as they see fit.

mshumayl commented 1 year ago

Logic flow

  1. User navigates to verse\[surahVerse].tsx.
  2. Run logic to check if current verse is saved by user. If true, skip Step 3.
  3. Run logic to query all previous comments made by user on the verse.

Rendered components

  1. If the verse has been saved, the submit button will display Add note. This triggers the saveNote API.
  2. If the verse has not been saved, the submit button will display Save verse and add note. This triggers the saveSnippet API and the saveNote API.
mshumayl commented 1 year ago

At this juncture, I think it's best to standardize the tRPC responses as per #22. This will make it much easier to make API requests to save notes for saved/unsaved verses.

mshumayl commented 1 year ago

Next steps: