Save before creating restore point: Periodic backup
Auto-saved at 2025-07-30 10:24:37 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -411,28 +411,76 @@ export function TimeshiftSpreadsheet({ teamId, teamName }: TimeshiftSpreadsheetP
|
||||
const rows = table.querySelectorAll('tr')
|
||||
if (rows[0]) {
|
||||
const cells = rows[0].querySelectorAll('td')
|
||||
const targetCell = cells[x + 1] as HTMLElement // +1 because first cell is row number
|
||||
console.log("Target cell found:", !!targetCell, "Target cell:", targetCell)
|
||||
let targetCell = cells[x + 1] as HTMLElement // +1 because first cell is row number
|
||||
console.log("Initial target cell found:", !!targetCell, "Cell display:", targetCell?.style.display, "Target cell:", targetCell)
|
||||
|
||||
// Handle both hidden and visible cells
|
||||
if (targetCell) {
|
||||
if (targetCell.style.display === 'none') {
|
||||
console.log("🔍 Target cell is hidden, finding visible merged cell...")
|
||||
const targetX = parseInt(String(x))
|
||||
|
||||
// For merged cells, find the visible cell that represents this position
|
||||
let foundCell = null
|
||||
|
||||
// Look for visible cells around this position
|
||||
for (let i = 1; i < cells.length; i++) {
|
||||
const cell = cells[i] as HTMLElement
|
||||
if (cell && cell.style.display !== 'none') {
|
||||
const cellX = parseInt(cell.getAttribute('data-x') || '0')
|
||||
const cellSpan = cell.colSpan || 1
|
||||
|
||||
// Check if this visible cell covers our target position
|
||||
if (cellX <= targetX && targetX < cellX + cellSpan) {
|
||||
foundCell = cell
|
||||
console.log("🎯 Found covering visible cell:", foundCell, "covers position", targetX)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (foundCell) {
|
||||
targetCell = foundCell
|
||||
} else {
|
||||
console.warn("❌ Could not find visible cell for hidden position")
|
||||
return // Skip if we can't find a visible cell
|
||||
}
|
||||
} else {
|
||||
console.log("✅ Target cell is visible, using directly")
|
||||
}
|
||||
}
|
||||
|
||||
if (targetCell) {
|
||||
const displayValue = value !== undefined && value !== null ? String(value).trim() : ''
|
||||
console.log("Processing value:", displayValue)
|
||||
console.log("Target cell before rotation:", targetCell.outerHTML)
|
||||
|
||||
if (displayValue) {
|
||||
// Apply rotation with improved styling
|
||||
targetCell.innerHTML = `<div style="
|
||||
transform: rotate(-90deg);
|
||||
font-size: 12px;
|
||||
height: 80px;
|
||||
width: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
white-space: nowrap;
|
||||
margin: 0 auto;
|
||||
transform-origin: center center;
|
||||
">${displayValue}</div>`
|
||||
// Force clear any existing content first
|
||||
targetCell.innerHTML = ''
|
||||
|
||||
// Apply rotation with improved styling - using important to override jspreadsheet styles
|
||||
const rotatedDiv = document.createElement('div')
|
||||
rotatedDiv.style.cssText = `
|
||||
transform: rotate(-90deg) !important;
|
||||
font-size: 12px !important;
|
||||
height: 80px !important;
|
||||
width: 20px !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
white-space: nowrap !important;
|
||||
margin: 0 auto !important;
|
||||
transform-origin: center center !important;
|
||||
position: relative !important;
|
||||
color: #000 !important;
|
||||
background: transparent !important;
|
||||
`
|
||||
rotatedDiv.textContent = displayValue
|
||||
targetCell.appendChild(rotatedDiv)
|
||||
|
||||
console.log("✅ Rotation applied successfully to cell with value:", displayValue)
|
||||
console.log("Target cell after rotation:", targetCell.outerHTML)
|
||||
} else {
|
||||
// Clear cell content but maintain structure
|
||||
targetCell.innerHTML = ''
|
||||
|
||||
Reference in New Issue
Block a user