diff --git a/apps/web/components/add-document/index.tsx b/apps/web/components/add-document/index.tsx index 4c441ce1..95b68365 100644 --- a/apps/web/components/add-document/index.tsx +++ b/apps/web/components/add-document/index.tsx @@ -5,7 +5,7 @@ import { useQueryState } from "nuqs" import { Dialog, DialogContent, DialogTitle } from "@repo/ui/components/dialog" import { cn } from "@lib/utils" import { dmSansClassName } from "@/lib/fonts" -import { FileTextIcon, GlobeIcon, ZapIcon, Loader2 } from "lucide-react" +import { FileTextIcon, GlobeIcon, ZapIcon, Loader2, XIcon } from "lucide-react" import { Button } from "@ui/components/button" import { ConnectContent } from "./connections" import { NoteContent } from "./note" @@ -35,10 +35,10 @@ export function AddDocumentModal({ isOpen, onClose }: AddDocumentModalProps) { !open && onClose()}> Add Document -
+
@@ -259,19 +259,44 @@ export function AddDocument({ activeTab === "file" && (!fileTabHasPending || isSubmitting) return ( -
+
+ {isMobile && ( +
+
+

+ Add memory +

+

+ Save something to recall later +

+
+ +
+ )}
{tabs.map((tab) => ( @@ -288,6 +313,31 @@ export function AddDocument({ ))}
+ {isMobile && ( +
+ + +
+ )} + {!isMobile && (
@@ -414,11 +464,11 @@ export function AddDocument({
-
+
{activeTab === "note" && (
{!isMobile && ( @@ -467,13 +519,19 @@ export function AddDocument({ /> )}
@@ -484,6 +542,7 @@ export function AddDocument({ disabled={ activeTab === "file" ? fileTabSubmitDisabled : isSubmitting } + className={cn(isMobile && "h-11 min-w-[8rem] px-5")} > {isSubmitting ? ( <> @@ -514,6 +573,53 @@ export function AddDocument({ ) } +function UsageMeter({ + label, + value, + percent, + active, +}: { + label: string + value: string + percent: number + active: boolean +}) { + const safePercent = Math.max(0, Math.min(100, percent)) + + return ( +
+
+ + {label} + + + {value} + +
+
+
80 + ? "#ef4444" + : active + ? "linear-gradient(to right, #4BA0FA 80%, #002757 100%)" + : "#0054AD", + }} + /> +
+
+ ) +} + function TabButton({ active, onClick, @@ -537,19 +643,24 @@ function TabButton({ type="button" onClick={onClick} className={cn( - "flex items-center gap-2 px-3 py-2 rounded-full text-left transition-colors whitespace-nowrap focus:outline-none focus:ring-0 shrink-0", - active ? "bg-[#14161A] shadow-inside-out" : "hover:bg-[#14161A]/50", + "relative flex h-14 min-w-0 flex-col items-center justify-center gap-1 rounded-xl px-1 text-center transition-colors focus:outline-none focus:ring-0", + active + ? "bg-[#0F141B] text-white shadow-inside-out ring-1 ring-[#2261CA33]" + : "text-[#8B8B8B] hover:bg-[#14161A]/50", dmSansClassName(), )} > - + {title.split(" ")[0]} {isPro && ( - + PRO )} diff --git a/apps/web/components/add-document/note.tsx b/apps/web/components/add-document/note.tsx index 4f833ca2..aa0fac97 100644 --- a/apps/web/components/add-document/note.tsx +++ b/apps/web/components/add-document/note.tsx @@ -40,11 +40,12 @@ export function NoteContent({ }, [isOpen, onContentChange]) return ( -
+
) diff --git a/apps/web/components/mobile-banner.tsx b/apps/web/components/mobile-banner.tsx index 0f3153b3..245b6952 100644 --- a/apps/web/components/mobile-banner.tsx +++ b/apps/web/components/mobile-banner.tsx @@ -1,3 +1,24 @@ +"use client" + +import { useIsMobile } from "@hooks/use-mobile" +import { cn } from "@lib/utils" + export function MobileBanner() { - return null + const isMobile = useIsMobile() + + if (!isMobile) { + return null + } + + return ( +
+ 🚧 Mobile responsive in development. Desktop recommended. +
+ ) } diff --git a/apps/web/components/text-editor/index.tsx b/apps/web/components/text-editor/index.tsx index 18de5893..71771e49 100644 --- a/apps/web/components/text-editor/index.tsx +++ b/apps/web/components/text-editor/index.tsx @@ -17,10 +17,12 @@ export function TextEditor({ content: initialContent, onContentChange, onSubmit, + debounceMs = 500, }: { content: string | undefined onContentChange: (content: string) => void onSubmit: () => void + debounceMs?: number }) { const containerRef = useRef(null) const editorRef = useRef(null) @@ -36,7 +38,7 @@ export function TextEditor({ const json = editor.getJSON() const markdown = editor.storage.markdown?.manager?.serialize(json) ?? "" onContentChange?.(markdown) - }, 500) + }, debounceMs) const editor = useEditor({ extensions, @@ -48,6 +50,13 @@ export function TextEditor({ }, onUpdate: ({ editor }) => { editorRef.current = editor + if (!hasUserEditedRef.current) return + if (debounceMs === 0) { + const json = editor.getJSON() + const markdown = editor.storage.markdown?.manager?.serialize(json) ?? "" + onContentChange?.(markdown) + return + } debouncedUpdates(editor) }, editorProps: { @@ -120,7 +129,7 @@ export function TextEditor({ tabIndex={0} ref={containerRef} onClick={handleClick} - className="w-full h-full outline-none prose prose-invert max-w-none [&_.ProseMirror]:outline-none [&_.ProseMirror]:focus:outline-none [&_.ProseMirror-focused]:outline-none text-editor-prose cursor-text" + className="h-full w-full cursor-text outline-none prose prose-invert max-w-none text-editor-prose [&_.ProseMirror]:min-h-full [&_.ProseMirror]:outline-none [&_.ProseMirror]:text-[15px] [&_.ProseMirror]:leading-6 [&_.ProseMirror]:text-[#D7DEE8] [&_.ProseMirror-focused]:outline-none [&_.ProseMirror]:focus:outline-none" >