|
356 | 356 |
|
357 | 357 | <span class="border"></span> |
358 | 358 | <div class="navigation">Tab 2 of 2 │ ← → Navigate │ Ctrl+C Exit</div>`; |
| 359 | + |
| 360 | + // Simulate live update when Claude edits TODO.md |
| 361 | + // This happens after Claude shows "✓ Updated TODO.md" |
| 362 | + // Timing: 10s wait + typing + response + tests = ~14s total |
| 363 | + setTimeout(() => { |
| 364 | + // Flash effect to show file changed |
| 365 | + mdtailOutput.style.opacity = '0.7'; |
| 366 | + setTimeout(() => { |
| 367 | + mdtailOutput.style.opacity = '1'; |
| 368 | + mdtailOutput.innerHTML = ` |
| 369 | +<span class="border"></span> |
| 370 | +<div style="color: #d4d4d4; padding: 2px 0;"> |
| 371 | + README.md │ <span style="font-weight: bold; color: #fff;">[TODO.md]</span> |
| 372 | +</div> |
| 373 | +<span class="divider"></span> |
| 374 | +
|
| 375 | +<div class="content" id="mdtail-content"># TODO List |
| 376 | +
|
| 377 | +## This Week |
| 378 | +- [x] Setup project |
| 379 | +- [x] Write documentation |
| 380 | +- [x] Add tests |
| 381 | +- [ ] Deploy to production |
| 382 | +
|
| 383 | +## Next Sprint |
| 384 | +- [ ] User authentication |
| 385 | +- [ ] API integration |
| 386 | +- [ ] Performance optimization</div> |
| 387 | +
|
| 388 | +<span class="border"></span> |
| 389 | +<div class="navigation" style="color: #27c93f;">File updated • Tab 2 of 2 │ ← → Navigate │ Ctrl+C Exit</div>`; |
| 390 | + }, 100); |
| 391 | + }, 11000); // Update TODO.md after Claude shows "✓ Updated TODO.md" message |
359 | 392 | }, 3000); |
360 | 393 | } |
361 | 394 |
|
362 | 395 | async function runLeftPane() { |
363 | 396 | const container = document.getElementById('left-content'); |
364 | 397 |
|
365 | | - // Just show a prompt with cursor |
366 | | - const prompt = document.createElement('span'); |
367 | | - prompt.className = 'prompt'; |
368 | | - prompt.innerHTML = '$ '; |
369 | | - container.appendChild(prompt); |
| 398 | + // Show previous Claude command already executed |
| 399 | + const prevPrompt = document.createElement('span'); |
| 400 | + prevPrompt.className = 'prompt'; |
| 401 | + prevPrompt.innerHTML = '$ '; |
| 402 | + container.appendChild(prevPrompt); |
| 403 | + |
| 404 | + const prevCmd = document.createElement('span'); |
| 405 | + prevCmd.className = 'command'; |
| 406 | + prevCmd.textContent = 'claude'; |
| 407 | + container.appendChild(prevCmd); |
| 408 | + container.appendChild(document.createTextNode('\n')); |
| 409 | + |
| 410 | + // Claude welcome message |
| 411 | + const welcomeMsg = document.createElement('div'); |
| 412 | + welcomeMsg.style.color = '#569cd6'; |
| 413 | + welcomeMsg.innerHTML = 'Claude Code v1.0.1\n'; |
| 414 | + container.appendChild(welcomeMsg); |
| 415 | + |
| 416 | + const sessionMsg = document.createElement('div'); |
| 417 | + sessionMsg.style.color = '#888'; |
| 418 | + sessionMsg.innerHTML = 'Starting new session...\n\n'; |
| 419 | + container.appendChild(sessionMsg); |
| 420 | + |
| 421 | + // Show Claude prompt |
| 422 | + const claudePrompt = document.createElement('span'); |
| 423 | + claudePrompt.style.color = '#764ba2'; |
| 424 | + claudePrompt.innerHTML = '🤖 '; |
| 425 | + container.appendChild(claudePrompt); |
| 426 | + |
| 427 | + const cursor1 = document.createElement('span'); |
| 428 | + cursor1.className = 'cursor'; |
| 429 | + container.appendChild(cursor1); |
| 430 | + |
| 431 | + // Wait for mdtail to start and switch to TODO.md |
| 432 | + // Initial: 0.5s + npm typing: 1.3s + wait: 0.5s + npm output wait: 1s + |
| 433 | + // mdtail typing: 0.7s + wait: 0.5s + switch to TODO: 3s = ~7.5s |
| 434 | + // Adding buffer to ensure TODO.md is fully displayed |
| 435 | + await new Promise(r => setTimeout(r, 10000)); |
| 436 | + |
| 437 | + // Remove cursor and type claude command |
| 438 | + cursor1.remove(); |
| 439 | + const claudeCmd = document.createElement('span'); |
| 440 | + claudeCmd.className = 'command'; |
| 441 | + container.appendChild(claudeCmd); |
| 442 | + await typeText('add tests for the new feature and update TODO.md', claudeCmd, 50); |
| 443 | + |
| 444 | + await new Promise(r => setTimeout(r, 500)); |
| 445 | + container.appendChild(document.createTextNode('\n\n')); |
| 446 | + |
| 447 | + // Claude response |
| 448 | + const claudeOutput = document.createElement('div'); |
| 449 | + claudeOutput.className = 'output'; |
| 450 | + claudeOutput.style.color = '#d4d4d4'; |
| 451 | + claudeOutput.innerHTML = 'I\'ll add tests for the new feature and update the TODO list.\n\n'; |
| 452 | + container.appendChild(claudeOutput); |
| 453 | + |
| 454 | + await new Promise(r => setTimeout(r, 1000)); |
| 455 | + |
| 456 | + // Show creating test file |
| 457 | + const createTest = document.createElement('div'); |
| 458 | + createTest.style.color = '#608b4e'; |
| 459 | + createTest.innerHTML = '✓ Created test/feature.test.js\n\n'; |
| 460 | + container.appendChild(createTest); |
| 461 | + |
| 462 | + await new Promise(r => setTimeout(r, 500)); |
| 463 | + |
| 464 | + // Running tests |
| 465 | + const runningTests = document.createElement('div'); |
| 466 | + runningTests.style.color = '#888'; |
| 467 | + runningTests.innerHTML = 'Running tests...\n'; |
| 468 | + container.appendChild(runningTests); |
| 469 | + |
| 470 | + await new Promise(r => setTimeout(r, 1500)); |
| 471 | + |
| 472 | + // Test results |
| 473 | + const testResults = document.createElement('div'); |
| 474 | + testResults.style.color = '#27c93f'; |
| 475 | + testResults.innerHTML = 'PASS test/feature.test.js\n✓ 15 tests passed\n\n'; |
| 476 | + container.appendChild(testResults); |
| 477 | + |
| 478 | + await new Promise(r => setTimeout(r, 500)); |
| 479 | + |
| 480 | + // Update TODO.md after tests pass |
| 481 | + const updateTodo = document.createElement('div'); |
| 482 | + updateTodo.style.color = '#608b4e'; |
| 483 | + updateTodo.innerHTML = '✓ Updated TODO.md\n\n'; |
| 484 | + container.appendChild(updateTodo); |
| 485 | + |
| 486 | + // New Claude prompt |
| 487 | + const claudePrompt2 = document.createElement('span'); |
| 488 | + claudePrompt2.style.color = '#764ba2'; |
| 489 | + claudePrompt2.innerHTML = '🤖 '; |
| 490 | + container.appendChild(claudePrompt2); |
370 | 491 |
|
371 | 492 | // Add blinking cursor |
372 | 493 | const cursor = document.createElement('span'); |
|
0 commit comments