-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: january 1st release #345
Conversation
* ✨ Added back button to thread details page * ⚡️ changed char to svg
* ⚡️ added custom error page * ⚡️ clean up
…adata (#215) * feat: added og api endpoint * feat: design og image for dark mode * fix: file formated * fix: amend og image to pick current theme color and adapt * feat: added custom metadata to thread page * feat: added custom metadata to bot page * fix: clean up * fix: move bg to a component * fix: move og-image design to a component * fix: use variable for URL * fix: to slug func * ⚡️ Move and clean up UrlToSlug * fix(masterbots.ai): zod dependecy * fix: type error * fix: type error for metadata * fix: clean and build fix --------- Co-authored-by: Roberto Lucas <[email protected]>
* fix: og to render first letter of username if there's no avatar * fix: clean up * fix: clean up
* feat: create action.ts * fix: upt share button * fix: add axios module * fix: add resend module * fix: update vercel env config * fix: split share function * fix: update share component * [coderabbitai] style: upt thread-user-actions condition Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Roberto Lucas <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* feat: add get_free_month column to user table * feat: create referral table * feat: add is_blocked column to user table * feat: add pro_user_subscription_id column to user table * fix: upt metadata * fix: update relationship name
* feat: create 'models' table AI models * fix: add 'model' column to 'thread' table with foreign key constraint * feat: add model_value into models
* [masterbots.ai]feat:(multimodels-integration)add actions - helpers - routes * [masterbots.ai]feat:(multimodels-integration)add NextTopLoader * [masterbots.ai]feat:(multimodels-integration)add NextTopLoaders * [masterbots.ai]feat:(multimodels-integration)add new chat components * [masterbots.ai]chore:next version * [masterbots.ai]feat:(multimodels-integration)update use context * [masterbots.ai]feat:(multimodels-integration)icons update * [masterbots.ai]chore:command ui * [masterbots.ai]refactor:moving chat componets to folder * [masterbots.ai]feat:env checker * [masterbots.ai]feat:env guard
* fix-guards + dom warning * fix-rename env var - vercel name
* fix: update terms * fix: building error * fix: update terms content * fix: rm the older part at the bottom
* feat: added free card * feat: added animation to the plan card * feat: added more plan card and referral code link * fix: clean up * wip: wizard * feat: wizard & modal * feat: plan Design theme and modal Header and Footer * feat: plan clean up * update * clean up * fix: rm plan comp on browse page * fix: wizard clean up * feat: succes & error modal * feat: loading comp * feat: added checkout comp * feat: set up stripe and context * wip: implementing subscription * feat: implementing subscription * feat: payment reciept * fix: clean up receipt * fix: modal not showing & shallow routing * fix: small fix * fix: receipt comp * fix: clean up * fix: shallow rerouting * feat: check if user has an active subscription * fix: coderabbit ob * fix: coderabbit ob * fix: coderabbit clean up update * fix: coderabbit clean up update * fix: coderabbit clean up update * fix: clean up * fix: clean up * fix: page restructuring and status on the receipt * fix: revamp receipt and structure * fix: rm unused file * fix: clean up * fix: update & clean up * fix: update * fix: rm the svg * fix: revamp formatSystemPrompts * fix: revamp msg to formatSystemPrompts * fix: update * fix: refactor the receipt page * fix: rm public key * fix: update * fix: update * fix: update * fix: code refactor for error and loading rendering * ref: calling secret keys from server * ref: receipt page and small fix * fix: rm file * fix(impr): subs & flow ux + cleanup * fix(masterbots.ai): OG not redering (#224) * fix: og to render first letter of username if there's no avatar * fix: clean up * fix: clean up * fix(masterbots.ai): share function (#225) * feat: create action.ts * fix: upt share button * fix: add axios module * fix: add resend module * fix: update vercel env config * fix: split share function * fix: update share component * [coderabbitai] style: upt thread-user-actions condition Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Roberto Lucas <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat(hasura): update user db schema for pro users (#227) * feat: add get_free_month column to user table * feat: create referral table * feat: add is_blocked column to user table * feat: add pro_user_subscription_id column to user table * fix: upt metadata * fix: update relationship name * feat(hasura): add Ai Model Tracker To Threads (#229) * feat: create 'models' table AI models * fix: add 'model' column to 'thread' table with foreign key constraint * feat: add model_value into models * [masterbots.ai] feat: multi AI models integration (#228) * [masterbots.ai]feat:(multimodels-integration)add actions - helpers - routes * [masterbots.ai]feat:(multimodels-integration)add NextTopLoader * [masterbots.ai]feat:(multimodels-integration)add NextTopLoaders * [masterbots.ai]feat:(multimodels-integration)add new chat components * [masterbots.ai]chore:next version * [masterbots.ai]feat:(multimodels-integration)update use context * [masterbots.ai]feat:(multimodels-integration)icons update * [masterbots.ai]chore:command ui * [masterbots.ai]refactor:moving chat componets to folder * [masterbots.ai]feat:env checker * [masterbots.ai]feat:env guard * docs: site map diagram * feat: set up stripe and context * wip: implementing subscription * fix: rm the svg * fix: replace secret with variable * fix: chat restructure * fix(update): chat restructure * fix(deployment error): can't find an icon or not exported * fix: deployment issues * fix: deployment issues * fix: deployment issues * fix: adjust design * fix: clean up * fix: clean up * fix: color var updaye * [coderabbitai] impr: update apps/masterbots.ai/components/stripe-element.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * [coderabitai] impr: update apps/masterbots.ai/components/succes-content.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: success close button * fix: bg image for yearly card * fix: move func to util * ref: receipt page function to use reac-use * fix: move depencies to the app * fix: clean up * ref: wizard to use radix dialog components * update * fix: coderabitai update --------- Co-authored-by: Roberto Lucas <[email protected]> Co-authored-by: Nathanael Liu <[email protected]> Co-authored-by: Roberto Lucas <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Brandon Fernández <[email protected]>
* fix-guards + dom warning * fix-rename env var - vercel name * fix-changed PERPLEXITY-LLama model
* fix(UI):varius UI fixes * fix(UI):varius UI fixes * fix(UI): Tailwind class corrections, conflict resolution, text alignent to the left * fix(UI):update
* fix: make the dialog content responsive * fix: free plan card adjusted * fix: update * fix: update receipt styles * fix: build error * fix: build error * fix: build error update * fix: update * fix: observation
* feat: add redirection rules * fix: update all links with new shorten urls * fix: update all links with new shorten urls * feat: make folder structure according to sitemap * [coderabbitai] impr(masterbots.ai): update app/c/page.tsx error handling Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * [coderabbitai] impr(masterbots.ai): update app/c/[category]/[chatbot]/page.tsx error handling Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: build error * [coderabbitai] impr(masterbots.ai): update app/c/[category]/[chatbot]/page.tsx error handling Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: add sitemap and metagraph * fix: use original generateMetadata * fix: update page links * fix: show only filtered threads on page reload * fix: build error --------- Co-authored-by: Roberto Lucas <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* feat: add 'disabled' state to ChatAccordion * fix: show default question's answer in thread list * fix: use braces and create explicit statement blocks
* update * fix: update * fix: responsiveness * fix: update * fix: few clean up * fix: rm unused image * fix: rm unused image
* impr(hasura): db tables * impr(hasura): db tables * fix(hasura): user permissions * impr(hasura): sql models enum migration
* feat: create mb-drizzle package initial structure * feat:(masterbots.ai) add drizzle endpoint + service * chore: include database url * chore: upt mb-drizzle * feat: refactor drizzle config + generations * chore: impr migrate * chore: add working drizzle connection + migrations * feat: add centralized actions * chore: add ai review recomendations
* update * fix: rm category * update * fix: pop up on the user threads * update * update clean up * update * fix: clean up * fix: clean up and update * fix: update * fix: popup on navigation * fix: update * update * update * update * clean up * update * merge
* add chatbot-details and browse-details variants * feat: add bio generation * feat: chat profile bg * chore: update bot profile designs * chore: remove internal padding from cardHeader component * impr: iconography + border thickness * fix: numberShortener util fn --------- Co-authored-by: Roberto Lucas <[email protected]>
* update * added follow user * update * fix: upt hasura metadata databases, public_social_following.yaml coderabbitai code suggestion. Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: upt masterbots.ai lib, utils.ts coderabbitai suggestion. Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: user card * update * fix: permission * update * fix: added more column for chatbot followee * fix:foloow chatbot implementation * update * threads by following user/bots * update * update * update * update * update * update * update * update --------- Co-authored-by: Roberto Lucas <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* chore: add new icons * feat: Sonner custom hooks and setup * feat: use useSonner hook throughout the app * fix: overflow of the width of the sonner * chore: add new icons * feat: Sonner custom hooks and setup * feat: use useSonner hook throughout the app * chore: use hook sonner * refactor: changes according to coderabbitai * refactor: update use of sonner * chore:remove icons and use lucide icons * chore: Using Lucide Icons
* fix: update url * fix: url update * update
…d ID (#335) * update * fix: make OG image use default * fix: update * fix: update * fix: obs * fix: update * fix: added og to browse and chat * update * update * update * fix: provider types error * fix: updfate UUID * fix: update UUID
* chore: document hook useSonner * refactor: document hook useSonner, according coderabbit
* impr: web search response * refactor: extracting clickable generation logic * refactor: extracting clickable generation logic * fix: webSearch clickable text + reference links * chore: fix build * feat:(impr) stable version link to references format step 1 * feat:(impr) stable version link to references format step 2 --------- Co-authored-by: Bran18 <[email protected]>
* refactor: replicate tooltip effect in desktop bot chatbot details * fix: add guard and removed re-render * fix: refactor mobile bot chatbot details * refactor: make chatPannel bigger * chore:add new bot card design + sidebar hover color * chore: delete public and private sw + icons * chore: include public + delete extra actions * chore: add sidebar bg * add sidebar new styles + lib fn * feat: add select bot * chore: cleaning * fix: build - removing BotMessageSquareIcon * fix: types/node version + node min ver req --------- Co-authored-by: sheriffjimoh <[email protected]> Co-authored-by: Roberto Lucas <[email protected]>
Reviewer's Guide by SourceryThis pull request includes changes to the hasura service to support new features and bug fixes. It also includes changes to the user card component to support following and unfollowing users. Sequence diagram for user follow/unfollow flowsequenceDiagram
participant User
participant UI
participant HasuraService
participant DB
User->>UI: Click Follow/Unfollow button
UI->>HasuraService: userFollowOrUnfollow(followerId, followeeId, jwt)
HasuraService->>DB: Check follow status
DB-->>HasuraService: Return follow status
alt Not Following
HasuraService->>DB: Insert follow relationship
DB-->>HasuraService: Confirm follow
HasuraService-->>UI: Return {success: true, follow: true}
else Already Following
HasuraService->>DB: Delete follow relationship
DB-->>HasuraService: Confirm unfollow
HasuraService-->>UI: Return {success: true, follow: false}
end
UI-->>User: Update UI state
Entity relationship diagram for social following featureerDiagram
User ||--o{ SocialFollowing : "has"
SocialFollowing }o--|| User : "follows"
SocialFollowing }o--|| Chatbot : "follows"
User {
string userId PK
string username
string email
string profilePicture
}
SocialFollowing {
string followerId FK
string followeeId FK
number followeeIdChatbot FK
string createdAt
}
Chatbot {
number chatbotId PK
string name
string avatar
}
Class diagram for updated Hasura service typesclassDiagram
class HasuraService {
+getHasuraClient(params: GetHasuraClientParams)
+getCategories()
+getCategory(categoryId: number)
+getChatbots(params: GetChatbotsParams)
+getThreads(params: GetThreadsParams)
+getThread(params: GetThreadParams)
+saveNewMessage(params: SaveNewMessageParams)
+upsertUser(params: UpsertUserParams)
+userFollowOrUnfollow(params: FollowParams)
+chatbotFollowOrUnfollow(params: FollowParams)
}
class SocialFollowing {
+followerId: string
+followeeId: string
+followeeIdChatbot: number
+createdAt: string
}
class User {
+userId: string
+username: string
+email: string
+profilePicture: string
+followers: SocialFollowing[]
+following: SocialFollowing[]
}
User -- SocialFollowing
HasuraService -- User
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @AndlerRL - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding documentation for the new social features and database schema changes to help other developers understand the system
- Standardize the styling approach across components - either use direct Tailwind classes or the cn() utility consistently, but not both
Here's what I looked at during the review
- 🟡 General issues: 5 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
||
const client = getHasuraClient({ jwt }) | ||
try { | ||
const isFollowing = await getFollowStatus(client, followerId, followeeId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): Consider using a database transaction to prevent race conditions in follow/unfollow operations
The current implementation could lead to inconsistencies if multiple follow/unfollow requests are made simultaneously. Consider wrapping the status check and follow/unfollow operation in a single database transaction.
Suggested implementation:
const client = getHasuraClient({ jwt })
try {
// Start a transaction
const result = await client.transaction(async (tx) => {
const isFollowing = await getFollowStatus(tx, followerId, followeeId)
if (!isFollowing) {
await followUser(tx, followerId, followeeId)
return { success: true, follow: true }
}
await unfollowUser(tx, followerId, followeeId)
return { success: true, follow: false }
})
return result
This change assumes that:
- The Hasura client supports transactions (most GraphQL clients do)
- The
getFollowStatus
,followUser
, andunfollowUser
functions need to be updated to accept a transaction object instead of the client - You may need to adjust the transaction API syntax based on your specific Hasura client implementation
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
|
||
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation> | ||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): Add cleanup for loading states in useEffect
Consider adding cleanup in the useEffect to reset loading states if the component unmounts during data fetching.
Suggested implementation:
// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>
useEffect(() => {
const abortController = new AbortController();
let isSubscribed = true;
const fetchData = async () => {
setIsLoading(true)
try {
if (!activeCategory) {
await getThreadNum()
} else {
await getCategoryName()
}
if (isSubscribed) {
setIsLoading(false)
}
} catch (error) {
if (error.name === 'AbortError') {
return;
}
console.error('Error fetching data:', error)
if (isSubscribed) {
setIsLoading(false)
}
}
}
fetchData()
return () => {
isSubscribed = false;
abortController.abort();
setIsLoading(false);
}
The getThreadNum and getCategoryName functions should be updated to accept and use the AbortController's signal in their fetch operations. For example:
const getThreadNum = async (signal?: AbortSignal) => {
const response = await fetch(url, { signal });
// ... rest of the function
}
The same should be done for getCategoryName function.
const endIndex = endMarker | ||
? str.indexOf(endMarker, startIndex + startMarker.length) | ||
: str.length | ||
const endIndex = endMarker ? str.indexOf(endMarker, startIndex + startMarker.length) : str.length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: Add validation for startIndex before calculating endIndex
When startIndex is -1, the endIndex calculation could lead to incorrect substring extraction. Consider adding a guard clause to handle this case explicitly.
} catch (error: any) { | ||
throw new Error('Unknown error occurred while fetching thread') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): Consider preserving original error details instead of using a generic message
The generic error message makes debugging harder. Consider including the original error details in the thrown error message: throw new Error(
Failed to fetch thread: ${error.message})
} catch (error: any) { | |
throw new Error('Unknown error occurred while fetching thread') | |
} catch (error: any) { | |
throw new Error(`Failed to fetch thread: ${error.message}`) |
cancelButton: | ||
'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground' | ||
}, | ||
duration: 900000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (performance): Toast duration of 15 minutes seems excessive for notifications
Consider using a more standard duration like 3000-5000ms for notifications to avoid them staying on screen too long
import { userFollowOrUnfollow } from '@/services/hasura/hasura.service' | ||
import type { SocialFollowing } from 'mb-genql' | ||
import router from 'next/router' | ||
import { useSonner } from '@/lib/hooks/useSonner' | ||
|
||
interface UserCardProps { | ||
user: User | null | ||
loading?: boolean | ||
} | ||
export function UserCard({ user, loading }: UserCardProps) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (complexity): Consider extracting the profile picture upload and bio generation logic into custom hooks to improve maintainability and testability.
The component has grown complex with multiple responsibilities. Consider extracting the profile picture upload and bio generation logic into custom hooks:
// useProfilePicture.ts
export function useProfilePicture(user: User | null) {
const [picture, setPicture] = useState(user?.profilePicture)
const [isUploading, setIsUploading] = useState(false)
const { uploadFilesCloudinary } = useUploadImagesCloudinary()
const { updateUserInfo } = useProfile()
const handleUpload = async (file: File) => {
setIsUploading(true)
try {
const { data, success } = await uploadFilesCloudinary(file)
if (success) {
const imageUrl = data?.secure_url as string
await updateUserInfo(null, null, imageUrl)
setPicture(imageUrl)
}
} finally {
setIsUploading(false)
}
}
return { picture, isUploading, handleUpload }
}
// useBioGeneration.ts
export function useBioGeneration(user: User | null) {
const [bio, setBio] = useState(user?.bio)
const [isLoading, setIsLoading] = useState(false)
const { append } = useChat(/* chat config */)
const generateBio = async () => {
setIsLoading(true)
try {
// Bio generation logic
} finally {
setIsLoading(false)
}
}
return { bio, isLoading, generateBio }
}
This separates concerns while maintaining functionality, making the component easier to maintain and test.
@AnoukRImola -- we need to test all these changes to ensure the integrity of this ASAP. Review the recent merged PRs (listed in the changelog) to test them 👀 we need the report to account the progress with the MB development. Merging! cc - @merivercap |
@coderabbitai please elaborate a product update document for the recent changes going to production. Product Update Example:What’s shipping 🌟Tip: Use this space to announce features and releases that impact cross-functional stakeholders in your organization like sales or customer support. Avoid listing out every single bug or feature the team worked on. For team members who want to learn more about a specific release, you can link inline to existing Notion pages by typing
Announcements 📣Tip: This is a good place to announce upcoming large features, status updates, or even significant delays are good ones to call out. Reference other Notion pages to provide more context on these announcements like the examples below.
FYI’s 📌Tip: The space below should be used for highlighting important team processes or org changes that may have been missed. Don’t forget to link to relevant docs that help drive clarity around why those decisions were made.
Launch calendar** Tip:** Embed a calendar view of the product roadmap directly in your weekly product update so cross-functional teams can see for themselves when a feature is shipping. Link your launch calendar by typing ↓ Click [Untitled](https://www.notion.so/14b9d1881dc18198887cfb419549ac8b?pvs=21) Archive 🗂️Tip: Save all your previous updates by storing them in a toggle. Type
|
Tip For best results, initiate chat on the files or code changes. @AndlerRL Here's the product update document for the January 1st release: What's shipping 🌟
Announcements 📣
FYI's 📌
Launch calendar
🔗 Analysis chain🏁 Scripts executedThe following scripts were executed for the analysis: Script:
Length of output: 14405 |
Changelog:
Summary by Sourcery
Add support for following chatbots and users.
New Features:
Tests: