All MicroEvals
IDEAS SECTION — COMPLETE REFERENCE (v3.x codebase) 1. File M...
Create MicroEval
Header image for IDEAS SECTION — COMPLETE REFERENCE (v3.x codebase)
1. File M...

IDEAS SECTION — COMPLETE REFERENCE (v3.x codebase) 1. File M...

Prompt

IDEAS SECTION — COMPLETE REFERENCE (v3.x codebase) 1. File Map File Role resources/app/src/components/IdeasView.jsx The main Ideas section (2,498 lines, single component) resources/app/src/components/IdeaMindView.jsx Fullscreen per-idea mind-map overlay (wraps the MIND engine) resources/app/src/features/mind/ The actual mind-map engine: MindCanvas.jsx, store.js (zustand), exportUtils.js, Toolbar.jsx, Sidebar.jsx, nodes/* resources/app/src/App.jsx Tab registration, lazy-load, error boundary wrapper resources/app/src/components/ViewErrorBoundary.jsx Crash recovery (name="IdeasView", owns key 'staff_ideas') resources/app/src/index.css Zero Ideas-specific classes (confirmed by grep) — everything is inline styles + a local <style> block Important: there is no dedicated CSS file. All styling = inline style={{}} + one scoped <style> block inside IdeasView's JSX + shared classes (glass-panel, modal-overlay, modal-content, form-input) + Tiptap/notes classes (notes-modal-input, notes-modal-submit, canvas-node-tiptap). 2. Data Model & Persistence (localStorage keys) All via the component's own usePersistentState hook (lazy JSON.parse init, write-on-change): Key Shape staff_ideas Array of idea objects (main data) staff_board_templates Array of board template names (10 defaults) staff_ideas_custom_quote String quote ignored_duplicate_pairs Array of "idA_idB" pair keys staff_idea_groups {id:'g_'+ts, name, color} staff_idea_order Array of idea ids (manual sort) staff_passion_items {id: ts+random, text, createdAt} staff_wisdom_items {id: ts+random, text, createdAt} Idea object shape: js Copy { id: Date.now() + Math.random(), title, description (HTML string), columnId: 'three_signals' | 'pending' | 'ideas_pool', status: 'Critical'|'High'|'Medium'|'Low', tags: [], groupId: null | groupId, deadline: null | ISO datetime, createdAt, updatedAt, mindMap: { nodes:[], edges:[] } // ← saved by IdeaMindView } Seeded defaults: a Steve Jobs focus quote (Critical, 3 Signals) + "Explore Youtube automation strategies" (High, Ideas Pool). Props (App.jsx ~3165): <IdeasView gainExp={gainExp} todos={todos} setTodos={setTodos} />. Wrapped in <ViewErrorBoundary name="IdeasView" label="Ideas section crashed">. Tab config (App.jsx ~1047): { id: 'ideas', label: 'Ideas', icon: 'Lightbulb', emoji: '💡', color: '#fbbf24' } — amber Lightbulb in every theme. Lazy-loaded at line 35. 3. Layout / HTML Structure text Copy <div flex column, height 100%, overflow hidden> ├─ <style> block (scoped CSS): │ .ideas-select option (dark dropdown) │ @keyframes dangerBlink + .danger-blink-btn (Duplicates button pulses red) │ @keyframes ideas-stroke-erratic/mid-blink/blue-blink + classes (SVG border animations) │ .wisdom-item:hover .wisdom-actions { opacity:1 !important } │ ├─ TOP HEADER (border-bottom): │ Left: 💡 Lightbulb (amber, drop-shadow glow) + INLINE BACKLOG GROUPS BAR: │ [All (n)] pill + one pill per group (colored dot/border, click filter, ✕ delete) │ [+ Group] dashed button → inline form: name input + 6 color dots (#c084fc #38bdf8 │ #10b981 #f59e0b #ef4444 #a8a29e) + Add/✕ │ Center: Custom Quote (italic, bordered left+right, click-to-edit inline input, Enter/blur saves) │ Right: Sort select (Manual/Modified newest|oldest/Alphabetical A-Z|Z-A) · │ ⚠ Duplicates (n) button (danger-blink when n>0) · 🔍 Search (supports #tag search) │ │ → Conditionally: FULLSCREEN IDEA MIND MAP (position absolute inset 0, zIndex 100) │ → Duplicates Resolution Modal (modal-overlay, 620px, glass-panel #070709): │ list of duplicate pairs; each = Card A vs Card B (title, stripped desc, column, │ Delete Card A / Delete Card B) + [Not a Duplicate (Ignore Pair)] → Done button │ ├─ KANBAN ROW (flex, overflowX auto, height calc(100vh - 130px), min 500px): │ ┌ Col 1: 3 SIGNALS (white dot, "n/10" pill, Lock icon, limit 10) │ │ quick-add input + cards + "▶ ACTIVE" pill overlay (click → move to pending) │ ├ Col 2: PENDING (amber #f59e0b, count pill) │ │ quick-add + cards (opacity 0.75) + "⏸ PENDING" pill (click → move to 3 Signals) │ ├ Col 3: IDEAS sub-column A (purple #a78bfa dot, count pill) + quick-add │ ├ Col 4: IDEAS sub-column B (same header; pool split round-robin between the two) │ ├ Col 5: PASSION & LEARNING (pink #ec4899): quick-add + cards (drag handle, hover delete) │ └ Col 6: RULES & WISDOM (purple #a855f7): quick-add + items with hover actions │ ▲ ▼ ✏️ 🗑️ (move up/down/edit/delete; inline edit with Save; Enter saves, Esc cancels) │ ├─ EDIT MODAL ("💡 Idea details & notes", 680px, glass-panel-dark animate-slide-up): │ Idea Name input · Tiptap rich-text editor (320px, Highlight multicolor) · │ Vault Section select (3 Signals (Max 10) / Ideas) · Importance Status select (4 levels) · │ Idea Group select · Signal Deadline (datetime-local) · Created/Updated timestamps (fmtFullPK) · │ [Cancel] [Save Changes] │ ├─ MERGE MODAL (purple glow, 420px): "⬅ Will be absorbed" (source, red) · ⬇ · │ "➡ Will remain" (target, purple) · green "Merge result" preview ("target + source") · │ [Swap] [Cancel] [Merge] │ └─ STEVE JOBS WARNING MODAL (red, 380px): AlertTriangle, "Focus on 3 Signals", Jobs quote + "You already have 10 items in 3 Signals Today" · [Got it] Idea card (renderIdeaCard, defined at the bottom of the component, uses function hoisting): text Copy draggable card (grab cursor, #070709 bg, rounded, shadow) ├─ SVG priority border overlay (renderSvgBorder): rail rect + animated glowing rect │ Critical: white, 1.8w, .stroke-erratic (1s) | High: red #ef4444, .stroke-mid-blink │ Medium: cyan #00d2ff, .stroke-blue-blink | Low: static faint white │ (SVG filters ideas-*-glow via feGaussianBlur+feMerge) ├─ header row (paddingRight 22 for delete btn): GripVertical handle · [✏ Pen edit btn (hover)] │ title · ▲▼ move buttons (only in Manual sort) · status pill (CLICKABLE → cycles Low→Medium │ →High→Critical via cycleStatus) · group pill (colored) · deadline badge · "Canvas (n)" badge ├─ 2-line excerpt (stripHtml of description, -webkit-line-clamp:2) └─ 🗑 delete button (absolute top-right, hover-visible) 4. Core Logic Drag & Drop system (HTML5 native): Card drag: handleDragStart sets dataTransfer text + draggedIdeaId. Drop on card → opens Merge modal (source = dragged, target = hovered card). Hovered card gets purple glow (rgba(192,132,252,0.12) bg). Drop on column → moveIdeaToColumn (with 3-Signals 10-item limit check → Jobs modal). Card-to-card drop: handleCardDrop (e.preventDefault + stopPropagation). Global dragend listener cleans all drag states + removes window.__dragGhost. Move column logic (moveIdeaToColumn): normalizes ideas_pool_0/_1 → ideas_pool; early-returns if same column; if target = three_signals and count ≥ 10 → setJobsAlert; else update columnId + updatedAt, toast Moved "x" to {3 Signals|Pending|Ideas}. 3-Signals limit: enforced on quick-add, drag-drop, and edit-modal column change (only when moving into 3 Signals). Merge (handleMergeIdeas): target keeps its column/position; title = target.title + " + " + source.title; description = target + "\n\n---\n\n" + source; tags = deduped union; updatedAt bumped; source removed from list AND from ideaOrder. Swap (handleSwapPositions): exchanges columnId between source & target (count-preserving, so no limit check needed) and swaps their positions in ideaOrder. Sorting (sortedIdeas): Manual → position in ideaOrder (unknown ids sink to bottom); Alphabetical → localeCompare asc/desc; Modified → updatedAt || createdAt asc/desc. Search (filteredIdeas): query starting with # = tag-only search; otherwise matches title / description / status / tags (case-insensitive). Duplicate detection (duplicateGroups): O(n²) pair scan; stopwords set; normalize titles (strip punctuation, filter words ≥3 chars, drop stopwords); duplicates if titles identical OR ≥3 common significant words; skipped if pair key in ignored_duplicate_pairs; pair key = min_id_max_id (works with numeric+string mix? — note idA < idB uses < so mixed numeric/string comparisons may be flaky). Quick-add (handleQuickAddSubmit): builds new idea {id: Date.now()+Math.random(), columnId, status:'Medium', groupId: (ideas_pool && activeGroupFilter) || null, deadline:null, createdAt, updatedAt}; prepends to ideas + ideaOrder; toasts "New idea captured!". Status cycling: cycleStatus — Low → Medium → High → Critical → Low. Clicking the pill mutates the idea's status directly (with updatedAt bump). Tag helpers: extractTags (regex ##([a-zA-Z0-9_\-]+) on titles) and removeTagMarkup are defined but not called anywhere in the rendered path (legacy utilities); tags in the UI come from the tags field, seeded via edit modal only implicitly (edit modal does NOT expose tags editing — tags only exist on seeded ideas). Deadline badge (renderDeadlineBadge): overdue → red "Overdue by Xh/Xd"; <24h left → amber "Xh left"; else neutral "Xd left"; title tooltip shows formatted date. Passion items: quick-add only + confirm delete; drag handle is decorative (no reorder logic). Wisdom items: quick-add (Enter submits form), move up/down (swap in array), inline edit (Enter save / Esc cancel), delete with window.showConfirm. Toasts: all via window.dispatchEvent(new CustomEvent('show-toast', {detail:{message, type}})). Tiptap editor (IdeaDescriptionEditor): StarterKit + multicolor Highlight; onUpdate pushes getHTML(); syncs external value changes; registers itself on window.activeTiptapEditor on focus (for the global selection formatter). stripHtml: DOMParser-based, used for card excerpts and merge/duplicate modal previews. 5. IdeaMindView — the per-idea Mind Map (its own full engine) Purpose: reuses the app's MIND section engine (features/mind/MindCanvas) inside the Ideas tab, with isolated per-idea state so it never clobbers the main MIND data. State isolation mechanics (critical to understand): On mount: lockAutoSave() (sets a module-level flag in store.js so the zustand store's auto-save is disabled), snapshots the entire store (maps, activeMapId, zoom/pan, toggles), then replaces the store with a single synthetic map { id: -Math.abs(Number(idea.id)||Date.now()), name: idea.title, nodes/edges from idea.mindMap }. Saves idea data via the onSaveMindMap(ideaId, {nodes, edges}) callback → stored on the idea as mindMap. Auto-save every 5s (only if hasMapDataChanged deep-compare vs last snapshot) so nodes survive refresh even without clicking Back. On close/unmount: saves if not already saved via close, restoreStore(savedStateRef.current) (restores the previous MIND state incl. main maps), and unlockAutoSave(). beforeunload handler also flushes data. Also captured: undo/redo stacks are cleared on both restore and load (so idea editing never pollutes the main map's history). Toolbar (38px header bar): Back button · Brain icon + idea title · Undo/Redo (disabled when stacks empty) · Zoom − / % / + (clamps 0.15–3, uses react-flow internal __rf.getViewport) · Fit to screen · Auto-layout · Grid toggle · Minimap toggle · Search toggle · Save status chip (green Saved / amber Saving / red Error, derived from store reference changes + 800ms debounce) · n nodes · e edges count · Export menu (PNG / SVG / JSON + Import JSON) · Share menu (copies window.location.href). Export/import: exportPNG/exportSVG/exportJSON/importJSON from ../features/mind/exportUtils. Dependencies: MindCanvas (renders the React Flow canvas with hideToolbar), useMindStore (zustand), lockAutoSave/unlockAutoSave. 6. CSS Reference No Ideas classes in index.css (verified by grep). Everything is: Inline styles (90%+): hard-coded hex + rgba values on every element. Scoped <style> block inside the component: .ideas-select option (dark dropdown), 3 stroke-blink keyframes + .stroke-erratic/.stroke-mid-blink/.stroke-blue-blink, dangerBlink + .danger-blink-btn, .wisdom-item:hover .wisdom-actions. Shared classes: glass-panel / glass-panel-dark (frosted blur, radius-xl, top gradient overlay), modal-overlay (fixed, blur), modal-content, animate-slide-up (500ms slideUp), notes-modal-input, notes-modal-submit, cv-sb (custom scrollbar), canvas-node-tiptap (Tiptap wrapper class). Color system: Lightbulb/amber #fbbf24 (brand) · 3 Signals white · Pending amber #f59e0b/#fbbf24 · Ideas pool purple #a78bfa · Passion pink #ec4899 · Wisdom violet #a855f7/#9333ea · status: Critical white, High red #ef4444/#f87171, Medium cyan #38bdf8/#00d2ff, Low faint white · groups palette #c084fc #38bdf8 #10b981 #f59e0b #ef4444 #a8a29e · merge purple #c084fc, green #34d399/#10b981. Keyframes: 1s infinite stroke-opacity blink per status; dangerBlink 1.2s scale/opacity pulse; plus shared slideUp, fadeIn from index.css. 7. Integrations & Gotchas (for your discussion) gainExp and todos/setTodos are passed but unused in IdeasView — the props are wired in App.jsx but the component never calls them (dead props). mindMap vs canvasData: IdeaMindView saves to idea.mindMap, but the card's "Canvas (n)" badge reads idea.canvasData?.nodes — so that badge likely never shows unless another path writes canvasData (possible stale/legacy field). ideaOrder seeding: on mount, if empty, it fills with all idea ids (only when localStorage truly empty) — manual sort gets a stable baseline. Board templates (staff_board_templates) are loaded and editable-state exists (editingTemplateIdx, etc.) but the UI/render for them appears incomplete — no visible template dropdown was found in the rendered JSX (potential dead feature). Duplicate pair key uses < on mixed id types — seeded ideas have numeric ids (1, 2) while new ideas are floats; the < comparison still works for numbers, but any string ids would make ordering inconsistent. Delete in 3 Signals / Pending is via the hover trash; deleting removes from ideas and ideaOrder but does NOT restore anything to the pool. Status cycle has no toast (unlike move), and no updatedAt bump on duplicate-delete (filter only) — minor consistency notes. The board container height is calc(100vh - 130px) with horizontal scroll for 6 columns; columns have minWidth 250 / maxWidth 320. Jobs modal text is the "Focus on 3 Signals" guard — appears on the 11th item attempt (count ≥ 10). Edit modal's Vault select omits pending as an option (you can't move an idea to Pending from the modal — only via drag or the ACTIVE/PENDING pills). Your goal is only to redesign and improve overall fucntioanlity and logics and overall experience of the app. Best possible on your end.