ELNOR REPO READER TEXT MIRROR Original path: Design Mockups/Archived Mockups/DOC20 Mockups and Design/DOC20 Archived Mockups/DOC20 Workspace Redo/Q_WORKSPACE_V4_alt1.jsx Source repo: /Users/OpenClaw1/Elnor/Elnor Specs Git branch: main Git commit: dbaa25962edc11ab30e8d4ca1715f9ae5bf77331 Generated: 2026-06-09T01:23:58.539Z --- import { useState, useRef, useCallback, useEffect } from "react"; // ═══ TOKENS + ICONS + COMPONENTS — verbatim from Q_NOTES_FULL ═══ const font={sans:"'Söhne','Helvetica Neue',-apple-system,BlinkMacSystemFont,sans-serif"}; const R={sm:"6px",md:"10px",full:"9999px"}; const c={bgApp:"#F8F8F6",bgPanel:"#FFFFFF",bgPanelAlt:"#F9FAFB",bgCard:"#FFFFFF",bgInput:"#EFF1F3",bgSidebar:"#131820",textPri:"#1A1D21",textSec:"#5E6570",textTer:"#8B919A",accentBtn:"#31588c",warn:"#D97706",error:"#B04040",border:"#E0E2E5",borderLight:"#ECEEF0",green:"#2E8B57",agentAv:"#a1a7aa",borderDark:"#263040"}; const Ic=({d,size=18,color,sw=1.75})=>; const I={Plus:p=>,X:p=>,Check:p=>,Pin:p=>,Spark:p=>,MsgCircle:p=>,ChevD:p=>,ChevR:p=>,Search:p=>,Maximize:p=>,Save:p=>,Copy:p=>,Link:p=>,Eye:p=>,Edit:p=>,Undo:p=>,Redo:p=>,Folder:p=>,FileText:p=>,Trash:p=>,Archive:p=>,Settings:p=>,List:p=>,Bell:p=>,Calendar:p=>,Mail:p=>,Zap:p=>,Sun:p=>,}; const Dot=({color,size=8})=>; const Btn=({children,primary,ghost,small,onClick,disabled,style:s})=>; const Av=({letter,color,size=20})=>
{letter}
; const TBtn=({icon,title,active,onClick,label,dropdown})=>; const Sep=()=>
; const Toast=({msg,onDone})=>{useEffect(()=>{const t=setTimeout(onDone,2200);return()=>clearTimeout(t)},[onDone]);return
{msg}
}; const DItem=({children,onClick,active})=>; // ═══ DATA ═══ const tcColors={You:{del:c.accentBtn,ins:c.accentBtn},Elnor:{del:"#B04040",ins:"#2E8B57"}}; const agents=[{name:"Elnor",color:c.agentAv,letter:"E"},{name:"Scout",color:"#5B5F97",letter:"S"}]; // To-Do items (rendered as checkboxes in the note) const initTasks=[ {id:"t1",text:"Draft expert disclosure for Christensen",done:false,pri:1,due:"Apr 4",link:"Expert Depo Prep",sub:[{id:"s1",text:"Pull Christensen CV",done:true},{id:"s2",text:"List opinions to be offered",done:false},{id:"s3",text:"Identify documents reviewed",done:false}]}, {id:"t2",text:"Review Henderson MSJ brief — Elnor's tracked changes",done:false,pri:1,due:"Mar 20",link:"Henderson Discovery Priorities"}, {id:"t3",text:"Respond to Sparacino re: Narayanan agreement",done:false,pri:2,due:"Mar 19"}, {id:"t4",text:"Follow up: opposing counsel on discovery extension",done:false,pri:2,due:"Mar 19"}, {id:"t5",text:"Review Quark patent analysis — new filings",done:false,pri:3,link:"Quark Patent Analysis"}, {id:"t6",text:"File Folb trial exhibit list",done:true,pri:2,due:"Mar 17"}, ]; // Inline thread data const initThreads=[ {id:"th1",collapsed:false,contextQuote:"opposing counsel on discovery extension",messages:[ {id:"m1",author:"You",color:c.accentBtn,body:"@Elnor draft a response declining the extension, cite the scheduling order deadline and the prejudice from further delay",time:"45m ago"}, {id:"m2",author:"Elnor",color:c.agentAv,body:"Draft ready. Key points: scheduling order set discovery cutoff March 28, extension would prejudice plaintiff's expert disclosure timeline, defendant has had 4 months to complete discovery. I've included the exact order language. Want me to open it in a new note or paste below?",time:"40m ago"}, ]}, ]; // ═══════════════════════════════════════════ export default function WorkspaceV4Alt1(){ const idC=useRef(300);const nid=()=>"x"+(++idC.current); // Panel toggles const [browserOpen,setBrowserOpen]=useState(true); const [noteListOpen,setNoteListOpen]=useState(true); const [commentsOpen,setCommentsOpen]=useState(false); const [rightTab,setRightTab]=useState("comments"); // Editor const [bubbleMenu,setBubbleMenu]=useState(null); const [findBar,setFindBar]=useState(false); const [fullScreen,setFullScreen]=useState(false); const [openDrop,setOpenDrop]=useState(null); const [toast,setToast]=useState(null); const [agentIdx]=useState(0); // Today note const [tasks,setTasks]=useState(initTasks); const [expandedTask,setExpandedTask]=useState(null); const [threads,setThreads]=useState(initThreads); const [threadReplyId,setThreadReplyId]=useState(null); const [threadReplyText,setThreadReplyText]=useState(""); const [briefSections,setBriefSections]=useState({elnor:true,calendar:true,email:true,system:true,news:false}); const editorRef=useRef(null); const agent=agents[agentIdx]; const flash=msg=>setToast(msg); const activeTasks=tasks.filter(t=>!t.done); const doneTasks=tasks.filter(t=>t.done); const priColor=p=>p===1?c.error:p===2?c.warn:c.accentBtn; const priLabel=p=>p===1?"P1":p===2?"P2":"P3"; const toggleTask=id=>setTasks(p=>p.map(t=>t.id===id?{...t,done:!t.done}:t)); const toggleSub=(pid,sid)=>setTasks(p=>p.map(t=>t.id===pid?{...t,sub:t.sub.map(s=>s.id===sid?{...s,done:!s.done}:s)}:t)); const toggleThread=id=>setThreads(p=>p.map(t=>t.id===id?{...t,collapsed:!t.collapsed}:t)); const addThreadReply=(tid)=>{if(!threadReplyText.trim())return;setThreads(p=>p.map(t=>t.id===tid?{...t,messages:[...t.messages,{id:nid(),author:"You",color:c.accentBtn,body:threadReplyText.trim(),time:"just now"}]}:t));setThreadReplyId(null);setThreadReplyText("")}; const toggleBrief=key=>setBriefSections(p=>({...p,[key]:!p[key]})); // Bubble menu (from Q_NOTES_FULL) const handleMouseUp=useCallback(e=>{if(e.target.closest("[data-bubble]"))return;const sel=window.getSelection();if(!sel||sel.isCollapsed||!sel.toString().trim()){setBubbleMenu(null);return}const text=sel.toString().trim();if(text.length<3)return;const rect=sel.getRangeAt(0).getBoundingClientRect();const er=editorRef.current?.getBoundingClientRect();if(!er)return;setBubbleMenu({x:rect.left-er.left+rect.width/2,y:rect.top-er.top-8,text})},[]); const dismissBubble=()=>{setBubbleMenu(null);window.getSelection()?.removeAllRanges()}; // ─── Inline Thread Component ─── const InlineThread=({th})=>{ if(th.collapsed) return (
toggleThread(th.id)} style={{margin:"8px 0",padding:"7px 12px",borderRadius:R.sm,border:`1px solid ${c.borderLight}`,backgroundColor:c.bgPanelAlt,cursor:"pointer",display:"flex",alignItems:"center",gap:8}} onMouseEnter={e=>e.currentTarget.style.borderColor=c.accentBtn+"40"} onMouseLeave={e=>e.currentTarget.style.borderColor=c.borderLight}> Elnor · {th.messages.length} messages {th.messages[th.messages.length-1]?.time}
); return (
toggleThread(th.id)} style={{padding:"5px 12px",display:"flex",alignItems:"center",gap:6,cursor:"pointer",backgroundColor:c.accentBtn+"06",borderBottom:`1px solid ${c.accentBtn}15`}}> Thread · {th.messages.length} {th.contextQuote&&re: "{th.contextQuote}"}
{th.messages.map((msg,i)=>
{msg.author} {msg.time} {msg.author==="You"&&<>{e.stopPropagation();flash("Edit…")}}>edit{e.stopPropagation();flash("Delete…")}}>delete}
{msg.body}
)} {threadReplyId===th.id?