Files
Momento/memento-note/playwright-test.ts
Sepehr Ramezani aa6a214f37 feat: rename keep-notes to memento-note, migrate to PostgreSQL, fix MCP bugs
- Rename directory keep-notes -> memento-note with all code references
- Prisma: SQLite -> PostgreSQL (both app and MCP server schemas)
- Sync MCP schema with main app (add missing fields, relations, indexes)
- Delete 17 SQLite migrations (clean slate for PostgreSQL)
- Remove SQLite dependencies (@libsql/client, better-sqlite3, etc.)
- Fix MCP server: hardcoded Windows DB paths -> DATABASE_URL env var
- Fix MCP server: .dockerignore excluded index-sse.js (SSE mode broken)
- MCP Dockerfile: node:20 -> node:22
- Docker Compose: add postgres service, remove SQLite volume
- Generate favicon.ico, icon-192.png, icon-512.png, apple-icon.png
- Update layout.tsx icons and manifest.json for PNG icons
- Update all .env files for PostgreSQL
- Rewrite README.md with updated sections
- Remove mcp-server/node_modules and prisma/client-generated from git tracking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-20 20:58:04 +02:00

93 lines
3.0 KiB
TypeScript

/**
* Playwright test script to diagnose MasonryGrid hot reload issue
*/
const { chromium } = require('playwright');
async function testMasonryLayout() {
console.log('🔍 Starting Masonry layout diagnosis...');
const browser = await chromium.launch({
headless: false, // Show browser for visual inspection
slowMo: 50, // Slow down actions for better visibility
});
const context = await browser.newContext({
viewport: { width: 1920, height: 1080 }
});
const page = await context.newPage();
// Navigate to the app
await page.goto('http://localhost:3000');
// Wait for page to load
await page.waitForTimeout(3000);
// Take screenshot of initial state
await page.screenshot({ path: 'masonry-before.png', fullPage: true });
console.log('📸 Screenshot saved: masonry-before.png');
// Check DOM for MasonryItem elements
const masonryItems = await page.$$eval('.masonry-item', (items) => {
return items.map(item => ({
hasDataSize: item.hasAttribute('data-size'),
dataSize: item.getAttribute('data-size'),
hasStyle: item.hasAttribute('style'),
style: item.getAttribute('style'),
className: item.className,
computedWidth: window.getComputedStyle(item).width,
}));
});
console.log('🎯 MasonryItem analysis:');
console.table(masonryItems);
// Check which items have inline styles
const itemsWithInlineStyle = masonryItems.filter(item => item.hasStyle);
console.log(`✓ Items with inline style attribute: ${itemsWithInlineStyle.length}/${masonryItems.length}`);
// Check which items have data-size attribute
const itemsWithDataSize = masonryItems.filter(item => item.hasDataSize);
console.log(`✓ Items with data-size attribute: ${itemsWithDataSize.length}/${masonryItems.length}`);
// Analyze computed widths
const uniqueWidths = [...new Set(masonryItems.map(item => item.computedWidth))];
console.log(`📏 Unique computed widths found:`, uniqueWidths);
// Check if Muuri is initialized
const muuriStatus = await page.evaluate(() => {
const gridElement = document.querySelector('.muuri-item');
if (!gridElement) return 'No Muuri grid found';
const gridRect = gridElement.getBoundingClientRect();
const muuriContainer = gridElement.parentElement;
if (muuriContainer) {
const containerRect = muuriContainer.getBoundingClientRect();
return {
gridRect,
containerRect,
isMuuriInitialized: true,
};
}
return 'Muuri not initialized';
});
console.log('\n🧩 Muuri grid status:', muuriStatus);
// Take second screenshot after analysis
await page.screenshot({ path: 'masonry-after-analysis.png', fullPage: true });
console.log('📸 Screenshot saved: masonry-after-analysis.png');
// Keep browser open for manual inspection
console.log('\n⏳ Keeping browser open for 30 seconds for manual inspection...');
await page.waitForTimeout(30000);
await browser.close();
console.log('✅ Test complete');
}
testMasonryLayout().catch(console.error);