Spaces:
Paused
Paused
Savestate: Implement 3D Isometric Detective Board UI, fix mobile report formatting, increase report length constraint
Browse files- docs/superpowers/specs/2026-07-20-detective-board-design.md +48 -0
- index.html +22 -2
- src/ai/research-agent.js +11 -10
- src/ai/research-canvas.js +106 -23
- src/styles/detective-board.css +197 -0
- src/styles/global.css +6 -0
- src/views/chat/chat-view.js +30 -15
docs/superpowers/specs/2026-07-20-detective-board-design.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Detective Board 3D UI & Report Refinements Design
|
| 2 |
+
|
| 3 |
+
## 1. Goal
|
| 4 |
+
Overhaul the "Detective Board" into a cinematic, isometric 3D UI (fake 3D via CSS), fix the mobile report layout bugs where text is cut off, and significantly increase the length of generated reports.
|
| 5 |
+
|
| 6 |
+
## 2. Architecture & Components
|
| 7 |
+
|
| 8 |
+
### 2.1 Cinematic Detective Board (Approach A: CSS 3D + SVG)
|
| 9 |
+
- **Fullscreen Container:** A new `div#detective-board-fullscreen` overlay that covers the entire chat UI.
|
| 10 |
+
- **Header:** A floating back button to return to the chat view.
|
| 11 |
+
- **3D Canvas:**
|
| 12 |
+
- The board container will have `perspective: 2000px` and the canvas will be tilted with `transform: rotateX(60deg) rotateZ(-45deg)`.
|
| 13 |
+
- **Pins (HTML):** Interactive `div` elements representing queries and sources. They will be spawned dynamically on the canvas.
|
| 14 |
+
- **Edges (SVG):** An SVG overlay spanning the canvas. Edges are drawn as `<path>` elements using `stroke-dasharray` and `stroke-dashoffset` to animate them drawing from source to target.
|
| 15 |
+
- **Glow Effect:** A small glowing circle will animate along the SVG path using `offset-path`.
|
| 16 |
+
- **Interactivity:**
|
| 17 |
+
- Clicking a pin opens a compact, floating HTML info card directly above the pin (counter-rotated to stay flat to the screen).
|
| 18 |
+
- **Auto-Scrolling:** As new nodes are added down the infinite board, JavaScript will adjust `window.scrollTo` or a container's `scrollTop` to smoothly pan the camera downward.
|
| 19 |
+
|
| 20 |
+
### 2.2 Report Mobile Layout Fix
|
| 21 |
+
- **Issue:** Text is clipped/shifted right on mobile devices because elements expand beyond the viewport width.
|
| 22 |
+
- **Fixes:**
|
| 23 |
+
- Add `overflow-x: hidden` to `#article-view-modal` to prevent horizontal scrolling of the entire modal.
|
| 24 |
+
- Add `overflow-wrap: anywhere` and `word-break: break-word` to `.article-document`.
|
| 25 |
+
- Ensure Plotly wrappers and images have strict `max-width: 100%`.
|
| 26 |
+
- Adjust `.article-modal-content` padding for mobile using media queries.
|
| 27 |
+
|
| 28 |
+
### 2.3 Report Length Increase
|
| 29 |
+
- **Issue:** Gemini generates short summaries despite large context.
|
| 30 |
+
- **Fixes:**
|
| 31 |
+
- Modify `reportPrompt` in `research-agent.js`.
|
| 32 |
+
- Add strict constraints: "Der Bericht MUSS extrem umfassend sein und mindestens 1500 Wörter umfassen. Schreibe extrem detaillierte Kapitel."
|
| 33 |
+
- Ensure the Gemini API call has a high `maxOutputTokens` (e.g., 8192) or just use the default which is high for Flash/Pro, but the prompt needs to explicitly forbid summarizing.
|
| 34 |
+
|
| 35 |
+
## 3. Data Flow
|
| 36 |
+
1. **Agent -> Canvas:** `research-agent.js` emits graph events (`onGraphEvent`).
|
| 37 |
+
2. **Canvas -> UI:** The 3D Detective Board listens to these events. For every node, it calculates a 2D position (moving downward on the Y axis). It spawns an HTML Pin.
|
| 38 |
+
3. **SVG Connection:** Once two pins exist, an SVG path is generated between their coordinates and the draw animation starts.
|
| 39 |
+
4. **Camera:** The container scrolls to keep the newest pin in view.
|
| 40 |
+
|
| 41 |
+
## 4. Error Handling
|
| 42 |
+
- If SVG drawing fails, nodes still appear.
|
| 43 |
+
- The 3D transform is purely visual; interaction is handled via standard click events on HTML elements.
|
| 44 |
+
|
| 45 |
+
## 5. Testing & Self-Review
|
| 46 |
+
- [x] Are placeholders avoided? Yes.
|
| 47 |
+
- [x] Contradictions? 3D transform breaks standard fixed-position tooltips; we must append the tooltip to the rotated canvas but apply an inverse transform (`rotateX(-60deg) rotateZ(45deg)`) so it faces the camera.
|
| 48 |
+
- [x] Scope? Focused solely on the 3D canvas overhaul, modal CSS fixes, and prompt adjustment.
|
index.html
CHANGED
|
@@ -31,6 +31,7 @@
|
|
| 31 |
<link rel="stylesheet" href="/src/styles/presentation.css">
|
| 32 |
<link rel="stylesheet" href="/src/styles/global.css?v=88" />
|
| 33 |
<link rel="stylesheet" href="/src/styles/shop.css" />
|
|
|
|
| 34 |
<link rel="stylesheet" href="/src/styles/deep-research-loader.css" />
|
| 35 |
<link rel="stylesheet" href="/src/styles/presentation-loader.css" />
|
| 36 |
<link rel="stylesheet" href="/src/styles/learn.css?v=4" />
|
|
@@ -64,7 +65,7 @@
|
|
| 64 |
</head>
|
| 65 |
<body class="dark-theme in-chat-view" data-bg-style="fluid-dark">
|
| 66 |
|
| 67 |
-
<div id="live-version-badge" style="position: fixed; top: 50px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-secondary); opacity: 0.6; z-index: 99999; pointer-events: none; font-weight: 500; font-family: monospace; letter-spacing: 1px; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05);">BUILD 1.8.
|
| 68 |
|
| 69 |
<!-- SVG Filters for Liquid Glass Refraction -->
|
| 70 |
<svg width="0" height="0" style="position: absolute; pointer-events: none;">
|
|
@@ -88,7 +89,7 @@
|
|
| 88 |
<script type="module" src="/src/app.js?v=1075"></script>
|
| 89 |
|
| 90 |
<!-- Article View Modal -->
|
| 91 |
-
<div id="article-view-modal" class="liquid-glass-heavy" style="display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000; background: var(--bg-color); overflow-y: auto;">
|
| 92 |
<div class="article-modal-header">
|
| 93 |
<button id="article-modal-close" class="icon-btn" title="Zurück">
|
| 94 |
<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>
|
|
@@ -215,5 +216,24 @@
|
|
| 215 |
</div>
|
| 216 |
</div>
|
| 217 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
</body>
|
| 219 |
</html>
|
|
|
|
| 31 |
<link rel="stylesheet" href="/src/styles/presentation.css">
|
| 32 |
<link rel="stylesheet" href="/src/styles/global.css?v=88" />
|
| 33 |
<link rel="stylesheet" href="/src/styles/shop.css" />
|
| 34 |
+
<link rel="stylesheet" href="/src/styles/detective-board.css" />
|
| 35 |
<link rel="stylesheet" href="/src/styles/deep-research-loader.css" />
|
| 36 |
<link rel="stylesheet" href="/src/styles/presentation-loader.css" />
|
| 37 |
<link rel="stylesheet" href="/src/styles/learn.css?v=4" />
|
|
|
|
| 65 |
</head>
|
| 66 |
<body class="dark-theme in-chat-view" data-bg-style="fluid-dark">
|
| 67 |
|
| 68 |
+
<div id="live-version-badge" style="position: fixed; top: 50px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-secondary); opacity: 0.6; z-index: 99999; pointer-events: none; font-weight: 500; font-family: monospace; letter-spacing: 1px; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05);">BUILD 1.8.165</div>
|
| 69 |
|
| 70 |
<!-- SVG Filters for Liquid Glass Refraction -->
|
| 71 |
<svg width="0" height="0" style="position: absolute; pointer-events: none;">
|
|
|
|
| 89 |
<script type="module" src="/src/app.js?v=1075"></script>
|
| 90 |
|
| 91 |
<!-- Article View Modal -->
|
| 92 |
+
<div id="article-view-modal" class="liquid-glass-heavy" style="display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000; background: var(--bg-color); overflow-y: auto; overflow-x: hidden;">
|
| 93 |
<div class="article-modal-header">
|
| 94 |
<button id="article-modal-close" class="icon-btn" title="Zurück">
|
| 95 |
<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>
|
|
|
|
| 216 |
</div>
|
| 217 |
</div>
|
| 218 |
</div>
|
| 219 |
+
<!-- Detective Board Fullscreen UI -->
|
| 220 |
+
<div id="detective-board-fullscreen">
|
| 221 |
+
<div class="db-header">
|
| 222 |
+
<button class="db-back-btn" id="db-back-btn">
|
| 223 |
+
<svg viewBox="0 0 24 24" width="18" height="18" stroke="currentColor" stroke-width="2" fill="none"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>
|
| 224 |
+
Zurück zum Chat
|
| 225 |
+
</button>
|
| 226 |
+
</div>
|
| 227 |
+
<div class="db-scene" id="db-scene">
|
| 228 |
+
<div class="db-canvas" id="db-canvas">
|
| 229 |
+
<svg class="db-svg" id="db-svg"></svg>
|
| 230 |
+
</div>
|
| 231 |
+
</div>
|
| 232 |
+
<div class="db-tooltip" id="db-tooltip">
|
| 233 |
+
<h4 id="db-tooltip-title">Titel</h4>
|
| 234 |
+
<p id="db-tooltip-text">Inhalt</p>
|
| 235 |
+
<div class="db-close" id="db-tooltip-close">✖</div>
|
| 236 |
+
</div>
|
| 237 |
+
</div>
|
| 238 |
</body>
|
| 239 |
</html>
|
src/ai/research-agent.js
CHANGED
|
@@ -195,15 +195,16 @@ export class ResearchAgent {
|
|
| 195 |
Nutze DIESE QUELLEN:
|
| 196 |
${contextStr}
|
| 197 |
|
| 198 |
-
WICHTIGE FORMATIERUNGSREGELN FÜR DEINE ANTWORT (STRIKT BEFOLGEN):
|
| 199 |
-
1. Schreibe
|
| 200 |
-
2.
|
|
|
|
| 201 |
Verwende dafür ECHTE FOTOS aus dem Internet über diese Bing-Bildersuche-URL (keine generierte KI!).
|
| 202 |
WICHTIGE REGEL: Nutze Bing-Bilder NUR für Fotos von Menschen, Geräten (z.B. Handys), Orten oder Gegenständen! NIEMALS für Diagramme oder Graphen!
|
| 203 |
Format: 
|
| 204 |
Beispiel: 
|
| 205 |
-
|
| 206 |
-
|
| 207 |
VERWENDE FÜR DIAGRAMME ODER STATISTIKEN NIEMALS BILDER AUS DEM INTERNET, SONDERN AUSSCHLIESSLICH PLOTLY!
|
| 208 |
Nutze dafür einen Markdown-Code-Block mit der Sprache \`plotly\` und schreibe gültiges JSON mit "data" und "layout".
|
| 209 |
WICHTIG: Setze im Layout immer \`"paper_bgcolor": "rgba(0,0,0,0)"\`, \`"plot_bgcolor": "rgba(0,0,0,0)"\` und \`"font": {"color": "#ffffff"}\` für den Dark-Mode!
|
|
@@ -214,8 +215,8 @@ WICHTIGE FORMATIERUNGSREGELN FÜR DEINE ANTWORT (STRIKT BEFOLGEN):
|
|
| 214 |
"layout": {"title": "Marktanteile", "paper_bgcolor": "rgba(0,0,0,0)", "plot_bgcolor": "rgba(0,0,0,0)", "font": {"color": "#ffffff"}}
|
| 215 |
}
|
| 216 |
\`\`\`
|
| 217 |
-
|
| 218 |
-
|
| 219 |
Füge direkt nach jedem Satz/Fakt, den du aus einer Quelle hast, eine Zahl in eckigen Klammern ein, z.B. [1] oder [2].
|
| 220 |
NACH JEDEM ABSATZ musst du ein HTML-<details> Element einfügen, das die im Absatz verwendeten Quellen auflistet!
|
| 221 |
Damit die Links klickbar sind und unser Algorithmus sie findet, MUSST du HTML <ul> und <li> sowie <a> Tags verwenden.
|
|
@@ -227,10 +228,10 @@ WICHTIGE FORMATIERUNGSREGELN FÜR DEINE ANTWORT (STRIKT BEFOLGEN):
|
|
| 227 |
<li data-ref="2"><a href="URL" target="_blank">[2] Name der Website (z.B. Spiegel Online)</a></li>
|
| 228 |
</ul>
|
| 229 |
</details>
|
| 230 |
-
|
| 231 |
-
|
| 232 |
|
| 233 |
-
const fullReport = await gemini.generateContent(reportPrompt, model, geminiKey);
|
| 234 |
|
| 235 |
if (updateUIStatus) updateUIStatus(`Erstelle Zusammenfassung...`, 3);
|
| 236 |
|
|
|
|
| 195 |
Nutze DIESE QUELLEN:
|
| 196 |
${contextStr}
|
| 197 |
|
| 198 |
+
WICHTIGE LÄNGEN- UND FORMATIERUNGSREGELN FÜR DEINE ANTWORT (STRIKT BEFOLGEN):
|
| 199 |
+
1. **EXTREME LÄNGE & DETAILGRAD:** Der Bericht MUSS extrem umfassend sein und darf unter keinen Umständen kurz zusammengefasst werden. Schreibe für jeden wichtigen Aspekt ein eigenes, detailliertes Kapitel. Es ist ausdrücklich gewünscht, dass der Bericht mindestens 1500 Wörter umfasst!
|
| 200 |
+
2. Schreibe im perfekten Markdown Format. Dein Text wird direkt gerendert!
|
| 201 |
+
3. Nutze zwingend Bilder, um den Bericht visuell aufzuwerten. Setze diese gezielt nach wichtigen Kapiteln ein.
|
| 202 |
Verwende dafür ECHTE FOTOS aus dem Internet über diese Bing-Bildersuche-URL (keine generierte KI!).
|
| 203 |
WICHTIGE REGEL: Nutze Bing-Bilder NUR für Fotos von Menschen, Geräten (z.B. Handys), Orten oder Gegenständen! NIEMALS für Diagramme oder Graphen!
|
| 204 |
Format: 
|
| 205 |
Beispiel: 
|
| 206 |
+
4. Baue zwingend sinnvolle Markdown-Tabellen ein, um Fakten, Vergleiche oder Metriken übersichtlich und strukturiert darzustellen.
|
| 207 |
+
5. **NEU: Echte Diagramme & Graphen:** Wenn du statistische Daten, Vergleiche oder Anteile visualisieren willst, MUSS zwingend ein interaktives Plotly.js Diagramm gezeichnet werden!
|
| 208 |
VERWENDE FÜR DIAGRAMME ODER STATISTIKEN NIEMALS BILDER AUS DEM INTERNET, SONDERN AUSSCHLIESSLICH PLOTLY!
|
| 209 |
Nutze dafür einen Markdown-Code-Block mit der Sprache \`plotly\` und schreibe gültiges JSON mit "data" und "layout".
|
| 210 |
WICHTIG: Setze im Layout immer \`"paper_bgcolor": "rgba(0,0,0,0)"\`, \`"plot_bgcolor": "rgba(0,0,0,0)"\` und \`"font": {"color": "#ffffff"}\` für den Dark-Mode!
|
|
|
|
| 215 |
"layout": {"title": "Marktanteile", "paper_bgcolor": "rgba(0,0,0,0)", "plot_bgcolor": "rgba(0,0,0,0)", "font": {"color": "#ffffff"}}
|
| 216 |
}
|
| 217 |
\`\`\`
|
| 218 |
+
6. Der Bericht MUSS in mehrere Absätze mit klaren H2 (##) und H3 (###) Überschriften gegliedert sein.
|
| 219 |
+
7. DU MUSST PRÄZISE INLINE-QUELLEN (Wikipedia-Stil) VERWENDEN!
|
| 220 |
Füge direkt nach jedem Satz/Fakt, den du aus einer Quelle hast, eine Zahl in eckigen Klammern ein, z.B. [1] oder [2].
|
| 221 |
NACH JEDEM ABSATZ musst du ein HTML-<details> Element einfügen, das die im Absatz verwendeten Quellen auflistet!
|
| 222 |
Damit die Links klickbar sind und unser Algorithmus sie findet, MUSST du HTML <ul> und <li> sowie <a> Tags verwenden.
|
|
|
|
| 228 |
<li data-ref="2"><a href="URL" target="_blank">[2] Name der Website (z.B. Spiegel Online)</a></li>
|
| 229 |
</ul>
|
| 230 |
</details>
|
| 231 |
+
8. Am ganz Ende des Berichts lege ein H2-Kapitel "## Quellenverzeichnis" an und liste dort nochmal alle Quellen auf.
|
| 232 |
+
9. Antworte in der Sprache des Nutzers, formell, sehr leserlich, informativ und professionell.`;
|
| 233 |
|
| 234 |
+
const fullReport = await gemini.generateContent(reportPrompt, model, geminiKey, null, [], { maxOutputTokens: 8192 });
|
| 235 |
|
| 236 |
if (updateUIStatus) updateUIStatus(`Erstelle Zusammenfassung...`, 3);
|
| 237 |
|
src/ai/research-canvas.js
CHANGED
|
@@ -1,29 +1,112 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
let
|
| 4 |
-
let
|
| 5 |
-
let
|
| 6 |
-
|
| 7 |
-
export async function initCanvas(
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
if (!
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
}
|
| 20 |
|
| 21 |
export function addNode(id, label, type = 'query') {
|
| 22 |
-
if (!
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
}
|
| 25 |
|
| 26 |
-
export function addEdge(
|
| 27 |
-
if (!
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
}
|
|
|
|
| 1 |
+
let canvas = null;
|
| 2 |
+
let svgLayer = null;
|
| 3 |
+
let scene = null;
|
| 4 |
+
let nodesMap = new Map();
|
| 5 |
+
let currentY = 150; // Starting Y position
|
| 6 |
+
|
| 7 |
+
export async function initCanvas() {
|
| 8 |
+
canvas = document.getElementById('db-canvas');
|
| 9 |
+
svgLayer = document.getElementById('db-svg');
|
| 10 |
+
scene = document.getElementById('db-scene');
|
| 11 |
+
if (!canvas || !svgLayer) return;
|
| 12 |
+
|
| 13 |
+
// Reset
|
| 14 |
+
canvas.querySelectorAll('.db-pin').forEach(el => el.remove());
|
| 15 |
+
svgLayer.innerHTML = '';
|
| 16 |
+
nodesMap.clear();
|
| 17 |
+
currentY = 150;
|
| 18 |
+
|
| 19 |
+
// Setup Tooltip
|
| 20 |
+
const tooltip = document.getElementById('db-tooltip');
|
| 21 |
+
const tooltipClose = document.getElementById('db-tooltip-close');
|
| 22 |
+
if (tooltipClose) {
|
| 23 |
+
tooltipClose.onclick = (e) => {
|
| 24 |
+
e.stopPropagation();
|
| 25 |
+
tooltip.classList.remove('visible');
|
| 26 |
+
};
|
| 27 |
+
}
|
| 28 |
}
|
| 29 |
|
| 30 |
export function addNode(id, label, type = 'query') {
|
| 31 |
+
if (!canvas) return;
|
| 32 |
+
if (nodesMap.has(id)) return; // prevent duplicates
|
| 33 |
+
|
| 34 |
+
// Calculate position
|
| 35 |
+
// Spread X based on type or just randomly alternate slightly
|
| 36 |
+
const randomOffset = (Math.random() - 0.5) * 800; // Spread wide
|
| 37 |
+
const posX = 1000 + randomOffset; // Center is 1000px
|
| 38 |
+
const posY = currentY;
|
| 39 |
+
|
| 40 |
+
currentY += 250 + (Math.random() * 150); // Move down for the next node
|
| 41 |
+
|
| 42 |
+
nodesMap.set(id, { id, label, type, x: posX, y: posY });
|
| 43 |
+
|
| 44 |
+
// Create Pin HTML
|
| 45 |
+
const pin = document.createElement('div');
|
| 46 |
+
pin.className = `db-pin type-${type}`;
|
| 47 |
+
pin.style.left = `${posX}px`;
|
| 48 |
+
pin.style.top = `${posY}px`;
|
| 49 |
+
|
| 50 |
+
const pinHead = document.createElement('div');
|
| 51 |
+
pinHead.className = 'db-pin-head';
|
| 52 |
+
pin.appendChild(pinHead);
|
| 53 |
+
|
| 54 |
+
const pinLabel = document.createElement('div');
|
| 55 |
+
pinLabel.className = 'db-pin-label';
|
| 56 |
+
pinLabel.textContent = label.length > 30 ? label.substring(0, 30) + '...' : label;
|
| 57 |
+
pin.appendChild(pinLabel);
|
| 58 |
+
|
| 59 |
+
// Interaction
|
| 60 |
+
pin.onclick = (e) => {
|
| 61 |
+
e.stopPropagation();
|
| 62 |
+
const tooltip = document.getElementById('db-tooltip');
|
| 63 |
+
document.getElementById('db-tooltip-title').textContent = type === 'query' ? 'Suchanfrage' : 'Gelesene Quelle';
|
| 64 |
+
document.getElementById('db-tooltip-text').textContent = label;
|
| 65 |
+
|
| 66 |
+
// Position tooltip relative to pin (compensate for pin position)
|
| 67 |
+
tooltip.style.left = `${posX + 30}px`;
|
| 68 |
+
tooltip.style.top = `${posY - 20}px`;
|
| 69 |
+
tooltip.classList.add('visible');
|
| 70 |
+
};
|
| 71 |
+
|
| 72 |
+
canvas.appendChild(pin);
|
| 73 |
+
|
| 74 |
+
// Auto scroll down smoothly
|
| 75 |
+
if (scene) {
|
| 76 |
+
scene.scrollTo({
|
| 77 |
+
top: posY - 300,
|
| 78 |
+
behavior: 'smooth'
|
| 79 |
+
});
|
| 80 |
+
}
|
| 81 |
}
|
| 82 |
|
| 83 |
+
export function addEdge(fromId, toId) {
|
| 84 |
+
if (!svgLayer) return;
|
| 85 |
+
const fromNode = nodesMap.get(fromId);
|
| 86 |
+
const toNode = nodesMap.get(toId);
|
| 87 |
+
if (!fromNode || !toNode) return;
|
| 88 |
+
|
| 89 |
+
// Draw SVG Path
|
| 90 |
+
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
| 91 |
+
const edgeType = toNode.type === 'source' ? 'type-source' : 'type-query';
|
| 92 |
+
path.setAttribute('class', `db-edge ${edgeType}`);
|
| 93 |
+
|
| 94 |
+
// Create a bezier curve between the points
|
| 95 |
+
const controlY = fromNode.y + (toNode.y - fromNode.y) / 2;
|
| 96 |
+
const d = `M ${fromNode.x},${fromNode.y} C ${fromNode.x},${controlY} ${toNode.x},${controlY} ${toNode.x},${toNode.y}`;
|
| 97 |
+
path.setAttribute('d', d);
|
| 98 |
+
|
| 99 |
+
// Add path to SVG
|
| 100 |
+
svgLayer.appendChild(path);
|
| 101 |
+
|
| 102 |
+
// Draw Glow Dot moving along the path
|
| 103 |
+
const dot = document.createElement('div');
|
| 104 |
+
dot.className = `db-glow-dot ${edgeType}`;
|
| 105 |
+
dot.style.offsetPath = `path('${d}')`;
|
| 106 |
+
canvas.appendChild(dot);
|
| 107 |
+
|
| 108 |
+
// Remove dot after animation to save DOM nodes
|
| 109 |
+
setTimeout(() => {
|
| 110 |
+
if (dot.parentNode) dot.remove();
|
| 111 |
+
}, 3000);
|
| 112 |
}
|
src/styles/detective-board.css
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* =========================================================
|
| 2 |
+
DETECTIVE BOARD 3D UI (CINEMATIC ISOMETRIC)
|
| 3 |
+
========================================================= */
|
| 4 |
+
|
| 5 |
+
#detective-board-fullscreen {
|
| 6 |
+
position: fixed;
|
| 7 |
+
top: 0; left: 0; width: 100vw; height: 100vh;
|
| 8 |
+
background: radial-gradient(circle at center, #1a1a2e 0%, #050508 100%);
|
| 9 |
+
z-index: 99999;
|
| 10 |
+
display: flex;
|
| 11 |
+
flex-direction: column;
|
| 12 |
+
overflow: hidden;
|
| 13 |
+
opacity: 0;
|
| 14 |
+
transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
|
| 15 |
+
pointer-events: none;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
#detective-board-fullscreen.visible {
|
| 19 |
+
opacity: 1;
|
| 20 |
+
pointer-events: auto;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.db-header {
|
| 24 |
+
position: absolute;
|
| 25 |
+
top: 20px; left: 20px;
|
| 26 |
+
z-index: 1000;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
.db-back-btn {
|
| 30 |
+
background: rgba(255,255,255,0.05);
|
| 31 |
+
border: 1px solid rgba(255,255,255,0.1);
|
| 32 |
+
color: white;
|
| 33 |
+
padding: 8px 16px;
|
| 34 |
+
border-radius: 20px;
|
| 35 |
+
cursor: pointer;
|
| 36 |
+
backdrop-filter: blur(10px);
|
| 37 |
+
display: flex; align-items: center; gap: 8px;
|
| 38 |
+
transition: all 0.3s;
|
| 39 |
+
font-family: inherit;
|
| 40 |
+
font-size: 14px;
|
| 41 |
+
}
|
| 42 |
+
.db-back-btn:hover { background: rgba(255,255,255,0.15); transform: translateY(-1px); }
|
| 43 |
+
|
| 44 |
+
/* The 3D Scene */
|
| 45 |
+
.db-scene {
|
| 46 |
+
perspective: 1500px;
|
| 47 |
+
width: 100%;
|
| 48 |
+
height: 100%;
|
| 49 |
+
position: relative;
|
| 50 |
+
overflow-y: auto;
|
| 51 |
+
overflow-x: hidden;
|
| 52 |
+
scrollbar-width: none;
|
| 53 |
+
scroll-behavior: smooth;
|
| 54 |
+
}
|
| 55 |
+
.db-scene::-webkit-scrollbar { display: none; }
|
| 56 |
+
|
| 57 |
+
/* The rotatable canvas */
|
| 58 |
+
.db-canvas {
|
| 59 |
+
position: absolute;
|
| 60 |
+
top: 0; left: 50%;
|
| 61 |
+
width: 2000px; height: 8000px; /* huge area to scroll down */
|
| 62 |
+
transform-origin: top center;
|
| 63 |
+
transform: translateX(-50%) rotateX(60deg) rotateZ(-45deg);
|
| 64 |
+
transform-style: preserve-3d;
|
| 65 |
+
background-image:
|
| 66 |
+
linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px),
|
| 67 |
+
linear-gradient(90deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px);
|
| 68 |
+
background-size: 60px 60px;
|
| 69 |
+
background-position: center top;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
/* Pins */
|
| 73 |
+
.db-pin {
|
| 74 |
+
position: absolute;
|
| 75 |
+
transform-style: preserve-3d;
|
| 76 |
+
cursor: pointer;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
.db-pin-head {
|
| 80 |
+
width: 14px; height: 14px;
|
| 81 |
+
background: #00e5ff;
|
| 82 |
+
border-radius: 50%;
|
| 83 |
+
box-shadow: 0 0 15px #00e5ff, 0 0 30px #00e5ff;
|
| 84 |
+
/* Counter-rotate to always face the camera */
|
| 85 |
+
transform: rotateZ(45deg) rotateX(-60deg);
|
| 86 |
+
position: relative;
|
| 87 |
+
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
|
| 88 |
+
}
|
| 89 |
+
.db-pin:hover .db-pin-head {
|
| 90 |
+
transform: rotateZ(45deg) rotateX(-60deg) scale(1.5);
|
| 91 |
+
box-shadow: 0 0 25px #00e5ff, 0 0 50px #fff;
|
| 92 |
+
background: #fff;
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
.db-pin.type-source .db-pin-head {
|
| 96 |
+
background: #b652ff;
|
| 97 |
+
box-shadow: 0 0 15px #b652ff, 0 0 30px #b652ff;
|
| 98 |
+
}
|
| 99 |
+
.db-pin.type-source:hover .db-pin-head {
|
| 100 |
+
box-shadow: 0 0 25px #b652ff, 0 0 50px #fff;
|
| 101 |
+
background: #fff;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
.db-pin-label {
|
| 105 |
+
position: absolute;
|
| 106 |
+
top: 20px; left: 20px;
|
| 107 |
+
background: rgba(10, 10, 20, 0.8);
|
| 108 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 109 |
+
color: #fff;
|
| 110 |
+
padding: 6px 12px;
|
| 111 |
+
border-radius: 6px;
|
| 112 |
+
font-size: 13px;
|
| 113 |
+
font-weight: 500;
|
| 114 |
+
white-space: nowrap;
|
| 115 |
+
transform: rotateZ(45deg) rotateX(-60deg);
|
| 116 |
+
transform-origin: top left;
|
| 117 |
+
pointer-events: none;
|
| 118 |
+
backdrop-filter: blur(4px);
|
| 119 |
+
box-shadow: 0 8px 16px rgba(0,0,0,0.5);
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
/* Tooltip (Popup window on click) */
|
| 123 |
+
.db-tooltip {
|
| 124 |
+
position: absolute;
|
| 125 |
+
top: -20px; left: 30px;
|
| 126 |
+
width: 300px;
|
| 127 |
+
background: rgba(15, 15, 25, 0.95);
|
| 128 |
+
border: 1px solid rgba(255,255,255,0.2);
|
| 129 |
+
box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 20px rgba(0,229,255,0.2);
|
| 130 |
+
border-radius: 12px;
|
| 131 |
+
padding: 16px;
|
| 132 |
+
color: white;
|
| 133 |
+
transform: rotateZ(45deg) rotateX(-60deg);
|
| 134 |
+
transform-origin: bottom left;
|
| 135 |
+
opacity: 0;
|
| 136 |
+
pointer-events: none;
|
| 137 |
+
transition: opacity 0.3s, transform 0.3s;
|
| 138 |
+
z-index: 100;
|
| 139 |
+
backdrop-filter: blur(10px);
|
| 140 |
+
}
|
| 141 |
+
.db-tooltip.visible {
|
| 142 |
+
opacity: 1;
|
| 143 |
+
transform: rotateZ(45deg) rotateX(-60deg) translateY(-20px);
|
| 144 |
+
pointer-events: auto;
|
| 145 |
+
}
|
| 146 |
+
.db-tooltip h4 { margin: 0 0 8px 0; font-size: 15px; color: #fff; line-height: 1.3; }
|
| 147 |
+
.db-tooltip p { margin: 0; font-size: 13px; color: #aaa; line-height: 1.5; }
|
| 148 |
+
.db-tooltip .db-close {
|
| 149 |
+
position: absolute; top: 12px; right: 12px; cursor: pointer; color: #aaa;
|
| 150 |
+
}
|
| 151 |
+
.db-tooltip .db-close:hover { color: #fff; }
|
| 152 |
+
|
| 153 |
+
/* SVG Edges */
|
| 154 |
+
.db-svg {
|
| 155 |
+
position: absolute;
|
| 156 |
+
top: 0; left: 0;
|
| 157 |
+
width: 100%; height: 100%;
|
| 158 |
+
pointer-events: none;
|
| 159 |
+
overflow: visible;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
.db-edge {
|
| 163 |
+
fill: none;
|
| 164 |
+
stroke: rgba(0, 229, 255, 0.5);
|
| 165 |
+
stroke-width: 2;
|
| 166 |
+
stroke-dasharray: 2000;
|
| 167 |
+
stroke-dashoffset: 2000;
|
| 168 |
+
animation: drawEdge 3s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
|
| 169 |
+
}
|
| 170 |
+
.db-edge.type-source {
|
| 171 |
+
stroke: rgba(182, 82, 255, 0.5);
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
@keyframes drawEdge {
|
| 175 |
+
to { stroke-dashoffset: 0; }
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
.db-glow-dot {
|
| 179 |
+
width: 8px; height: 8px;
|
| 180 |
+
background: #fff;
|
| 181 |
+
border-radius: 50%;
|
| 182 |
+
box-shadow: 0 0 10px #fff, 0 0 20px #00e5ff;
|
| 183 |
+
position: absolute;
|
| 184 |
+
top: -4px; left: -4px;
|
| 185 |
+
/* offset-path will be set via inline style */
|
| 186 |
+
animation: moveDot 3s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
|
| 187 |
+
opacity: 0;
|
| 188 |
+
}
|
| 189 |
+
.db-glow-dot.type-source {
|
| 190 |
+
box-shadow: 0 0 10px #fff, 0 0 20px #b652ff;
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
@keyframes moveDot {
|
| 194 |
+
0% { offset-distance: 0%; opacity: 1; }
|
| 195 |
+
80% { opacity: 1; }
|
| 196 |
+
100% { offset-distance: 100%; opacity: 0; }
|
| 197 |
+
}
|
src/styles/global.css
CHANGED
|
@@ -2627,6 +2627,9 @@ mjx-container:not([display="true"]) {
|
|
| 2627 |
font-size: 18px;
|
| 2628 |
line-height: 1.8;
|
| 2629 |
color: var(--text-primary);
|
|
|
|
|
|
|
|
|
|
| 2630 |
}
|
| 2631 |
|
| 2632 |
.article-document h1 {
|
|
@@ -2680,6 +2683,9 @@ mjx-container:not([display="true"]) {
|
|
| 2680 |
padding: 24px;
|
| 2681 |
min-height: auto;
|
| 2682 |
}
|
|
|
|
|
|
|
|
|
|
| 2683 |
}
|
| 2684 |
|
| 2685 |
/* Hide chat-specific floating UI elements when not in Chat view, or when chat is empty */
|
|
|
|
| 2627 |
font-size: 18px;
|
| 2628 |
line-height: 1.8;
|
| 2629 |
color: var(--text-primary);
|
| 2630 |
+
overflow-wrap: anywhere;
|
| 2631 |
+
word-break: break-word;
|
| 2632 |
+
word-wrap: break-word;
|
| 2633 |
}
|
| 2634 |
|
| 2635 |
.article-document h1 {
|
|
|
|
| 2683 |
padding: 24px;
|
| 2684 |
min-height: auto;
|
| 2685 |
}
|
| 2686 |
+
.article-modal-content {
|
| 2687 |
+
padding: 40px 16px 80px 16px;
|
| 2688 |
+
}
|
| 2689 |
}
|
| 2690 |
|
| 2691 |
/* Hide chat-specific floating UI elements when not in Chat view, or when chat is empty */
|
src/views/chat/chat-view.js
CHANGED
|
@@ -4825,13 +4825,30 @@ body { margin: 0; padding: 0; background: #000; overflow: hidden; display: flex;
|
|
| 4825 |
|
| 4826 |
// Show fullscreen loader for deep research
|
| 4827 |
if (isDeepResearch) {
|
| 4828 |
-
if (isDetectiveBoard
|
| 4829 |
-
document.
|
| 4830 |
-
|
| 4831 |
-
|
| 4832 |
-
|
| 4833 |
-
|
| 4834 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4835 |
} else {
|
| 4836 |
deepResearchLoader.show();
|
| 4837 |
}
|
|
@@ -4865,10 +4882,9 @@ body { margin: 0; padding: 0; background: #000; overflow: hidden; display: flex;
|
|
| 4865 |
this.hideToolStatus();
|
| 4866 |
if (isDeepResearch) {
|
| 4867 |
deepResearchLoader.hide();
|
| 4868 |
-
|
| 4869 |
-
|
| 4870 |
-
|
| 4871 |
-
setTimeout(() => overlay.style.display = 'none', 1000);
|
| 4872 |
}
|
| 4873 |
}
|
| 4874 |
|
|
@@ -4993,10 +5009,9 @@ body { margin: 0; padding: 0; background: #000; overflow: hidden; display: flex;
|
|
| 4993 |
await this.hideTypingIndicator();
|
| 4994 |
if (isDeepResearch) {
|
| 4995 |
deepResearchLoader.hide();
|
| 4996 |
-
|
| 4997 |
-
|
| 4998 |
-
|
| 4999 |
-
setTimeout(() => overlay.style.display = 'none', 1000);
|
| 5000 |
}
|
| 5001 |
}
|
| 5002 |
|
|
|
|
| 4825 |
|
| 4826 |
// Show fullscreen loader for deep research
|
| 4827 |
if (isDeepResearch) {
|
| 4828 |
+
if (isDetectiveBoard) {
|
| 4829 |
+
const board = document.getElementById('detective-board-fullscreen');
|
| 4830 |
+
if (board) {
|
| 4831 |
+
board.classList.add('visible');
|
| 4832 |
+
await initCanvas();
|
| 4833 |
+
addNode('root', 'Research Topic', 'query');
|
| 4834 |
+
|
| 4835 |
+
document.getElementById('db-back-btn').onclick = () => {
|
| 4836 |
+
board.classList.remove('visible');
|
| 4837 |
+
};
|
| 4838 |
+
|
| 4839 |
+
let reopenBtn = document.getElementById('reopen-db-btn');
|
| 4840 |
+
if (!reopenBtn) {
|
| 4841 |
+
reopenBtn = document.createElement('button');
|
| 4842 |
+
reopenBtn.id = 'reopen-db-btn';
|
| 4843 |
+
reopenBtn.className = 'liquid-glass';
|
| 4844 |
+
reopenBtn.innerHTML = '🕵️ Detective Board ansehen';
|
| 4845 |
+
reopenBtn.style.cssText = 'position: absolute; top: 60px; right: 20px; z-index: 1000; padding: 8px 16px; border-radius: 20px; font-size: 14px; color: #fff; cursor: pointer; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);';
|
| 4846 |
+
reopenBtn.onclick = () => {
|
| 4847 |
+
board.classList.add('visible');
|
| 4848 |
+
};
|
| 4849 |
+
this.container.appendChild(reopenBtn);
|
| 4850 |
+
}
|
| 4851 |
+
}
|
| 4852 |
} else {
|
| 4853 |
deepResearchLoader.show();
|
| 4854 |
}
|
|
|
|
| 4882 |
this.hideToolStatus();
|
| 4883 |
if (isDeepResearch) {
|
| 4884 |
deepResearchLoader.hide();
|
| 4885 |
+
if (isDetectiveBoard) {
|
| 4886 |
+
const board = document.getElementById('detective-board-fullscreen');
|
| 4887 |
+
if (board) board.classList.remove('visible');
|
|
|
|
| 4888 |
}
|
| 4889 |
}
|
| 4890 |
|
|
|
|
| 5009 |
await this.hideTypingIndicator();
|
| 5010 |
if (isDeepResearch) {
|
| 5011 |
deepResearchLoader.hide();
|
| 5012 |
+
if (isDetectiveBoard) {
|
| 5013 |
+
const board = document.getElementById('detective-board-fullscreen');
|
| 5014 |
+
if (board) board.classList.remove('visible');
|
|
|
|
| 5015 |
}
|
| 5016 |
}
|
| 5017 |
|