Arena.ai | Collapsible Code Blocks

Adds collapsible code blocks with clickable headers, footer controls, and a global toolbar toggle

Acestea sunt versiunile scriptului în care codul a fost actualizat. Arată toate versiunile.

  • v5.4.1 31-01-2026

    v5.4.1

    • Cleanup
      • Removed stale “embedded or floating” comment (floating mode was removed in v5.3).
      • Removed extra blank‑line remnant.

    v5.4

    • Cleanup
      • Reordered changelog from newest to oldest.
      • Consolidated duplicate v4.6 entries.
      • Fixed misplaced v5.2-diag.x entries.

    v5.3.2

    • Cleanup (Tier B)
      • Simplified diagnostic‑state tracking (kept DIAG_MODE toggle for future debugging).
      • Removed unused tooltip CSS (left/right arrows + tooltip‑main/hint selectors).
    • Robustness
      • Made toolbar reinjection tolerant of transient form rerenders (reduces flicker; keeps re‑injection reliability).
    • Fix
      • Removed stale reference to a non‑existent toolbar‑mode variable in post‑init verification.

    v5.3

    • Cleanup
      • Removed hybrid/floating/drag toolbar modes (back to embedded toolbar only).
      • Removed dynamic tooltip positioning + drag‑UI logic (keeps simple tooltips/hold‑to‑toggle).
      • Diagnostics disabled by default (can be re‑enabled for troubleshooting).
    • Kept
      • Background‑tab safe init (prevents React hydration mismatch / error #418).

    v5.2‑diag.2

    • Fix
      • Do not mutate React DOM while the tab is hidden (prevents hydration mismatch / React error #418).
    • Added
      • Deferred initialization (pendingStart) that runs only after the tab becomes visible.
    • Diagnostics
      • Log when init is deferred due to background‑tab state.

    v5.2‑diag.1

    • Fix
      • Added missing diagnostic helpers (logStage, diagDOMState, initStages) to prevent ReferenceError on load.
    • Diagnostics
      • Expanded debug output to help reproduce background‑tab initialization issues.

    v5.2

    • MAJOR
      • Hybrid toolbar mode – embedded when safe, floating on conflict.
    • Embedded mode
      • Integrates into input area, non‑draggable (like pre‑5.0).
    • Floating mode
      • Activated automatically if React removes the embedded button.
    • Smart tooltips
      • Dynamically positioned to never be cut off by the viewport.
      • Hide during drag operations.
      • Explain right‑drag functionality.
    • General
      • Toolbar appears only when a chat input area is present.

    v5.1

    • Fixed
      • Toolbar always visible on chat pages (dimmed when no code blocks).
      • Default position moved slightly more visible (bottom‑right, offset from edge).

    v5.0

    • Added
      • @match *://*canaryarena.ai/*.
      • Toolbar as a floating button (never injected into React DOM).
      • Right‑drag to move the toolbar button anywhere.
      • Position persisted per session (survives page navigation).
      • Tooltip on hover explaining controls.
    • Fixed
      • No longer conflicts with other userscripts’ UI elements.
      • Works correctly when opened in background tabs.
    • Removed
      • MutationObserver‑based toolbar re‑creation (no longer needed).
      • Form/textarea dependency for toolbar placement.
  • v5.0 31-01-2026

    Added:

    • @match ://canaryarena.ai/
  • v4.9 28-01-2026

    v4.9

    • Renamed from LMArena to Arena.ai
  • v4.8 12-01-2026
    • Removed: width preservation on collapse (caused horizontal scrolling on narrow viewports)
    • Collapsed blocks now use natural width instead of forced minWidth
  • v4.7 12-01-2026

    // v4.3 // - Changed: single-block expand no longer uses scroll anchoring // - Expanding a block now keeps the header in place; code appears below (no viewport shift) // - Lets user read expanded code from the beginning instead of being scrolled to the bottom

    // v4.4
    // - Fixed: single-block expand now actively scrolls header to top of viewport
    // - Ensures user always sees expanded code from the beginning (overrides browser scroll anchoring)
    
    // v4.5
    // - Refined: single-block expand only scrolls if header is in bottom 1/3 of viewport or off-screen
    // - If header is already visible in upper 2/3, no scroll adjustment occurs
    //
    // v4.6
    // - Fixed: single-block collapse no longer "snaps" the header down to the old footer position in some scroll states
    // - Changed: when collapsing a block while its header is visible, the header is used as the scroll anchor (keeps it stable)
    // - Fixed: auto-collapse on newly added blocks no longer triggers single-block scroll behavior
    //
    // v4.6
    // - Fixed: single-block expand now first stabilizes the header position (cancels browser/scroll-area anchoring)
    // - Refined: only scrolls header to top if it ends up off-screen or in the bottom ~15% of the viewport
    //
    // v4.7
    // - Cleanup: removed unused `data` parameter from internal log function
    // - Cleanup: removed unused boolean return values from createToolbarButton()
    // - Cleanup: consolidated duplicate CSS rules and keyframe definitions
    
  • v4.2 31-12-2025

    v4.1
    - Cleanup: removed overridden CSS declaration (border-radius: 0 0 0 0)
    - Cleanup: removed unused 'warn' log style
    - Cleanup: removed redundant typeof guard for activeFixedState
    - Cleanup: consolidated duplicate mouseleave handlers on collapse button

    v4.2
    - Changed: replaced localStorage with GM_setValue/GM_getValue for settings persistence
    - Settings now stored via userscript manager (more reliable, syncs across browsers if supported)

  • v4.0 30-12-2025

    v4.0
    - Fixed: fixed footer now repositions when textarea grows during user input
    - Added ResizeObserver on input area to detect height changes
    - Footer no longer conflicts with/covers the textarea when it expands

  • v3.9 30-12-2025

    v3.8
    - Fixed: conflict with other userscripts (Multi-Provider Chat Export, etc.)
    - Added 1000ms initialization delay to avoid React Hydration Error #418

    v3.9
    - Replaced hardcoded delay with dynamic Stabilization Observer
    - Detects React hydration completion by watching for the chat input bar
    - Uses requestIdleCallback for optimal performance/compatibility

  • v3.7 29-12-2025

    Script name changed from "LMArena | Code Block Collapse" to "LMArena | Collapsible Code Blocks"

  • v3.6 29-12-2025