Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
93f273a
fix: chat threadquestion showing cinema
sheriffjimoh Sep 22, 2025
240077a
fix: bot page thread question url
sheriffjimoh Sep 22, 2025
1a2e27a
fix: threads not found message
sheriffjimoh Oct 3, 2025
8f2eeaf
fix(pro): threads not found message
sheriffjimoh Oct 3, 2025
78e9fdf
fix: restored hero bg banner
sheriffjimoh Oct 7, 2025
130f8c9
fix: update
sheriffjimoh Oct 7, 2025
92b2fb3
Merge branch 'develop' of https://github.com/bitcashorg/masterbots in…
sheriffjimoh Oct 8, 2025
9907138
fix: added isverified colum perm
sheriffjimoh Oct 8, 2025
73e28c4
fix: update
sheriffjimoh Oct 8, 2025
695cf24
fix: theme toggle resize
sheriffjimoh Oct 8, 2025
5ec652b
fix: added select all category
sheriffjimoh Oct 8, 2025
e20ccd4
fix: update
sheriffjimoh Oct 8, 2025
71cad84
Merge branch 'develop' of https://github.com/bitcashorg/masterbots in…
sheriffjimoh Oct 11, 2025
84159bb
fix: select all fix
sheriffjimoh Oct 16, 2025
545111d
fix: rm duplicate chatbot metadata seeder file
sheriffjimoh Oct 23, 2025
dc8ab41
fix: cmds for loggin seeds error
sheriffjimoh Oct 23, 2025
a1f7610
fix: dashboard popup
sheriffjimoh Nov 18, 2025
aae157e
fix: update the username into slug and redirect
sheriffjimoh Nov 18, 2025
72505ba
fix: make the username & appear on the menu after change
sheriffjimoh Nov 20, 2025
05bc529
fix: update
sheriffjimoh Nov 22, 2025
2bdf7fe
fix: preferences page design
sheriffjimoh Nov 22, 2025
8c87593
fix: remove the top position
sheriffjimoh Nov 22, 2025
8d1ba11
fix: hide hero and lang page
sheriffjimoh Nov 25, 2025
fd9935b
fix: lang and fontsize queries
sheriffjimoh Nov 25, 2025
67e0dbc
feat: added method to save user's lang preferences and set it after l…
sheriffjimoh Nov 25, 2025
1cffcab
fix: update and clean up
sheriffjimoh Nov 25, 2025
314565e
fix: store preference in db
sheriffjimoh Nov 28, 2025
ed70130
fix: observations
sheriffjimoh Nov 28, 2025
c226f24
fix: clean up
sheriffjimoh Nov 29, 2025
d165690
Merge branch 'develop' of https://github.com/bitcashorg/masterbots in…
sheriffjimoh Nov 29, 2025
c95b764
Merge branch 'develop' into fix-new-popup-issues
AndlerRL Dec 1, 2025
539adbd
fix: update on web pro
sheriffjimoh Dec 3, 2025
7bf98bd
Merge branch 'fix-new-popup-issues' of https://github.com/bitcashorg/…
sheriffjimoh Dec 3, 2025
4fb555e
fix(web-pro): move update from web
sheriffjimoh Dec 4, 2025
c5f79c6
fix: update
sheriffjimoh Dec 5, 2025
a9345b3
fix: update
sheriffjimoh Dec 5, 2025
8ba318e
fix: pro-web build + nextjs ver
AndlerRL Dec 8, 2025
3f36265
Merge branch 'develop' into fix-new-popup-issues
AndlerRL Dec 8, 2025
793c9b9
fix: update web pro
sheriffjimoh Dec 8, 2025
c1da516
Merge branch 'fix-new-popup-issues' of https://github.com/bitcashorg/…
sheriffjimoh Dec 8, 2025
c83000a
fix: update
sheriffjimoh Dec 8, 2025
5854aa9
fix: profile lang and username update
sheriffjimoh Dec 11, 2025
cc2cf93
fix: preference page design
sheriffjimoh Dec 12, 2025
4e979f6
Merge branch 'develop' of https://github.com/bitcashorg/masterbots in…
sheriffjimoh Dec 12, 2025
25e6640
fix: update conflict
sheriffjimoh Dec 12, 2025
525fd5e
fix: pro build error
sheriffjimoh Dec 12, 2025
9f258c5
fix: sync merge regressions
AndlerRL Dec 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ tasks:
cmds:
- hasura seeds apply --project apps/hasura --admin-secret ${HASURA_GRAPHQL_ADMIN_SECRET}

