Skip to content

Commit b19fdd6

Browse files
authored
Feat: Updated Hackbot UI (#494)
* Update designs to latest figma * Update name and CTA ui * Hackbot Knowledge docs fix and lint * Allow hackbot links to open accordion on project info page * Hackbot fix linking when on same page in project info useHashChange is for when * Lint fixes * Hacbot import HackerProfile * Update styling and attention seeking. Remove unused code as well * Update font to be font-jakarta across hackbot * Increase question chip border radius * minor ui fixes
1 parent 087904e commit b19fdd6

20 files changed

Lines changed: 708 additions & 509 deletions

File tree

app/(api)/_utils/hackbot/stream/fewShots.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ export const FEW_SHOT_EXAMPLES: HackbotMessage[] = [
2727
content:
2828
"Don't stress - start by picking a problem you care about and keep it simple! Check out the Starter Kit for brainstorming guides and past winning hacks. If you need teammates, hop on the #find-a-team Discord channel. Here are some workshops to help you get going:",
2929
},
30+
{
31+
role: 'user',
32+
content: 'When is lunch?',
33+
},
34+
{
35+
role: 'assistant',
36+
content: 'Let me check the schedule for meal times!',
37+
},
3038
{
3139
role: 'user',
3240
content: 'What prize tracks should I enter?',

app/(api)/_utils/hackbot/systemPrompt.ts

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { HackerProfile } from '@typeDefs/hackbot';
22

3-
// TODO: StarterKit id's need to be updated
43
export const PATH_CONTEXT_MAP: Record<string, string> = {
54
'/': 'the Hub homepage (announcements, prize tracks, mentor/director help, Discord)',
65
'/#prize-tracks': 'the Prize Tracks section of the Hub homepage',
@@ -12,14 +11,29 @@ export const PATH_CONTEXT_MAP: Record<string, string> = {
1211
'/project-info#submission':
1312
'the Submission Process tab of the Project Info page',
1413
'/project-info#judging': 'the Judging Process tab of the Project Info page',
14+
'/project-info#submission-due':
15+
'the "Submission Due" step of the Judging Process (11:00 AM deadline)',
16+
'/project-info#team-vs-table':
17+
'the "Team vs Table Number" step of the Judging Process',
18+
'/project-info#demo-time':
19+
'the "Demo Time" step of the Judging Process (12:00 – 2:00 PM)',
20+
'/project-info#break':
21+
'the "Break" step of the Judging Process (2:00 – 3:00 PM)',
22+
'/project-info#closing-ceremony':
23+
'the "Closing Ceremony" step of the Judging Process (3:00 – 4:00 PM)',
1524
'/starter-kit': 'the Starter Kit page',
16-
'/starter-kit#lets-begin':
17-
'the "Let\'s Begin" section of the Starter Kit (Hacking 101 intro)',
18-
'/starter-kit#find-a-team': 'the "Find a Team" section of the Starter Kit',
25+
'/starter-kit#introduction':
26+
'the "Introduction" section of the Starter Kit (field guide to the weekend)',
27+
'/starter-kit#team-building':
28+
'the "Team Building" section of the Starter Kit (Team Mixer, Discord team-formation channel)',
1929
'/starter-kit#ideate':
20-
'the "Ideate" section of the Starter Kit (brainstorming, previous hacks)',
21-
'/starter-kit#resources':
22-
'the "Resources" section of the Starter Kit (developer/designer/mentor resources)',
30+
'the "Ideate" section of the Starter Kit (brainstorming principles, previous winning hacks)',
31+
'/starter-kit#design-resources':
32+
'the "Design Resources" section of the Starter Kit (designer responsibilities, Figma tips, plugins)',
33+
'/starter-kit#dev-resources':
34+
'the "Dev Resources" section of the Starter Kit (developer responsibilities, MLH starter kits for MongoDB and Auth0)',
35+
'/starter-kit#more-tips':
36+
'the "More Tips" section of the Starter Kit (last-minute tips for the weekend)',
2337
'/schedule': 'the Schedule page',
2438
};
2539

app/(api)/api/hackbot/stream/route.ts

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,39 @@ function normalizeGetEventsInputForQuery(input: any, query: string): any {
3636
const q = query.trim().toLowerCase();
3737
if (!q) return input;
3838

39-
const asksForWorkshops = /\bworkshops?\b/.test(q);
40-
if (!asksForWorkshops) return input;
41-
4239
// If the user explicitly asks for workshops, enforce WORKSHOPS so
4340
// generic schedule items (e.g. "Hacking Ends") are not returned.
44-
return {
45-
...input,
46-
type: 'WORKSHOPS',
47-
};
41+
if (/\bworkshops?\b/.test(q)) {
42+
return { ...input, type: 'WORKSHOPS' };
43+
}
44+
45+
// For meal queries, clamp to MEALS type, suppress activities, and inject
46+
// a specific search term so only the relevant meal is returned.
47+
if (
48+
/\b(lunch|brunch|dinner|breakfast|food|meal|eat|eating|snack)\b/.test(q)
49+
) {
50+
const specificMeal = /\blunch\b/.test(q)
51+
? 'lunch'
52+
: /\bbrunch\b/.test(q)
53+
? 'brunch'
54+
: /\bdinner\b/.test(q)
55+
? 'dinner'
56+
: /\bbreakfast\b/.test(q)
57+
? 'breakfast'
58+
: /\bsnack\b/.test(q)
59+
? 'snack'
60+
: null;
61+
62+
return {
63+
...input,
64+
type: 'MEALS',
65+
include_activities: false,
66+
// Only override search if the model didn't already provide a tighter one
67+
...(specificMeal && !input.search ? { search: specificMeal } : {}),
68+
};
69+
}
70+
71+
return input;
4872
}
4973

5074
export async function POST(request: Request) {
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
// import { auth } from '@/auth';
1+
import { auth } from '@/auth';
22
import ProtectedDisplay from '@components/ProtectedDisplay/ProtectedDisplay';
33
import Navbar from '@components/Navbar/Navbar';
4-
// import HackbotWidgetWrapper from '../_components/Hackbot/HackbotWidgetWrapper';
4+
import HackbotWidgetWrapper from '../_components/Hackbot/HackbotWidgetWrapper';
5+
import { HackerProfile } from '@typeDefs/hackbot';
56

67
export default async function Layout({
78
children,
89
}: {
910
children: React.ReactNode;
1011
}) {
11-
// const session = await auth();
12-
// const u = session?.user as any;
13-
// const profile: HackerProfile | null = u
14-
// ? {
15-
// name: u.name ?? undefined,
16-
// position: u.position ?? undefined,
17-
// is_beginner: u.is_beginner ?? undefined,
18-
// }
19-
// : null;
12+
const session = await auth();
13+
const u = session?.user as any;
14+
const profile: HackerProfile | null = u
15+
? {
16+
name: u.name ?? undefined,
17+
position: u.position ?? undefined,
18+
is_beginner: u.is_beginner ?? undefined,
19+
}
20+
: null;
2021

2122
return (
2223
<ProtectedDisplay
@@ -25,7 +26,7 @@ export default async function Layout({
2526
>
2627
<Navbar />
2728
{children}
28-
{/* <HackbotWidgetWrapper initialProfile={profile} /> */}
29+
<HackbotWidgetWrapper initialProfile={profile} />
2930
</ProtectedDisplay>
3031
);
3132
}

0 commit comments

Comments
 (0)