@@ -1601,13 +1601,44 @@ const LOG_ICONS = {
16011601
16021602/**
16031603 * Wraps a message with a simulation ID tooltip for correlation.
1604+ * Clicking the message copies the simulation ID to clipboard.
16041605 * @param {string } message - The message to display
16051606 * @param {string } simulationId - The full GUID simulation ID (shown in tooltip)
16061607 * @returns {string } HTML string with message and tooltip
16071608 */
16081609function withSimulationId ( message , simulationId ) {
16091610 if ( ! simulationId ) return message ;
1610- return `<span class="sim-msg" title="Simulation ID: ${ simulationId } ">${ message } </span>` ;
1611+ return `<span class="sim-msg" data-simid="${ simulationId } " title="Click to copy Simulation ID: ${ simulationId } ">${ message } </span>` ;
1612+ }
1613+
1614+ /**
1615+ * Copies the simulation ID to clipboard when a sim-msg element is clicked.
1616+ * Shows a brief visual feedback to indicate successful copy.
1617+ */
1618+ function initSimulationIdCopyHandlers ( ) {
1619+ document . getElementById ( 'eventLog' ) . addEventListener ( 'click' , async ( e ) => {
1620+ const simMsg = e . target . closest ( '.sim-msg' ) ;
1621+ if ( ! simMsg ) return ;
1622+
1623+ const simId = simMsg . dataset . simid ;
1624+ if ( ! simId ) return ;
1625+
1626+ try {
1627+ await navigator . clipboard . writeText ( simId ) ;
1628+
1629+ // Visual feedback
1630+ simMsg . classList . add ( 'copied' ) ;
1631+ const originalTitle = simMsg . title ;
1632+ simMsg . title = 'Copied!' ;
1633+
1634+ setTimeout ( ( ) => {
1635+ simMsg . classList . remove ( 'copied' ) ;
1636+ simMsg . title = originalTitle ;
1637+ } , 1500 ) ;
1638+ } catch ( err ) {
1639+ console . error ( 'Failed to copy simulation ID:' , err ) ;
1640+ }
1641+ } ) ;
16111642}
16121643
16131644/**
@@ -1780,6 +1811,9 @@ document.addEventListener('DOMContentLoaded', async () => {
17801811 // Wire up side panel toggle
17811812 initializeSidePanel ( ) ;
17821813
1814+ // Enable click-to-copy for simulation IDs in event log
1815+ initSimulationIdCopyHandlers ( ) ;
1816+
17831817 logEvent ( 'system' , `Dashboard initialized (probe rate: ${ CONFIG . latencyProbeIntervalMs } ms, idle timeout: ${ CONFIG . idleTimeoutMinutes } m)` ) ;
17841818} ) ;
17851819
0 commit comments