fix: Implement comprehensive edit event button functionality and resolve authentication issues
Major fixes and improvements: - Fixed edit event button functionality with proper event handlers and DOM ready state checking - Added status column to tickets table via Supabase migration to resolve 500 API errors - Updated stats API to correctly calculate revenue from decimal price values - Resolved authentication redirect loops by fixing cookie configuration for Docker environment - Fixed Permissions-Policy header syntax errors - Added comprehensive debugging and error handling for event management - Implemented modal-based event editing with form validation and API integration - Enhanced event data loading with proper error handling and user feedback 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
66
debug-theme.cjs
Normal file
66
debug-theme.cjs
Normal file
@@ -0,0 +1,66 @@
|
||||
const { test, expect } = require('@playwright/test');
|
||||
|
||||
test.describe('Theme Debug', () => {
|
||||
test('Debug theme switching mechanism', async ({ page }) => {
|
||||
// Navigate to the calendar page
|
||||
await page.goto('http://localhost:3000/calendar');
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
// Get initial state
|
||||
const initialTheme = await page.locator('html').getAttribute('data-theme');
|
||||
const initialClass = await page.locator('html').getAttribute('class');
|
||||
console.log('Initial theme attribute:', initialTheme);
|
||||
console.log('Initial class:', initialClass);
|
||||
|
||||
// Check if theme toggle exists
|
||||
const themeToggle = page.locator('#theme-toggle');
|
||||
const toggleExists = await themeToggle.isVisible();
|
||||
console.log('Theme toggle exists:', toggleExists);
|
||||
|
||||
if (toggleExists) {
|
||||
// Get initial CSS variable
|
||||
const initialCssVar = await page.evaluate(() => {
|
||||
const style = getComputedStyle(document.documentElement);
|
||||
return style.getPropertyValue('--glass-text-primary');
|
||||
});
|
||||
console.log('Initial --glass-text-primary:', initialCssVar);
|
||||
|
||||
// Click theme toggle
|
||||
await themeToggle.click();
|
||||
await page.waitForTimeout(1000); // Wait for transition
|
||||
|
||||
// Get state after toggle
|
||||
const newTheme = await page.locator('html').getAttribute('data-theme');
|
||||
const newClass = await page.locator('html').getAttribute('class');
|
||||
const newCssVar = await page.evaluate(() => {
|
||||
const style = getComputedStyle(document.documentElement);
|
||||
return style.getPropertyValue('--glass-text-primary');
|
||||
});
|
||||
|
||||
console.log('After toggle theme attribute:', newTheme);
|
||||
console.log('After toggle class:', newClass);
|
||||
console.log('After toggle --glass-text-primary:', newCssVar);
|
||||
|
||||
// Take screenshot after toggle
|
||||
await page.screenshot({ path: 'debug-after-toggle.png', fullPage: true });
|
||||
|
||||
// Check localStorage
|
||||
const savedTheme = await page.evaluate(() => localStorage.getItem('theme'));
|
||||
console.log('Saved theme in localStorage:', savedTheme);
|
||||
}
|
||||
|
||||
// Get all CSS variables in both states
|
||||
await page.evaluate(() => {
|
||||
// Log all glassmorphism variables
|
||||
const style = getComputedStyle(document.documentElement);
|
||||
const vars = {};
|
||||
for (let i = 0; i < style.length; i++) {
|
||||
const prop = style[i];
|
||||
if (prop.startsWith('--glass-') || prop.startsWith('--ui-')) {
|
||||
vars[prop] = style.getPropertyValue(prop);
|
||||
}
|
||||
}
|
||||
console.log('All theme variables:', vars);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user