Skip to content

multiple pdf + audio ui/orch (rebase urself) - #4

Closed
MegaaDev wants to merge 1 commit into
mainfrom
audio-orc
Closed

MegaaDev wants to merge 1 commit into
mainfrom
audio-orc

Conversation

@MegaaDev

@MegaaDev MegaaDev commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings June 1, 2026 17:21
@vercel

vercel Bot commented Jun 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tutor-system-architecture Ready Ready Preview, Comment Jun 1, 2026 5:21pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the study/voice experience by adding multi-PDF support (with a document library UI) and improving the voice orchestration pipeline (image search + diagram generation endpoints, plus Deepgram connection stability updates).

Changes:

  • Add multi-document PDF state in Zustand and a new PdfSwitcher overlay for switching/removing PDFs.
  • Add a resizable PDF/chat split view and voice-active styling adjustments in StudyView.
  • Add server support for voice visuals: GET /api/image-search and POST /api/generate-mermaid, plus updates to title generation and Deepgram WS keepalive/forwarding behavior.

Reviewed changes

Copilot reviewed 28 out of 31 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/views/StudyView.tsx Adds multi-PDF controls, document library modal, and resizable PDF/chat layout.
src/store/index.ts Introduces pdfs + activePdfId with add/remove/switch logic; syncs page/totalPages into the active document.
src/components/PdfViewer.tsx Adjusts title-generation trigger logic and restores page on load.
src/components/PdfSwitcher.tsx New document library overlay with PDF thumbnails and remove/select actions.
src/types.ts Extends Message with voiceSession metadata.
server/web-search.ts Adds Serper image search helper + caching.
server.ts Adds image search + mermaid generation endpoints; updates title endpoint; improves Deepgram WS keepalive and frame forwarding.
server.mjs Bundled server output updated to match server changes.
brain/runtime/runtime-impact-map.json Runtime artifact updated (currently contains a generation error state).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/views/StudyView.tsx
Comment on lines 82 to 86
const [isDragging, setIsDragging] = useState(false);
const [isChatOpen, setIsChatOpen] = useState(true);
const [isLibraryOpen, setIsLibraryOpen] = useState(false);
const [card1DotsReady, setCard1DotsReady] = useState(false);
const [card2DotsReady, setCard2DotsReady] = useState(false);
Comment on lines 79 to 81
const activeCanvas = document.querySelector(
".react-pdf__Page__canvas",
) as HTMLCanvasElement;
Comment on lines +162 to +172
<button
type="button"
onClick={(e) => {
e.stopPropagation();
removePdf(pdf.id);
}}
aria-label={`Remove ${pdf.name}`}
className="absolute left-2 top-2 flex h-6 w-6 items-center justify-center rounded-full border border-white/15 bg-black/60 text-zinc-300 opacity-0 backdrop-blur-md transition-all duration-200 hover:bg-red-500/25 hover:text-red-100 group-hover:opacity-100"
>
<X size={13} />
</button>
Comment on lines 1 to 9
{
"metadata": {
"generatedAt": "2026-05-27T14:59:40.575Z",
"source": "brain/runtime/run-runtime-benchmark.ts",
"sourceHash": "31a027861891e45d04aae40330ee5fa728578068f4eccce8acdce5883fa2cfb6",
"url": "http://127.0.0.1:3000",
"eventCount": 21,
"confidence": 0.82
"generatedAt": "2026-05-29T07:33:21.429Z",
"confidence": 0,
"error": "browserType.launch: Executable doesn't exist at /Users/akshaya/Library/Caches/ms-playwright/chromium_headless_shell-1223/chrome-headless-shell-mac-arm64/chrome-headless-shell\n╔════════════════════════════════════════════════════════════╗\n║ Looks like Playwright was just installed or updated. ║\n║ Please run the following command to download new browsers: ║\n║ ║\n║ npx playwright install ║\n║ ║\n║ <3 Playwright Team ║\n╚════════════════════════════════════════════════════════════╝"
},
"events": [
{
"type": "render",
"name": "route:study",
"durationMs": 44.19999998807907,
"metadata": {
"phase": "mount",
"baseDuration": 36,
"startTime": 234.69999998807907,
"commitTime": 279.69999998807907
},
"timestamp": 286.19999998807907
},
{
"type": "state",
"name": "messages",
"metadata": {
"previousType": "object",
"nextType": "object"
},
"timestamp": 335.0999999642372
},
{
"type": "route",
"name": "study",
"metadata": {
"source": "App.activeView"
},
"timestamp": 335.2999999523163
},
{
"type": "route",
"name": "study",
"metadata": {
"source": "App.activeView"
},
"timestamp": 342.39999997615814
},
{
"type": "render",
"name": "route:study",
"durationMs": 6.500000059604645,
"metadata": {
"phase": "update",
"baseDuration": 31.700000047683716,
"startTime": 345.69999998807907,
"commitTime": 352.5
},
"timestamp": 353.89999997615814
},
{
"type": "render",
"name": "route:study",
"durationMs": 5.799999952316284,
"metadata": {
"phase": "update",
"baseDuration": 31.600000023841858,
"startTime": 397.7999999523163,
"commitTime": 403.7999999523163
},
"timestamp": 404.5
},
{
"type": "render",
"name": "route:study",
"durationMs": 8.099999964237213,
"metadata": {
"phase": "update",
"baseDuration": 34.09999996423721,
"startTime": 434.5,
"commitTime": 442.69999998807907
},
"timestamp": 443.39999997615814
},
{
"type": "state",
"name": "activeLearningBookId",
"metadata": {
"previousType": "object",
"nextType": "string"
},
"timestamp": 444.39999997615814
},
{
"type": "render",
"name": "route:study",
"durationMs": 10.100000023841858,
"metadata": {
"phase": "update",
"baseDuration": 34.80000001192093,
"startTime": 447.0999999642372,
"commitTime": 457.2999999523163
},
"timestamp": 460
},
{
"type": "render",
"name": "route:study",
"durationMs": 0.19999998807907104,
"metadata": {
"phase": "update",
"baseDuration": 34.89999997615814,
"startTime": 743.5999999642372,
"commitTime": 743.7999999523163
},
"timestamp": 743.8999999761581
},
{
"type": "render",
"name": "route:study",
"durationMs": 0.5999999642372131,
"metadata": {
"phase": "update",
"baseDuration": 34.699999928474426,
"startTime": 917.6999999880791,
"commitTime": 918.3999999761581
},
"timestamp": 919
},
{
"type": "state",
"name": "activeView",
"metadata": {
"previousType": "string",
"nextType": "string"
},
"timestamp": 1771.2999999523163
},
{
"type": "render",
"name": "route:study",
"durationMs": 12.00000011920929,
"metadata": {
"phase": "update",
"baseDuration": 37.70000022649765,
"startTime": 1777.7999999523163,
"commitTime": 1790.5
},
"timestamp": 1799
},
{
"type": "route",
"name": "analytics",
"metadata": {
"source": "App.activeView"
},
"timestamp": 1800.5
},
{
"type": "render",
"name": "route:study",
"durationMs": 37.499999940395355,
"metadata": {
"phase": "update",
"baseDuration": 50.39999979734421,
"startTime": 2236.699999988079,
"commitTime": 2274.399999976158
},
"timestamp": 2283.7999999523163
},
{
"type": "state",
"name": "activeView",
"metadata": {
"previousType": "string",
"nextType": "string"
},
"timestamp": 2964
},
{
"type": "render",
"name": "route:study",
"durationMs": 15.399999916553497,
"metadata": {
"phase": "update",
"baseDuration": 46.90000003576279,
"startTime": 2971.5,
"commitTime": 2987.399999976158
},
"timestamp": 2990.599999964237
},
{
"type": "route",
"name": "revision",
"metadata": {
"source": "App.activeView"
},
"timestamp": 2991.2999999523163
},
{
"type": "state",
"name": "activeView",
"metadata": {
"previousType": "string",
"nextType": "string"
},
"timestamp": 3813.599999964237
},
{
"type": "render",
"name": "route:study",
"durationMs": 18.700000047683716,
"metadata": {
"phase": "update",
"baseDuration": 32.40000009536743,
"startTime": 3817.399999976158,
"commitTime": 3836.399999976158
},
"timestamp": 3841
},
{
"type": "route",
"name": "study",
"metadata": {
"source": "App.activeView"
},
"timestamp": 3842.199999988079
}
],
"summary": {
"renderByName": [
{
"component": "route:study",
"count": 11,
"totalDurationMs": 159.0999999642372,
"maxDurationMs": 44.19999998807907,
"averageDurationMs": 14.463636360385202
}
],
"routeTransitions": [
{
"type": "route",
"name": "study",
"metadata": {
"source": "App.activeView"
},
"timestamp": 335.2999999523163
},
{
"type": "route",
"name": "study",
"metadata": {
"source": "App.activeView"
},
"timestamp": 342.39999997615814
},
{
"type": "route",
"name": "analytics",
"metadata": {
"source": "App.activeView"
},
"timestamp": 1800.5
},
{
"type": "route",
"name": "revision",
"metadata": {
"source": "App.activeView"
},
"timestamp": 2991.2999999523163
},
{
"type": "route",
"name": "study",
"metadata": {
"source": "App.activeView"
},
"timestamp": 3842.199999988079
}
],
"fetchEvents": [],
"websocketEvents": [],
"databaseEvents": [],
"propagation": [
{
"state": "messages",
"timestamp": 335.0999999642372,
"nextRender": "route:study",
"lagMs": 18.80000001192093,
"metadata": {
"previousType": "object",
"nextType": "object"
}
},
{
"state": "activeLearningBookId",
"timestamp": 444.39999997615814,
"nextRender": "route:study",
"lagMs": 15.600000023841858,
"metadata": {
"previousType": "object",
"nextType": "string"
}
},
{
"state": "activeView",
"timestamp": 1771.2999999523163,
"nextRender": "route:study",
"lagMs": 27.700000047683716,
"metadata": {
"previousType": "string",
"nextType": "string"
}
},
{
"state": "activeView",
"timestamp": 2964,
"nextRender": "route:study",
"lagMs": 26.599999964237213,
"metadata": {
"previousType": "string",
"nextType": "string"
}
},
{
"state": "activeView",
"timestamp": 3813.599999964237,
"nextRender": "route:study",
"lagMs": 27.400000035762787,
"metadata": {
"previousType": "string",
"nextType": "string"
}
}
],
"hotspots": [
{
"type": "render",
"name": "route:study",
"severity": 100,
"evidence": {
"component": "route:study",
"count": 11,
"totalDurationMs": 159.0999999642372,
"maxDurationMs": 44.19999998807907,
"averageDurationMs": 14.463636360385202
}
}
]
}
"events": [],
"summary": {}
}

This branch was successfully deployed

1 active deployment
Preview — 1611e47e Deployed Jun 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants