debug: instrument dropdown clipping in TicketCard (temp)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -44,6 +44,37 @@ export default function TicketCard({ ticket, onUpdate }) {
|
||||
|
||||
const stop = (e) => e.stopPropagation()
|
||||
|
||||
// #region agent log
|
||||
const logClip = (e, which) => {
|
||||
try {
|
||||
const root = e.currentTarget
|
||||
const content = root.querySelector('.dropdown-content')
|
||||
if (!content) return
|
||||
requestAnimationFrame(() => {
|
||||
const cr = content.getBoundingClientRect()
|
||||
const clippers = []
|
||||
let el = content.parentElement
|
||||
while (el && el !== document.body) {
|
||||
const cs = getComputedStyle(el)
|
||||
if (cs.overflowX !== 'visible' || cs.overflowY !== 'visible') {
|
||||
const r = el.getBoundingClientRect()
|
||||
clippers.push({
|
||||
cls: String(el.className || '').slice(0, 40),
|
||||
ox: cs.overflowX, oy: cs.overflowY,
|
||||
cutBottom: +(cr.bottom - r.bottom).toFixed(1),
|
||||
cutRight: +(cr.right - r.right).toFixed(1),
|
||||
cutTop: +(r.top - cr.top).toFixed(1),
|
||||
cutLeft: +(r.left - cr.left).toFixed(1),
|
||||
})
|
||||
}
|
||||
el = el.parentElement
|
||||
}
|
||||
fetch('http://127.0.0.1:7284/ingest/0747da40-b90b-4354-9b84-c9b550a81ec9', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Debug-Session-Id': '693b5f' }, body: JSON.stringify({ sessionId: '693b5f', runId: 'pre-fix', hypothesisId: 'A', location: 'TicketCard.jsx:hoverClip', message: 'dropdown clip measure', data: { which, contentH: +cr.height.toFixed(1), clippers }, timestamp: Date.now() }) }).catch(() => {})
|
||||
})
|
||||
} catch { /* ignore */ }
|
||||
}
|
||||
// #endregion
|
||||
|
||||
const handleCreateWorksheet = async (worksheetData, currentUser) => {
|
||||
const result = await createWorksheet(worksheetData, currentUser)
|
||||
if (result.success && worksheetData.newStatus !== ticket.status) {
|
||||
@@ -66,7 +97,7 @@ export default function TicketCard({ ticket, onUpdate }) {
|
||||
<div className="tcard-body">
|
||||
<div className="tcard-row1">
|
||||
<span className="tcard-customer">{ticket.customerName || 'Unbekannt'}</span>
|
||||
{ticket.customerLocation && <span className="tcard-loc"><EFBFBD> {ticket.customerLocation}</span>}
|
||||
{ticket.customerLocation && <span className="tcard-loc"><EFBFBD> {ticket.customerLocation}</span>}
|
||||
</div>
|
||||
<div className="tcard-topic">{ticket.topic || ticket.title || 'Kein Betreff'}</div>
|
||||
<div className="tcard-badges">
|
||||
@@ -78,7 +109,7 @@ export default function TicketCard({ ticket, onUpdate }) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="tcard-side" onClick={stop}>
|
||||
<div className="tcard-side" onClick={stop} onMouseEnter={(e) => logClip(e, 'side-status-prio')}>
|
||||
<div style={{ minWidth: 120 }}>
|
||||
<StatusDropdown value={ticket.status} onChange={(v) => onUpdate(ticket.$id, { status: v })} />
|
||||
</div>
|
||||
@@ -91,7 +122,7 @@ export default function TicketCard({ ticket, onUpdate }) {
|
||||
|
||||
{expanded && (
|
||||
<div className="tcard-detail">
|
||||
<div className="flex gap-3 wrap" style={{ marginBottom: 16, fontSize: 13 }}>
|
||||
<div className="flex gap-3 wrap" style={{ marginBottom: 16, fontSize: 13 }} onMouseEnter={(e) => logClip(e, 'detail-editor-response')}>
|
||||
<span className="muted"><FaPlay style={{ color: 'var(--ok)' }} /> {ticket.startDate || format(createdAt, 'dd.MM.yyyy')}</span>
|
||||
<span className="muted"><FaStop style={{ color: 'var(--danger)' }} /> {ticket.deadline || '-'}</span>
|
||||
{ticket.requestedBy && <span className="muted">Angefragt von: {ticket.requestedBy}</span>}
|
||||
|
||||
Reference in New Issue
Block a user