Skip to content
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

fix: small bugs #159

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const ChatLayout = ({ className }: Readonly<ChatLayoutProps>) => {
isDemoLocked={isDemoLocked}
showLessonMobile={showLessonMobile}
setShowLessonMobile={setShowLessonMobile}
isDemoUser={demo.isDemoUser}
/>
<ChatRightHandSideLesson
id={id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type ChatLeftHandSideProps = {
isDemoLocked: boolean;
showLessonMobile: boolean;
setShowLessonMobile: (value: boolean) => void;
isDemoUser: boolean;
};

const ChatLeftHandSide = ({
Expand All @@ -23,6 +24,7 @@ const ChatLeftHandSide = ({
isDemoLocked,
showLessonMobile,
setShowLessonMobile,
isDemoUser,
}: Readonly<ChatLeftHandSideProps>) => {
return (
<Flex
Expand All @@ -35,6 +37,7 @@ const ChatLeftHandSide = ({
<ChatLhsHeader
setShowLessonMobile={setShowLessonMobile}
showLessonMobile={showLessonMobile}
isDemoUser={isDemoUser}
/>
<div>
<ChatPanelArea chatAreaRef={chatAreaRef} isDemoLocked={isDemoLocked}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ import ChatButton from "./ui/chat-button";
type ChatLhsHeaderProps = {
setShowLessonMobile: (value: boolean) => void;
showLessonMobile: boolean;
isDemoUser: boolean;
};

const ChatLhsHeader = ({
setShowLessonMobile,
showLessonMobile,
isDemoUser,
}: Readonly<ChatLhsHeaderProps>) => {
const router = useRouter();

return (
<>
<div className="mt-6 hidden items-center justify-end gap-5 sm:flex">
Expand All @@ -34,7 +37,9 @@ const ChatLhsHeader = ({
className="flex items-center gap-5"
>
<AiIcon />{" "}
<span className="text-base font-bold">View lesson &gt;</span>
<span className={`text-base font-bold ${isDemoUser && `mt-24`}`}>
View lesson &gt;
</span>
</button>
</div>
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useCallback, useState, useEffect, useRef } from "react";
import Textarea from "react-textarea-autosize";

import { UseChatHelpers } from "ai/react";

Expand Down Expand Up @@ -109,7 +108,7 @@ export function PromptForm({
<div
className={`${!shouldAllowUserInput ? "hidden" : "flex"} relative max-h-60 w-full grow flex-col overflow-hidden rounded-md border-2 border-black bg-white pr-20 sm:flex`}
>
<Textarea
<textarea
data-testid="chat-input"
ref={inputRef}
tabIndex={0}
Expand Down
6 changes: 4 additions & 2 deletions apps/nextjs/src/components/DownloadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ export const DownloadButton = ({
>
<Icon icon="download" size="sm" />
<div className="flex flex-col gap-6">
<span className="text-left font-bold">Download {title} (.pdf)</span>
<span className="text-left font-bold">
Download {title.toLowerCase()} (.pdf)
</span>
<span className="text-left opacity-80">All sections</span>
</div>
</Link>
Expand Down Expand Up @@ -130,7 +132,7 @@ export const DownloadButton = ({
{handleSendEmailIcon({ isSuccess, isLoading, isError })}
<div className="flex flex-col gap-6">
<span className="text-left font-bold">
Email me {ext === "docx" ? `doc` : `slides`}{" "}
Email me {ext === "docx" ? `gdoc` : `gslides`}{" "}
{isSuccess && `- Email sent`}{" "}
{isError && `- There was an error sending the email!`}
</span>
Expand Down
2 changes: 1 addition & 1 deletion packages/aila/src/protocol/sectionToMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function sectionToMarkdown(
if (key.includes("cycle")) {
try {
const cycle = CycleOptionalSchema.parse(value);
const content = `## ${cycle.title ?? "…"}\n\n**${cycle.durationInMinutes ?? "…"} minutes**\n\n`;
const content = `## ${cycle.title ?? "…"}\n\n`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

🫢

return `${content}\n\n### Explanation\n\n${sectionToMarkdown("explanation", cycle.explanation ?? "…")}\n\n### Check for Understanding\n\n${cycle.checkForUnderstanding ? organiseAnswersAndDistractors(cycle.checkForUnderstanding) : "…"}\n\n### Practice\n\n${cycle.practice ?? "…"}\n\n### Feedback\n\n${cycle.feedback ?? "…"}`;
} catch (e) {
// Invalid schema
Expand Down
2 changes: 1 addition & 1 deletion packages/exports/src/exportDocsWorksheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const exportDocsWorksheet = async ({
const templateId = getDocsTemplateIdWorksheet();

const result = await exportGeneric({
newFileName: `${inputData.title} - ${snapshotId} - Worksheet slides`,
newFileName: `${inputData.title} - ${snapshotId} - Worksheet docs`,
data: inputData,
prepData: prepWorksheetForSlides,
templateId,
Expand Down
Loading