# - hasura seeds apply --project apps/hasura --database-name masterbots --admin-secret ${HASURA_GRAPHQL_ADMIN_SECRET}
Copy link
Member

Choose a reason for hiding this comment

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

Once you finished to debug, keep in mind to restore this 👀

# use this for debugging seeds and run "task seed > seed.log 2>&1" instead of just "task seed" to capture logs

# Turns on the hasura backend (docker desktop must be started first)
up:
cmds:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ insert_permissions:
- created_at
- is_approved
- is_blocked
- is_pro
- is_public
- model
- parent_thread_id
- short_link
- slug
- thread_id
- updated_at
Expand All @@ -60,11 +58,9 @@ insert_permissions:
- created_at
- is_approved
- is_blocked
- is_pro
- is_public
- model
- parent_thread_id
- short_link
- slug
- thread_id
- updated_at
Expand All @@ -78,7 +74,6 @@ select_permissions:
- created_at
- is_approved
- is_blocked
- is_pro
- is_public
- metadata
- model
Expand All @@ -98,7 +93,6 @@ select_permissions:
- created_at
- is_approved
- is_blocked
- is_pro
- is_public
- metadata
- model
Expand All @@ -118,7 +112,6 @@ select_permissions:
- created_at
- is_approved
- is_blocked
- is_pro
- is_public
- metadata
- model
Expand Down
Copy link
Member

Choose a reason for hiding this comment

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

Please restore this file. it is required for ICL system.

This file was deleted.

1 change: 1 addition & 0 deletions apps/pro-web/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,7 @@
}

