Skip to content

Commit

Permalink
feat: thread landing (#80)
Browse files Browse the repository at this point in the history
* devops: debug lhci results comment

* feat: thread landing

* devops: debug lhci results comment
  • Loading branch information
gaboesquivel authored Apr 6, 2024
1 parent 0a03d67 commit 4811e17
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 34 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
with:
urls: |
"https://${{ steps.vercel_preview_url.outputs.preview_url }}"
# "https://${{ steps.vercel_preview_url.outputs.preview_url }}/b/moneybot"
# "https://${{ steps.vercel_preview_url.outputs.preview_url }}/u/slug-1"
# "https://${{ steps.vercel_preview_url.outputs.preview_url }}/p"
# budgetPath: '.github/lighthouse/budget.json'
uploadArtifacts: true
temporaryPublicStorage: true
Expand Down
Empty file added .test-lighthouse
Empty file.
16 changes: 4 additions & 12 deletions apps/masterbots.ai/app/(browse)/[category]/[threadId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import { getThread } from '@/services/hasura'
import { BrowseThread } from '@/components/home/browse-thread'
import { ChatPageProps } from '@/app/c/[chatbot]/[threadId]/page'

export default async function ChatPage({ params }: ChatPageProps) {
export default async function ThreadLandingPage({ params }: ChatPageProps) {
const thread = await getThread({
threadId: params.threadId
})

//TODO: handle threadId not found

return <pre>{}</pre>
}

export interface ChatPageProps {
params: {
threadId: string
chatbot: string
}
return <BrowseThread thread={thread} />
}
12 changes: 0 additions & 12 deletions apps/masterbots.ai/app/b/[id]/[threadId]/page.tsx

This file was deleted.

3 changes: 1 addition & 2 deletions apps/masterbots.ai/app/c/[chatbot]/[threadId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export default async function ChatPage({ params }: ChatPageProps) {
if (!jwt || isTokenExpired(jwt) || !user)
redirect(`/sign-in?next=/${params.threadId}/${params.threadId}`)
const thread = await getThread({
threadId: params.threadId,
jwt
threadId: params.threadId
})

//TODO: handle threadId not found
Expand Down
3 changes: 1 addition & 2 deletions apps/masterbots.ai/components/c/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ export function Chat({
isPublic: activeChatbot?.name !== 'BlankBot'
})
const thread = await getThread({
threadId,
jwt: hasuraJwt
threadId
})
setActiveThread(thread)
setIsOpenPopup(true)
Expand Down
3 changes: 1 addition & 2 deletions apps/masterbots.ai/services/hasura/hasura.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,8 @@ export async function getThreads({
return thread as Thread[]
}

export async function getThread({ threadId, jwt }: GetThreadParams) {
export async function getThread({ threadId }: GetThreadParams) {
let client = getHasuraClient({})
if (jwt) client = getHasuraClient({ jwt })
const { thread } = await client.query({
thread: {
chatbot: {
Expand Down
2 changes: 1 addition & 1 deletion apps/masterbots.ai/services/hasura/hasura.service.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface GetThreadsParams extends HasuraServiceParams {
offset?: number
}

export interface GetThreadParams extends HasuraServiceParams {
export interface GetThreadParams {
threadId: string
}

Expand Down

0 comments on commit 4811e17

Please sign in to comment.