.profile-hero-bg {
background-image: url("/hero-bg.jpg");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
Expand Down
2 changes: 1 addition & 1 deletion apps/pro-web/components/layout/profile/hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function Hero({ user }: { user: User }) {
if (!user) return null
return (
<div className="profile-hero-bg" id="hero-section">
<div className="relative z-[2] md:px-0 px-5">
<div className="relative z-[2] md:px-0 px-5 py-5">
<UserCard user={user} loading={false} />
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function ChatLayoutSection({ children }: { children: React.ReactNode }) {
return (
<>
{isDashboardOpen && (
<div className="flex fixed inset-0 z-50 justify-center items-center backdrop-blur-sm bg-black/50">
<div className="flex fixed inset-0 z-[9999] justify-center items-center backdrop-blur-sm bg-black/50">
<CategoryDashboard
isOpen={isDashboardOpen}
onClose={() => setIsDashboardOpen(false)}
Expand Down
5 changes: 1 addition & 4 deletions apps/pro-web/components/routes/thread/user-thread-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,7 @@ export default function UserThreadPanel({
>
{showChatbotDetails ? (
page === 'profile' ? (
<EmptyState
title="No Threads Available"
description={`There are no threads available for ${userProps?.username} yet.`}
/>
<EmptyState title="No public threads" description={''} />
) : (
isProRoute && <ChatChatbotDetails />
)
Expand Down
12 changes: 12 additions & 0 deletions apps/pro-web/components/shared/category-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ export function CategoryDashboard({
setLocalSelectedCategories([])
}

const handleSelectAll = () => {
const allCategoryIds = categories.map((category) => category.categoryId)
setLocalSelectedCategories(allCategoryIds)
}

if (!isOpen) return null

// Show loading state while category storage is loading
Expand Down Expand Up @@ -165,6 +170,13 @@ export function CategoryDashboard({
>
Clear All
</button>
<button
type="button"
onClick={handleSelectAll}
className="px-4 py-2 text-sm font-medium text-white bg-gray-700 rounded-lg shadow-sm transition-colors hover:bg-gray-600"
>
Select All
</button>
<button
type="button"
onClick={handleApplySelection}
Expand Down
12 changes: 12 additions & 0 deletions apps/pro-web/components/shared/onboarding-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ export function OnboardingSection({ isOpen, onClose }: OnboardingSectionProps) {
setLocalSelectedCategories([])
}

const handleSelectAll = () => {
const allCategoryIds = allCategories.map((category) => category.categoryId)
setLocalSelectedCategories(allCategoryIds)
}

Comment on lines +10 to +63
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n apps/pro-web/components/shared/onboarding-section.tsx

Repository: bitcashorg/masterbots

Length of output: 9839


🏁 Script executed:

rg "OnboardingSection" apps/pro-web --type tsx --type ts -B 2 -A 2

Repository: bitcashorg/masterbots

Length of output: 92


🏁 Script executed:

rg "OnboardingSection" apps/pro-web -B 2 -A 2

Repository: bitcashorg/masterbots

Length of output: 1266


🏁 Script executed:

rg "from.*onboarding-section" apps/pro-web

Repository: bitcashorg/masterbots

Length of output: 47


🏁 Script executed:

rg "onboarding-section" apps/web

Repository: bitcashorg/masterbots

Length of output: 310


🏁 Script executed:

rg "export.*onboarding-section\|from.*shared.*onboarding" apps/pro-web

Repository: bitcashorg/masterbots

Length of output: 47


🏁 Script executed:

cat -n apps/web/components/shared/onboarding-section.tsx | head -100

Repository: bitcashorg/masterbots

Length of output: 3942


🏁 Script executed:

rg "useCategorySelections" apps/pro-web

Repository: bitcashorg/masterbots

Length of output: 445


🏁 Script executed:

grep -A 5 -B 5 "OnboardingSection" apps/web/components/routes/home/home-page.tsx | head -20

Repository: bitcashorg/masterbots

Length of output: 628


OnboardingSection UI renders but all selection logic is disabled, creating a broken modal if accidentally used

The component has all core wiring commented out:

  • allCategories, selectedCategories, setSelectedCategories hooks are commented
  • useEffect sync is commented
  • handleClearAll and handleSelectAll have empty bodies
  • Categories grid render is commented

This means localSelectedCategories stays [], "Clear All"/"Select All" buttons are no-ops, and "Get Started" remains permanently disabled—users cannot interact with or dismiss the modal.

While currently unused in pro-web, exporting a non-functional UI component creates latent risk. If any future code imports and renders this component, it will trap the user with a broken modal. The web app version has full implementation (with proper state syncing, deduplication, and category management), showing this can work.

Either guard this component behind a feature flag to prevent accidental use, or implement it fully by uncommenting the sidebar wiring, re-enabling the useEffect sync, and the categories grid mapping.

🤖 Prompt for AI Agents
In apps/pro-web/components/shared/onboarding-section.tsx around lines 10 to 63,
the component has all category state wiring and UI mapping commented out which
leaves it non-functional and able to produce a trapped modal if accidentally
rendered; fix by either (A) guarding the component behind a feature flag/prop so
it returns null or a safe placeholder when PRO mode is active (prevent
accidental use), or (B) fully restore the original behavior: uncomment and
rewire allCategories, selectedCategories, setSelectedCategories and
setSelectedChatbots from useSidebar, re-enable the useEffect to sync
selectedCategories -> localSelectedCategories, restore the categories grid
rendering, implement handleSelectAll to set all category IDs, handleClearAll to
clear localSelectedCategories, and ensure handleApplySelection derives and
deduplicates selectedChatbots from allCategories before calling
setSelectedChatbots and onClose so the "Get Started" button and clear/select all
behave correctly.

if (!isOpen) return null

return (
Expand Down Expand Up @@ -99,6 +104,13 @@ export function OnboardingSection({ isOpen, onClose }: OnboardingSectionProps) {
>
Clear All
</button>
<button
type="button"
onClick={handleSelectAll}
className="flex-1 px-3 py-2 text-sm font-medium text-white bg-gray-700 rounded-lg shadow-sm transition-colors sm:flex-none sm:px-4 hover:bg-gray-600"
>
Select All
</button>
<button
type="button"
onClick={handleApplySelection}
Expand Down
1 change: 1 addition & 0 deletions apps/web/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,7 @@
}

.profile-hero-bg {
background-image: url("/hero-bg.jpg");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
Expand Down
31 changes: 26 additions & 5 deletions apps/web/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ export const authOptions: NextAuthOptions = {
credentials.password,
user[0].password,
)
// if (!isValid) {
// console.error('NextUser authentication failed: Invalid password')
// throw new Error('Invalid credentials')
// }
if (!isValid) {
console.error('NextUser authentication failed: Invalid password')
throw new Error('Invalid credentials')
}
console.log('NextUser authenticated successfully')
//* Return user details to be attached to the token
return {
Expand All @@ -98,7 +98,28 @@ export const authOptions: NextAuthOptions = {
strategy: 'jwt', //* NextAuth V > 4 needs to specify the session strategy
},
callbacks: {
async jwt({ token, user, account }) {
async jwt({ token, user, account, trigger, session }) {
console.log(
'JWT callback → trigger:',
trigger,
'session:',
session ? 'present' : 'none',
'user:',
user ? 'present' : 'none',
)

if (trigger === 'update' && session) {
console.log(
'JWT callback → handling update trigger, session payload:',
session,
)
token.name = session.name ?? token.name
token.slug = session.slug ?? token.slug
token.email = session.email ?? token.email
// If you want to refresh hasuraJwt on update, do it here (carefully, with try/catch).
return token
}

if (user) {
//* Add user role to the token when signing in with Google
if (account?.provider === 'google') {
Expand Down
8 changes: 5 additions & 3 deletions apps/web/components/auth/user-login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { UserMenu } from '@/components/layout/header/user-menu'
import { ProfileSidebar } from '@/components/layout/sidebar/profile-sidebar'
import { Button } from '@/components/ui/button'
import { Skeleton } from '@/components/ui/skeleton'
import { useProfile } from '@/lib/hooks/use-profile'
import { isTokenExpired } from 'mb-lib'
import { useSession } from 'next-auth/react'
import Link from 'next/link'
Expand All @@ -12,8 +13,9 @@ import { ProfileSidebarSkeleton } from '../shared/skeletons/profile-sidebar-skel

export function UserLogin() {
const { data: session, status } = useSession()
const { sessionUser } = useProfile()

if (status === 'loading') {
if (status === 'loading' && sessionUser === null) {
return <Skeleton className="h-6 w-24" />
}

Expand All @@ -32,9 +34,9 @@ export function UserLogin() {
return (
<>
<Suspense fallback={<ProfileSidebarSkeleton />}>
<ProfileSidebar user={session.user} />
{sessionUser && <ProfileSidebar user={sessionUser} />}
</Suspense>
<UserMenu user={session.user} />
{sessionUser && <UserMenu user={sessionUser} />}
</>
)
}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/layout/header/user-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function UserMenu({ user }: UserMenuProps) {
<DropdownMenuSeparator />
<DropdownMenuGroup>
<DropdownMenuItem className="flex items-center justify-between w-full py-0 px-0">
<ThemeToggle className="py-3 px-2" />
<ThemeToggle className="px-2 text-sm py-3 h-11" />
</DropdownMenuItem>
<DropdownMenuItem className="flex items-center justify-between w-full py-0 px-0">
<Link
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/layout/profile/hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function Hero({ user }: { user: User }) {
if (!user) return null
return (
<div className="profile-hero-bg" id="hero-section">
<div className="relative z-[2] md:px-0 px-5">
<div className="relative z-[2] md:px-0 px-5 py-5">
<UserCard user={user} loading={false} />
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function BrowseChatbotDesktopDetails({

return (
<div className="profile-hero-bg" id="hero-section">
<div className="relative z-10 max-w-screen-lg mx-auto px-4">
<div className="relative z-10 max-w-screen-lg mx-auto px-4 py-5">
<Link
href="/"
className="w-max mr-auto my-2 flex items-center leading-none gap-2 text-[#09090Baf] hover:text-[#09090B]"
Expand Down
20 changes: 10 additions & 10 deletions apps/web/components/routes/preferences/preference-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import type { PreferenceSetInput } from 'mb-genql'
import { toSlug } from 'mb-lib'
import { signOut, useSession } from 'next-auth/react'
import { useTheme } from 'next-themes'
import { useRouter } from 'next/navigation'
import { useEffect, useState } from 'react'
import { useAsyncFn } from 'react-use'
import GoogleTranslate from './google-translation'
Expand All @@ -54,13 +55,15 @@ export function PreferenceSection({ title, items }: PreferenceSectionProps) {
const [buttonType, setButtonType] = useState('')
const { data: session, update } = useSession()
const { customSonner } = useSonner()
const { currentUser, getUserInfo, updateUserDetails } = useProfile()
const { currentUser, getUserInfo, updateUserDetails, updateSessionUser } =
useProfile()
const [errorMessage, setErrorMessage] = useState('')
const [isLoading, setIsLoading] = useState(false)
const [sendindVEmail, setSendingVEmail] = useState(false)
const [inputValue, setInputValue] = useState({ username: '', email: '' })
const { setTheme, theme } = useTheme()
const { fontSize, setFontSize } = useAccessibility()
const router = useRouter()

useEffect(() => {
if (currentUser) {
Expand Down Expand Up @@ -270,21 +273,18 @@ export function PreferenceSection({ title, items }: PreferenceSectionProps) {

try {
const { username } = inputValue
const slug = currentUser?.slug || session.user?.slug
const slug = toSlug(username)
const email = currentUser?.email

await updateUserDetails(email ?? null, username ?? null, slug ?? null)

await update({
...session,
user: {
...session.user,
email: email || session.user.email,
name: username || session.user.name,
slug: slug || session.user.slug,
},
await updateSessionUser({
...session.user,
slug,
name: username,
})

router.push(`/u/${slug}/s/pref`)
customSonner({
type: 'success',
text: 'Profile updated successfully.',
Expand Down
5 changes: 1 addition & 4 deletions apps/web/components/routes/thread/user-thread-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,7 @@ export default function UserThreadPanel({
>
{showChatbotDetails ? (
page === 'profile' ? (
<EmptyState
title="No Threads Available"
description={`There are no threads available for ${userProps?.username} yet.`}
/>
<EmptyState title="No public threads" description={''} />
) : (
isChatRoute && <ChatChatbotDetails />
)
Expand Down
12 changes: 12 additions & 0 deletions apps/web/components/shared/category-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ export function CategoryDashboard({
setLocalSelectedCategories([])
}

const handleSelectAll = () => {
const allCategoryIds = categories.map((category) => category.categoryId)
setLocalSelectedCategories(allCategoryIds)
}

if (!isOpen) return null

// Show loading state while category storage is loading
Expand Down Expand Up @@ -165,6 +170,13 @@ export function CategoryDashboard({
>
Clear All
</button>
<button
Copy link
Member

Choose a reason for hiding this comment

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

Didn't we add this before? I have been using the "Select All" from previous PRs merged to prod, unless is a duplicate? 🤔

type="button"
onClick={handleSelectAll}
className="px-4 py-2 text-sm font-medium text-white bg-gray-700 rounded-lg shadow-sm transition-colors hover:bg-gray-600"
>
Select All
</button>
<button
type="button"
onClick={handleApplySelection}
Expand Down
Loading